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

Search your history
ctrl + r

Write something in a file
printf 'This is a test\n' > test.txt

Do this 10 times
printf 'This is a test\n' > test{1..10}.txt

quickly rename a file
mv filename.{old,new}

You can use loops in bash

for i in *.txt
do
  convert $i $i.jpg
done

But maybe you want to use braces {}

Create 10 text files
touch test_{1..10}.txt

Create 3 text files
touch test_{1,3,10}.txt

$( ) gives the output of a command to previous command
touch file-$(date -I).txt

Remove all .txt files in a directory
rm $(ls *.txt)

Delete all files in a folder that don’t match a certain file extension
rm !(.foo|.bar|*.baz)

$( ) can be nested very easily
program1 $(program2 $(program3))

Stop all Containers in Docker

this command lists all containers with it’s numeric IDs:
docker ps -a -q
We add some command line magic, to stop them all:
docker stop $(docker ps -a -q)

Delete all Containers in Docker

After we’ve stopped all the containers, we can delete them. Docker only deletes stopped containers:
docker rm $(docker ps -a -q)

Delete all Images in Docker

docker image rm $(docker images -a -q)