# http://www.commandlinefu.com/commands/favourites/plaintext # commandlinefu.com by David Winterbottom # Repoint an existing symlink to a new location ln -nsf # RDP through SSH tunnel ssh -f -L3389::3389 "sleep 10" && rdesktop -T'' -uAdministrator -g800x600 -a8 -rsound:off -rclipboard:PRIMARYCLIPBOARD -5 localhost # Control ssh connection [enter]~? # simple port check command parallel 'nc -z -v {1} {2}' ::: 192.168.1.10 192.168.1.11 ::: 80 25 110 # List your MACs address sort -u < /sys/class/net/*/address # phpinfo from the command line php -i # bash alias for sdiff: differ alias differ='sdiff --suppress-common-lines $1 $2' # Get your commandlinefu points (upvotes - downvotes) username=matthewbauer; curl -s http://www.commandlinefu.com/commands/by/$username/json | tr '{' '\n' | grep -Eo ',"votes":"[0-9\-]+","' | grep -Eo '[0-9\-]+' | tr '\n' '+' | sed 's/+$/\n/' | bc # print all except first collumn cut -f 2- -d " " # Make a statistic about the lines of code find . -type f -name "*.c" -exec cat {} \; | wc -l # Throttling Bandwidth On A Mac sudo ipfw pipe 1 config bw 50KByte/s;sudo ipfw add 1 pipe 1 src-port 80 # Get lines count of a list of files find . -name "*.sql" -print0 | wc -l --files0-from=- # Save an HTML page, and covert it to a .pdf file wget $URL | htmldoc --webpage -f "$URL".pdf - ; xpdf "$URL".pdf & # find files containing text grep -lir "some text" * # Validate and pretty-print JSON expressions. echo '{"json":"obj"}' | python -m simplejson.tool # Move all files with common extension to current directory mv `find .zip ./` . # Download an entire website wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com # Extract tarball from internet without local saving wget -qO - "http://www.tarball.com/tarball.gz" | tar zxvf - # Update twitter via curl curl -u user:pass -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml