Top Unix Command Line Utilities
21–30 of 65 posts
Re: Top Unix Command Line Utilities
#22These 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…
I think the only "secure" way to erase the contents of a hard drive is to repeatedly overwrite the disk surface with a mix of random/patterened data (like Darik's Boot & Nuke does). 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…
Multiple over writes is pointless. There's the Gutmann stuff, but that's ancient and the 35 passes was for multiple drive controllers, if you didn't know what drive controller was being used.
But then sometimes you don't have to do what works, but what other people tell you. Thus, if you're working to a standard it doesn't matter if DOD specifications are actually more secure than a single secure erase, you do what the spec calls for. And if you have to persuade other people that the data is provably gone it's easiest to just grind the drives.
Re: Top Unix Command Line Utilities
#23Where's the love for awk? It has been tucked away in a sub item but doesn't deserve first class status?
That whole "find -ls | awk" is wicked slow anyway; try wc and xargs... $ time find -ls | awk '{s += $7} END {print s}' 15970582120 real 0m27.721s user 0m1.256s sys 0m1.780s $ time find | xargs wc -c 2> /dev/null | tail -1 604260969 total real 0m0.332s user 0m0.068s sys 0m0.204s
$ find -print0 | xargs -0 wc -c 2> /dev/null | tail -1
(Also, many uses of find | xargs can be replaced with -exec cmd {} \; or -exec cmd {} +, e.g. $ find -exec wc -c {} + 2> /dev/null | tail -1
although this isn't much faster in this case.)Re: Top Unix Command Line Utilities
#24I'm a heavy command line user (I don't have a graphical file explorer/manager for instance). Here is my top 42, in order of usage: ls, cd, git, ssh, make, e, cat, veille, rm, wpa_supplicant, grep, evince, mv, x, dhclient, cp, echo, todo, mplayer, scp, man, mkdir, ack, pdflatex, apt-get, apt-cache, sed, less, feh, racket, gcc, wget, xrandr, bg, svn, pmount, for, gpg, halt, ping, tail, top. "e" is an alias for emacscli…
cat ~/.bash_history | cut -f1 -d' ' | sort | uniq -c | sort -n -r
turns out my .bash_history is clipped at it's default size-limit (500 lines). So I'll change that to gather more data for next year. My results started with:
147 clang++
77 ls
54 cd
15 gs
14 rake
13 vim
...where gs is short for "git status" ...and thanks for the hint about the substitution! I updated it on my page.
Re: Top Unix Command Line Utilities
#25cat ~/.bash_history | cut -f1 -d' ' | sort | uniq -c | sort -rn | head -10 | cut -b9-
That's not enough, you need to split lines on "|" and ';' and before that after for's "do" and if's "then".
sed 's/ *| */\n/g' ~/.bash_history | cut -f1 -d' ' | ...
(This fails on something like "echo 'a | b'" and doesn't split correctly on |& and || and doesn't split at all on &&.)Re: Top Unix Command Line Utilities
#26Where's the love for awk? It has been tucked away in a sub item but doesn't deserve first class status?
That whole "find -ls | awk" is wicked slow anyway; try wc and xargs... $ time find -ls | awk '{s += $7} END {print s}' 15970582120 real 0m27.721s user 0m1.256s sys 0m1.780s $ time find | xargs wc -c 2> /dev/null | tail -1 604260969 total real 0m0.332s user 0m0.068s sys 0m0.204s
Re: Top Unix Command Line Utilities
#27Where's the love for awk? It has been tucked away in a sub item but doesn't deserve first class status?
That whole "find -ls | awk" is wicked slow anyway; try wc and xargs... $ time find -ls | awk '{s += $7} END {print s}' 15970582120 real 0m27.721s user 0m1.256s sys 0m1.780s $ time find | xargs wc -c 2> /dev/null | tail -1 604260969 total real 0m0.332s user 0m0.068s sys 0m0.204s
Also, the results are different - though I'm too lazy to figure out why right now :)
Re: Top Unix Command Line Utilities
#28Where's the love for awk? It has been tucked away in a sub item but doesn't deserve first class status?
Re: Top Unix Command Line Utilities
#29Re: Top Unix Command Line Utilities
#30Earlier quoted context omitted.
That whole "find -ls | awk" is wicked slow anyway; try wc and xargs... $ time find -ls | awk '{s += $7} END {print s}' 15970582120 real 0m27.721s user 0m1.256s sys 0m1.780s $ time find | xargs wc -c 2> /dev/null | tail -1 604260969 total real 0m0.332s user 0m0.068s sys 0m0.204s
I am not familiar with awk, what's the 's+= $7'? What is the argument 2 passed to wc? Why is the produced output different? What am I missing here?