Download the content of an URL to a file
curl http://example.com/text.txt -o filename.txt

Download the content of a URL and safe it by the given name
curl -O http://example.com/text.txt

Create a tar archive
tar -cf archive.tar file1 file2 ... fileN

Create tar archive from a directory
tar -cf archive.tar /path/to/directory/

Create a tar gzipp’d archive
tar -zcf archive.tar.gz file1 file2 ... fileN

Create a tar gzipp’d archive from a directory
tar -zcf archive.tar /path/to/directory/

Create multi-part tar archives from a directory
tar cf - /path/to/directory|split -b<max_size_of_part>M - archive.tar

Extract all files from a tar archive
tar -xf archive.tar

Extract all files from a tar gzipped archive
tar -zxf archive.tar.gz

Extract all files from a tar gzipped archive into a directory
tar -xzf archiv.tar.gz -C /path/to/directory/

Extract a single file from a tar archive
tar -xf archive.tar the_one_file

How much disk space takes a file or directory up?
du -s -h /your/file 
du -s -h /your/directory/

Get the 10 biggest files/folders for the current direcotry
du -sh * | sort -rh | head

Show free disk space
df -h

List only directories
ls -d */

currently mounted filesystems in nice layout
mount | column -t

Mount folder/filesystem through SSH
sshfs name@server:/path/to/folder /path/to/mount/point

Mount iso image
mount /path/to/file.iso /mnt/cdrom -o loop

Show a text file and replace text, here: replace foo with bar
sed s/foo/bar/g file.txt

Use ” if your search patterns contains spaces
sed 's/foo foo/bar bar/g' file.txt

Change a text file in place and replace text, here: replace foo with bar
sed s/foo/bar/g file.txt -i

Redirect output to Disk
sed s/foo/bar/g file.txt > newfile.txt

delete 5th line
sed 5d file.text

Delete lines matching ‘foo’
sed /foo/d file.txt

Print line 8
sed -n '8p' file.txt

Print lines 8-10
sed -n '8,10p' file.txt

Append new line containing ‘bar’, after lines containing ‘foo’
sed '/foo/a bar' file.txt

Insert “hello” to the end of line 9
sed 'i9 hello' file.txt

Examples:
sed 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config

http://sed.sourceforge.net/sed1line.txt