# commandlinefu.com - questions/comments: danstools00@gmail.com # Run the last command as root sudo !! # Serve current directory tree at http://$HOSTNAME:8000/ python -m SimpleHTTPServer # Runs previous command but replacing ^foo^bar # Rapidly invoke an editor to write a long, complex, or tricky command ctrl-x e # Place the argument of the most recent command on the shell 'ALT+.' or ' .' # currently mounted filesystems in nice layout mount | column -t # Get your external IP address curl ifconfig.me # Execute a command at a given time echo "ls -l" | at midnight # Quick access to the ascii table. man ascii # output your microphone to a remote computer's speaker dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp # type partial command, kill this command, check something you forgot, yank the command, resume typing. [...] # Query Wikipedia via console over DNS dig +short txt .wp.dg.cx # Mount folder/filesystem through SSH sshfs name@server:/path/to/folder /path/to/mount/point # Mount a temporary ram partition mount -t tmpfs tmpfs /mnt -o size=1024m # Download an entire website wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com # Clear the terminal screen ctrl-l # Compare a remote file with a local file ssh user@host cat /path/to/remotefile | diff /path/to/localfile - # A very simple and useful stopwatch time read (ctrl-d to stop) # SSH connection through host in the middle ssh -t reachable_host ssh unreachable_host # Update twitter via curl curl -u user:pass -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml # Make 'less' behave like 'tail -f'. less +F somelogfile # Put a console clock in top right corner while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done & # Close shell keeping all subprocess running disown -a && exit # Simulate typing echo "You can simulate on-screen typing just like in the movies" | pv -qL 10 # 32 bits or 64 bits? getconf LONG_BIT