Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

Five Reasons to Use Linux
FOSS Force ^ | 5/28/15 | Christine Hall

Posted on 05/29/2015 3:37:12 AM PDT by markomalley

click here to read article


Navigation: use the links below to view more comments.
first previous 1-2021-4041-52 last
To: zeugma
Somehow we went from Unix to Linux.

For me, the fact that windows doesn't have anything near as powerful as sed, awk and grep is a deal killer

By what measure is Powershell not nearly as powerful as sed, awk, and grep?

41 posted on 05/29/2015 11:10:59 AM PDT by tacticalogic ("Oh, bother!" said Pooh, as he chambered his last round.)
[ Post Reply | Private Reply | To 40 | View Replies]

To: tacticalogic
I don't know. Tell me how you'd find a list of all duplicate files on your computer with powershell. I'm talking of actual duplicate files here. The names may be different, but the files are exactly the same by actual content.

I have a 5-line bit of shellcode that does a pretty good job of it.

42 posted on 05/29/2015 12:19:44 PM PDT by zeugma (Are there more nearby spiders than the sun is big?)
[ Post Reply | Private Reply | To 41 | View Replies]

To: zeugma

In the current version (V4)

$md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$ht = @{}
get-childitem c:\ -Recurse -File |
Select -ExpandProperty FullName |
foreach {
$hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($_.FullName)))
$ht[$hash] += @($_.FullName)
}

$ht.GetEnumerator() |
Where {$_.Value.count -gt 1}

V5, which will be released with Windows 10 has a Get-FileHash command that would simplify that down to about half as many lines of code.

So, by what measure is that not nearly as powerful as sed, awk, and grep ( assuming that’s what your 5-line bit of shell code is using to find those duplicate files).


43 posted on 05/29/2015 12:53:30 PM PDT by tacticalogic ("Oh, bother!" said Pooh, as he chambered his last round.)
[ Post Reply | Private Reply | To 42 | View Replies]

To: markomalley

your reason 7 is actually one of the biggest reasons people won’t. Too many options just confuses and frustrates people.


44 posted on 05/29/2015 12:57:00 PM PDT by discostu (In fact funk's as old as dirt)
[ Post Reply | Private Reply | To 1 | View Replies]

To: discostu
Too many options just confuses and frustrates people.

99% of the people out there can do just fine...better than fine...running Mint, Ubuntu, or Fedora.

Unless you are doing console work, you really won't notice that much of a difference between the three (except that Ubuntu has these really annoying sounds in the default theme). More importantly, from the GUI, if you can run one of them, you can run any of those three.

For those with different needs or different hardware, that's when you need to start playing around with other distros...for example, Peppermint (as I mentioned above). Again, though, from the User POV, there really isn't all that much of a difference in how they run...unless you start going to the console level.

Personally, I think that Linux users are the biggest impediment to more widespread Linux use by consumers. (Try going on a Linux forum and either asking a question that's already been asked...even if it was asked 10 years ago...you'll likely get a smart-aleck "search is your friend" answer. Alternatively, you'll get 50 lines of code to input. While that works just fine for those who aren't intimidated by it, grandma may want a point-and-click solution so she can send an email to Betty)

45 posted on 05/29/2015 2:20:44 PM PDT by markomalley (Nothing emboldens the wicked so greatly as the lack of courage on the part of the good -- Leo XIII)
[ Post Reply | Private Reply | To 44 | View Replies]

To: tacticalogic

well then, congratulations for finally making it into the 21st century! That stuff is almost as unreadable as perl. :-)

I guess now I won’t be letting the windows admin guys off anymore because the poor bastards don’t have the tools needed to do their job properly.


46 posted on 05/29/2015 2:29:24 PM PDT by zeugma (Are there more nearby spiders than the sun is big?)
[ Post Reply | Private Reply | To 43 | View Replies]

To: markomalley

But now you’re in territory known as “expert friendly”. People don’t want to put that much work into deciding something. Especially because most folks don’t even know what they’re needs would be, they want to treat their computer as an appliance, they want it to be like buying a microwave.


47 posted on 05/29/2015 2:35:05 PM PDT by discostu (In fact funk's as old as dirt)
[ Post Reply | Private Reply | To 45 | View Replies]

To: tacticalogic
BTW, your solution is almost the same as mine... the 'find' that does the work is actualy one line of code but I break into separate lines for legibility. I've actually considered going to sha256, but so far I haven't had any false collisions using md5. I love hashes. Useful little buggers.

#!/bin/sh

OUTF=rem-duplicates.sh;

echo "#! /bin/sh" > $OUTF;

find "$@" -type f -print0 | \
    xargs -0 -n1 md5sum | \
    sort --key=1,32 | \
    uniq -w 32 -d --all-repeated=separate | \
    sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' >> $OUTF;

chmod a+x $OUTF; ls -l $OUTF
 

48 posted on 05/29/2015 2:36:15 PM PDT by zeugma (Are there more nearby spiders than the sun is big?)
[ Post Reply | Private Reply | To 43 | View Replies]

To: zeugma
I guess now I won’t be letting the windows admin guys off anymore because the poor bastards don’t have the tools needed to do their job properly.

I'm beginning to understand why you think there's no decent command line tools in Windows. You've been snookered by the Windows admin guys!

49 posted on 05/29/2015 2:37:39 PM PDT by tacticalogic ("Oh, bother!" said Pooh, as he chambered his last round.)
[ Post Reply | Private Reply | To 46 | View Replies]

To: zeugma

I’m loading mine into a hash table (using the hash value as the key) as the hashes are calculated, instead of calculating all the hashes and then going back and sorting for unique values after.


50 posted on 05/29/2015 2:45:07 PM PDT by tacticalogic ("Oh, bother!" said Pooh, as he chambered his last round.)
[ Post Reply | Private Reply | To 48 | View Replies]

To: markomalley

So....you going to be able to beat the witch?


51 posted on 05/29/2015 6:07:51 PM PDT by citizen (WalkeRubio RIGHT For You 2016)
[ Post Reply | Private Reply | To 10 | View Replies]

To: Doug Loss; markomalley

Thanks guys for the advice.Posting from the newly installed Ubuntu 10.04.04 on the old Acer. It works like a dream! Had a little trouble during the install as the ACER BIOS wouldn’t recognize the first USB stick that I tried (even though it recognized it in XP). Once I made the switch to another stick, it installed with no problems. Thanks again!


52 posted on 06/10/2015 7:54:16 AM PDT by CommieCutter
[ Post Reply | Private Reply | To 24 | View Replies]


Navigation: use the links below to view more comments.
first previous 1-2021-4041-52 last

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson