This is great when you need to reboot the system-server, or your own daemon that has gone crazy
EG: aspectRatio 1920 1200
For display a image in full screen it should be in any of the resolution obtained from the output. So resize an image to any of it and you can display it in full screen
For general aspect ratio :
aspectRatio () { for i in `seq 1 1000 `; do awk "BEGIN {print $1/$i, $2/$i}"; done |grep -v "\." |tail -1; }
Show Sample Output
curl is much faster then the GET, and has less dependencies.
Reciprocally, we could get the node name from a give Tor IP address => ip2node() { curl -s -d "QueryIP=$1" http://torstatus.blutmagie.de/tor_exit_query.php | grep -oP "Server name:.*'>\K\w+" ; } ip2node 204.8.156.142 BostonUCompSci Show Sample Output
Helps to fix permissions when a user clobbers them in their home directory or elsewhere. Does not rely on file extension, but uses the `file` command for context.
Emulate (more or less) Git equivalent of
git log --format='tformat:%h %an (%cr) %s'
Show Sample Output
proc lister usage: p proc killer usage: p patt [signal] uses only ps, grep, sed, printf and kill no need for pgrep/pkill (not part of early UNIX) _p(){ ps ax \ |grep $1 \ |sed ' /grep.'"$1"'/d' \ |while read a;do printf ${a%% *}' '; printf "${a#* }" >&2; printf '\n'; done; } p(){ case $# in 0) ps ax |grep .|less -iE; ;; 1) _p $1; ;; [23]) _p $1 2>/dev/null \ |sed '/'"$2"'/!d; s,.*,kill -'"${3-15}"' &,'|sh -v ;; esac; } alas, can't get this under 255 chars. flatcap? Show Sample Output
proc lister usage: p proc killer usage: p patt [signal] uses only ps, grep, sed, printf and kill no need for pgrep/pkill (not part of early UNIX) _p(){ ps ax \ |grep $1 \ |sed ' /grep.'"$1"'/d' \ |while read a;do printf ${a%% *}' '; printf "${a#* }" >&2; printf '\n'; done; } p(){ case $# in 0) ps ax |grep .|less -iE; ;; 1) _p $1; ;; [23]) _p $1 2>/dev/null \ |sed '/'"$2"'/!d; s,.*,kill -'"${3-15}"' &,'|sh -v ;; esac; } alas, can't get this under 255 chars. flatcap? Show Sample Output
List background jobs, grep their number - not process id - and then kill them Show Sample Output
Sometimes cache-files or garbage gets added to your SVN repository. This is the way I normally clean up those when the actual files are already gone.
Put this in your bash startup script so you can quickly remember the top rated commands on CommandLineFu's website. Put it in .bashrc on Linux, or .bash_profile on OSX. Show Sample Output
Doesn't depend on curl and doesn't use thumbnails as wallpaper (which has the unfortunate effect of only allowing imgur links)
you could redirect output to /dev/NULL
Cleaner than adding -p to ls ( eg ls -alp ), this will tell ls to only output directories in the file listing, whilst maintaining all the usual other column elements of the ls output.
This will check if there are any empty directories, or newly emptied directories, in a list of directories. It will then delete all of those directories. It works with gnu find and OSX/BSD find.
Shows sorted by query time, the headers of mysqlbinlog entries. Then is easy to locate the heavier events on the raw log dump 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: