A useful way to generate the MD5 hash for a string by command line Show Sample Output
This command creates tar zip of a directory and its sub-directories. Show Sample Output
This function is used to sort selected lines of a text file to the end of that file. Especially useful in cases where human intervention is necessary to sort out parts of a file. Let's say that you have a text file which contains the words rough slimy red fluff dough For whatever reason, you want to sort all words rhyming with 'tough' to the bottom of the file, and all words denoting colors to the top, while keeping the order of the rest of the file intact. '$EDITOR' will open, showing all of the lines in the given file, numbered with '0' padding. Adding a '~' to the beginning of the line will cause the line to sort to the end of the file, adding '!' will cause it to sort to the beginning. Show Sample Output
setting gdb with this option / breakpoint before running the process will cause it to break whenever an memory allocation operation is not kosher.
Computes total size of files in a directory. This value is different "du -b" because doesn't includes directory sizes. Show Sample Output
Use shopt -s cdspell to correct the typos in the cd command Show Sample Output
client:
nc localhost 9876
get subversion diff output without distracting whitespace changes. good for when you are cleaning up code to make sure you didn't change anything important. also useful when working with old code, or someone else's code.
Fixes the faulty files with perl, which may exist on more platforms
To show your current resolution on your desktop Show Sample Output
This command will place your card into monitor mode. Gets around the "ioctl(SIOCSIWMODE) failed: Device or resource busy" error encountered when running airodump-ng. Show Sample Output
If you have ever edited a locally checked out version of a file to tweak it for testing purposes, and came back to it over a weekend, you might have forgotten what you exactly changed. This command helps you see the differences between the the checked in SVN version, and the one you tweaked. Show Sample Output
This pattern matches empty lines in the file and -c gives the count
Actually this is a shorter version that fits the 255 chars limit of this resource. The full version shows status in the right top corner:
alias mpdd='while sleep 1; do _r=$(awk '\''BEGIN{FS=": "}/^Artist:/{r=r""$2};/^Title:/{r=r" - "$2};/^time:/{r=$2" "r};/^state: play/{f=1}END{if(f==1){print r}}'\'' <(mpc status;mpc currentsong));_l=${#_r};[ $_l -eq 0 ] && continue;[ -z "$_p" ] && _p=$_l;echo -ne "\e[s\e[0;${_p}H\e[K\e[u";_p=$((COLUMNS - _l));echo -ne "\e[s\e[0;${_p}H\e[K\e[0;44m\e[1;33m${_r}\e[0m\e[u";done &'
mpc is defined like this:
function mpc() {
echo "$*" | nc 192.168.1.1 6600
}
Show Sample Output
the advantage to doing it this way is that you can adjust the max depth to get more recursive results and run it on non GNU systems. It also won't print trailing slashes, which can easily be removed, but can be slightly annoying.. You could run: # for file in `find * -maxdepth 0 -type d`;do ls -d $file;done and in the ls -d part of the command you can put in whatever parameters you want to get things like permissions, time stamps, and ownership. 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: