Skip to content

Instantly share code, notes, and snippets.

@mathieue
Created September 6, 2010 21:20
Show Gist options
  • Save mathieue/567527 to your computer and use it in GitHub Desktop.
Save mathieue/567527 to your computer and use it in GitHub Desktop.
# command line can be amazing and so simple ( just a terminal! ) at the same time
# rsyncing to current dir as dest? watch dir size grows in real time!
watch -n 1 'du -sh .'
# cut word left of cursor
<ctrl-w>
# yank (paste) last cut/kill (ex: see <ctrl-w> )
<ctrl-y>
# rotate kill ring!
<alt-y>
# scp or not scp?
cat localfile | ssh target_address cat - ">" remotefile
# run previous command substituing all instances
!!:gs/foo/bar
# compare local file with remote file
ssh user@host cat /path/to/remotefile | diff /path/to/localfile -
# quick backup a file
cp filename{,.bak}
# write file without initial privileges
:w !sudo tee %
# run the last command as sudo
sudo !!
# Show apps that use internet connection at the moment
lsof -P -i -n
# all parameters from latest command
!*
#edit current command line in your editor
<ctrl-x> <ctrl-e>
# Get all links of a website
lynx -dump http://www.domain.com | awk '/http/{print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment