Cheatography
https://cheatography.com
A personal list of common Linux terminal commands
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Files and Navigation
ls |
"list" files and directories in currect location |
cd 'location' |
"change directory" to specified location (no quotes). |
cd .. |
back out one directory level |
cp 'name' 'location' |
"copy" file or directory to location (no quotes) |
mv 'name' 'location' |
"move" file or directory to location (no quotes) |
mkdir 'name' |
"Make Directory" with specified name (no quotes) |
rm 'name' |
"remove" aka delete file (no quotes) |
rmdir 'name' |
"remove" aka delete empty directory |
rmdir 'name' -r |
deletes directory and its contents |
nano 'file' |
open file (no quotes) to edit. Ctrl+X to close |
touch 'name'.'type' |
creates file with (no quotes) Name and File Type (ex: .txt .yml) |
Login and Account
ssh 'username'@'IP address' |
log into machine with username (no quotes), will ask for password |
su 'username' |
"Switch User" to specified account (no quotes) |
sudo useradd 'username' |
creates a new user with specified name (no quotes) |
sudo adduser 'username' |
creates a new user with specified name (no quotes) with other parameters like passwords |
sudo passwd 'username' |
create new password for user (no quotes). Ignore username to change current user |
exit |
log out as current user |
|
|
Updates and Installation
sudo apt update |
download the lastest version of pkgs |
sudo apt upgrade |
install downloaded updates |
sudo apt install "pkg name" |
installs specific package (no quotes) |
sudo apt remove "pkg name" |
removes specified package (no quotes) |
sudo apt autoremove |
removes unused packages (usually dependencies no longer needed) |
|
|
Docker
docker-compose up -d |
runs docker-compose.yml file in folder without active terminal |
docker-compose down |
shuts down docker container |
docker ps -all |
lists running docker containers |
|