Skip to content

Instantly share code, notes, and snippets.

@luisuribe
Created January 1, 2010 16:20
Show Gist options
  • Save luisuribe/267152 to your computer and use it in GitHub Desktop.
Save luisuribe/267152 to your computer and use it in GitHub Desktop.
shell shortcuts
// Empty a file from the command line
$ cat /dev/null > t
// Use last parameter
$ ls /home/acme/norad
$ rm !$
#Send a file as an attachment (ssmtp previously configured)
mpack -s "Un subject" un_fichero mailto:direccion@de.correo direccion@de.correo
# To extract a range of lines, say lines 2 to 4, you can execute either of the following (From http://linuxcommando.blogspot.com/2008/03/using-sed-to-extract-lines-in-text-file.html):
sed -n 2,4p somefile.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment