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)