No need for grep or xargs
saves one command. Needs GNU grep though :-(
or change the frequency of the beep
If you really _must_ use a loop, this is better than parsing the output of 'ps': PID=$! ;while kill -0 $PID &>/dev/null; do sleep 1; done kill -0 $PID returns 0 if the process still exists; otherwise 1
Very useful for recording radio scanner for instance as the resulting audio file contains only audio signal that exceeds -45dB and the file name tells you when the recording was done. Why waste time listening silence? ;) Show Sample Output
Cleaner, but probably less portable. Works with bash4 and should also work on bash3. IIRC, $(()) and (()) are bashisms, not POSIX. Show Sample Output
As odd as this may be, I know of servers where the man(1) command is not installed, and there is not enough room on / to install it. However, zcat(1), nroff(1) and less(1) are. This is a way to read those documents without the proper tool to do so, as sad as this may seem. :)
bash only - no grep, sed, awk, whatever - zero overhead alternatively using ifconfig instead of "ip addr ..." A=$(ifconfig eth0); A=${A##*inet addr:}; echo ${A%% *} Show Sample Output
this command uses mysqldump to dump the production database and pipe it directly to the copy-database Show Sample Output
Dumps 20 bytes from /dev/urandom and converts them to hex. -c and -p are needed to prevent splitting over lines. Show Sample Output
For all users of https://addons.mozilla.org/de/firefox/addon/speed-dial/
disharmonics between 44100 and others cleaned
So simple
Might be more useful if you were able to print it in Days HH:MM:SS format as:
perl -e '@p=gmtime(234234);printf("%d Days %02d:%02d:%02ds\n",@p[7,2,1,0]);'
But I'm not exactly sure how to replace the 234234 with the output of the countdown time. (Having some problems with nested quoting/command substitution). Help would be appreciated :)
So you keep getting buzzes sounding from pidgin but you can't remember which buddy pounce is causing the beep. Well, cat/edit the ~/.purple/pounces and find out!
This is an updated version that some one provided me via another "find" command to find files over a certain size. Keep in mind you may have to mess around with the print values depending on your system to get the correct output you want. This was tested on FC and Cent based servers. (thanks to berta for the update) Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: