sshfs name@server:/path/to/folder /path/to/mount/point: install SSHFS from http://fuse.sourceforge.net/sshfs.html
!!:gs/foo/bar: run previous command replacing foo with bar
sudo !!: run the last command as root
mount | column -t: nice layout for mount
<space> command: execute a command without saving it in the history
dig +short txt <keyword>.wp.dg.cx: query Wikipedia via console over DNS (the keyword must be single word)
netstat -tlnp: lists all listening ports together with the PID of the associated process. The PID will only be printed if you’re holding a root equivalent ID.
echo “ls -l” | at midnight:
curl -u user:pass -d status=”Tweeting from the shell” http://twitter.com/statuses/update.xml:
ssh -N -L2001:localhost:80 somemachine: start a tunnel from some machine’s port 80 to your local post 2001. Now you can acces the website by going to http://localhost:2001/
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg: Capture video of a linux desktop
> file.txt: empty a file
$ssh-copy-id user@host: Copy ssh keys to user@host to enable password-less ssh logins. To generate the keys use the command ssh-keygen
ctrl-x e: Rapidly invoke an editor to write a long, complex, or tricky command. Next time you are using your shell, try typing ctrl-x e (that is holding control key press x and then e). The shell will take what you’ve written on the command line thus far and paste it into the editor specified by $EDITOR.
mtr google.com: mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool
cp filename{,.bak}: quickly backup or copy a file with bash
cd -: change to the previous working directory
Advertisement