Skip to content

Instantly share code, notes, and snippets.

@pagarevijayy
Last active December 13, 2022 17:31
Show Gist options
  • Save pagarevijayy/443e11b1dfe3f708a76a492f3b7deaca to your computer and use it in GitHub Desktop.
Save pagarevijayy/443e11b1dfe3f708a76a492f3b7deaca to your computer and use it in GitHub Desktop.
Terminal commands you should know.

This is a good reference article. Also this.

Basics

Print stuff

echo "hello world!"

FS navigation

pwd
cd 
cd ..
ls
ls -a

FS manipulation

mkdir 
rmdir 

touch 
rm 
rm -rf 

cp source destination
mv source destination

chmod
chown

cmp
diff

Reading data from file

head hello.txt
tail hello.txt
cat hello.txt

grep

Open files in default editors

code file_name
edit file_name

OS and networking

ps 
kill -9 pid

uname
whoami

sudo

Helpers

clear
exit

man command_name
whereis
whatis
--help

ctrl+c
ctrl+shift+c
ctrl+shift+v
ctrl+alt+t
tab

alias

tar
zip
wget

Git commands

git init
git add .
git commit -m "commit msg"
git status

git clone
git remote add origin origin_url
git remote -v
git log

git pull
git push
git branch
git checkout
git merge

git diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment