Linux && Docker Cheatsheet

CommandDescription
ssh (username@ipadres)Connect to server
ip aGet the current IP address
sudo apt upgradeGet the latest upgrades
sudo apt updateUpdate the upgrades
sudo apt install (name)Installs software
sudo apt-get update && apt-get upgrade -y && apt autoremove -yGets updates, installs updates and auto removes old stuff
apt-get install curlInstalls curl
curl -sSL https://get.docker.com | shGets docker installed through curl
apt install docker-compose -yInstalls docker compose
clearClears the screen/ history
whatis (app)Explains what the program does
man (app)Detailed explanation of the program
ls See the files/ directories
ls -lSee the files/ directories (in a list)
ls -alSee the files/ directories (incl. Hiding items)
pwd Print Working Directory (current location)
cd Change directory
cd..One directory back
mkdir  (name)Make a directory
Rmdir (directory)Removes a directory
Touch (filename)Creates a file
nano File editor
cat (filename)Shows you what is in a file
cp (filename) (directory)Copies a file to a directory
mv (filename) (directory)Moves a file to a directory
rm (filename)Removes a file
curl (locatoin > file/directoryDownloads from the internet
sudo find / -name “file”Searches for a file
chmod +x (file)Makes the files executable
ip addressProvides details of your network
resolvectl statusProvides you the DNS server
ping (website)Is your website running
traceroute (website)Provides trace to the destination
netstatProvides the open poorts
sudo ufw allow (poort)Opens a poort for usage
sudo ufw statusProvides the status
sudo ufw enableEnables the service
uname -aProvides details of your OS
sudo apt install neofetchInstalls a “nicer” tool to view OS info
neofetch Provides “nicer” details of your OS
free Shows details of the memory
df -HDetails of file system
ps -auxDetails on processes running
htop Provides details of current processes (nicer)
kill -9 (process id)Kills a process
pkill -f (process name)Kills the process by named
sudo systemctl stop (service)Stops a service
sudo systemctl start (service)Starts a service
sudo systemctl restart (service)Restarts a service
sudo systemctl status (service)Provides status of the service
sudo rebootReboots the system
sudo shutdownShutdown the system