Top Unix Command Line Utilities
blog.coldflake.com
Top Unix Command Line Utilities
1–10 of 65 posts
Re: Top Unix Command Line Utilities
#2Re: Top Unix Command Line Utilities
#3Some issues:
- don't forget that /dev/random blocks
- It's easier to use dd_rescue to track progress than to signal dd
- Using dd to zero out a hard drive repeatedly doesn't increase security[1]. Using ATA secure erase does[2]
- an alternative for summing file sizes is
du -ch **/*.png
[1] http://en.wikipedia.org/wiki/Data_erasure#Number_of_overwrit...Re: Top Unix Command Line Utilities
#4Got a feeling they ran out of utilities to mention by the end. Even very new users of *nix will likely have heard of and used `find` and `zip`.
Re: Top Unix Command Line Utilities
#5Re: Top Unix Command Line Utilities
#6joe, ls, cd, time, cdbdump, tail, more, cat, rm, grep, wc, apachectl restart, find, curl, chmod, history, mv, locate, cpan, apt-get, pwd
But the most useful one is a command line Perl utility I called "flt" that executes a block of perl code for each in the stdin.
cat file.txt | flt ' $line=~ s|\s+| |gsi; print $line."\n"; '
That would compact free spaces
find . | flt ' if (-f $line) { print (-s $line)."\n"; } '
This would print the size of all files in the current folder and subfolders.
So it works like awk, but with full Perl, no need to learn awk syntax. You can do conditionals, loops and whatnot. I write 30% of my one time throw away scripts directly in the command line.
Re: Top Unix Command Line Utilities
#7Re: Top Unix Command Line Utilities
#8My 2012 top, in order of usage: joe, ls, cd, time, cdbdump, tail, more, cat, rm, grep, wc, apachectl restart, find, curl, chmod, history, mv, locate, cpan, apt-get, pwd But the most useful one is a command line Perl utility I called "flt" that executes a block of perl code for each in the stdin. cat file.txt | flt ' $line=~ s|\s+| |gsi; print $line."\n"; ' That would compact free spaces find . | flt ' if (-f $line) {…
http://perldoc.perl.org/perlrun.html#*-n*
Those "flt" lines could be written
perl -lpe 's|\s+| |gsi' file.txt
find . | perl -ne 'if (-f) { print -s }'
(-l chomps the incoming newlines, and puts them back on the output)Of course, "perl -ne" is longer than "flt", and I appreciate all this implicit use of $_ is not to everyone's tastes.
Re: Top Unix Command Line Utilities
#9These obviously aren't related to 2012 at all. Some issues: - don't forget that /dev/random blocks - It's easier to use dd_rescue to track progress than to signal dd - Using dd to zero out a hard drive repeatedly doesn't increase security[1]. Using ATA secure erase does[2] - an alternative for summing file sizes is du -ch **/*.png [1] http://en.wikipedia.org/wiki/Data_erasure#Number_of_overwrit... [2] https://ata.wik…
Also, for those wondering about the blocking of /dev/random, it will restrict the number of bits you can copy using dd, but this won't be apparent unless you attempt to copy more bits from the entropy pools than there are available for random number generation. For more information, see this question on Super User: http://superuser.com/questions/520601/why-does-dd-only-copy-...