So basically the same as in 1985?
Top Unix Command Line Utilities
51–60 of 65 posts
Re: Top Unix Command Line Utilities
#52Combine sort and uniq is useless since sort has already -u flag.
is something I use all the time to get sorted frequency tables.
Re: Top Unix Command Line Utilities
#53Does anybody know of great guides to master the majority of the useful CLI tools available on Unix and Linux? For me the challenge is that I don't even know I have some of these fantastic solutions readily available. I'd really benefit of knowing they're there in the first place instead of hacking a homebrew solution every time. Learn Linux the Hard Way talks about them quite a bit, is that the go to guide in 2012 or…
I also learned a lot from "The Linux Cookbook" (Second Edition) by Michael Stutz (this might be the first edition online: http://dsl.org/cookbook/cookbook_toc.html).
Re: Top Unix Command Line Utilities
#54Earlier quoted context omitted.
The for loop works fine. Performing word splitting/wildcard expansion/etc on a variable will, well, split it into words/expand wildcards/etc, whether it was introduced by a for loop or not.
I am not sure I understand what you mean. Word-splitting is performed by the "for x in y" construct, using the IFS variable, so by default if you have a file called "foo bar.mp4" the command line from the article: for i in *.mp4; do ffmpeg -i "$i" "${i%.mp4}.mp3"; done will result in executing: ffmpeg -i foo foo.mp3 ffmpeg -i bar.mp4 bar.mp3 Which is obviously not what was meant. So it's a good habit to learn to loop…
for i in `find -name '*.mp4'`; do # ...
or similar. In that case, the output of `find` is indeed split first, and `for` sees "foo", "bar.mp4", and so on.Re: Top Unix Command Line Utilities
#55Combine sort and uniq is useless since sort has already -u flag.
sort | uniq -c | sort -n is something I use all the time to get sorted frequency tables.
Re: Top Unix Command Line Utilities
#56The second #6 example, the one with xargs, is wrong. Xargs(1) doesn't necessarily create a single du process, it might create several.
Any arguments specified on the command line are given to utility upon each invocation, followed by some number of the arguments read from the standard input of xargs. The utility is repeatedly executed until standard input is exhausted.
and
-P maxprocs Parallel mode: run at most maxprocs invocations of utility at once.
The way I interpret that is that you could run xargs in parallel mode, but by default the "utility is repeatedly executed" in the same process.
Re: Top Unix Command Line Utilities
#57Combine sort and uniq is useless since sort has already -u flag.
Re: Top Unix Command Line Utilities
#58Earlier quoted context omitted.
I am not sure I understand what you mean. Word-splitting is performed by the "for x in y" construct, using the IFS variable, so by default if you have a file called "foo bar.mp4" the command line from the article: for i in *.mp4; do ffmpeg -i "$i" "${i%.mp4}.mp3"; done will result in executing: ffmpeg -i foo foo.mp3 ffmpeg -i bar.mp4 bar.mp3 Which is obviously not what was meant. So it's a good habit to learn to loop…
Maybe you are confusing this with what happens when you do for i in `find -name '*.mp4'`; do # ... or similar. In that case, the output of `find` is indeed split first, and `for` sees "foo", "bar.mp4", and so on.
Re: Top Unix Command Line Utilities
#59These 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…
Why? I just use: watch pkill -USR1 dd
Re: Top Unix Command Line Utilities
#60Earlier quoted context omitted.
My .bash_history weights 1.7Mo (almost 100k lines). I set a very high HISTSIZE since I don't see any reason to lose this data.
One reason might be that bash reads this whole file into memory on interactive startup and rewrites it completely when shutting down.