macOS cheat sheet
terminal
je t'aime
~/
$ every command you actually need
0
commands
/
press /
×
no results for "
"
📁
Navigation
7
pwd
Print working directory
copy
ls
List files & folders
copy
ls
-la
List all with details
copy
cd
[dir]
Change directory
copy
cd ..
Go up one level
copy
cd ~
Go to home directory
copy
cd -
Go to previous directory
copy
🗂
Files & Folders
8
touch
[file]
Create empty file
copy
mkdir
[dir]
Create directory
copy
mkdir
-p
Create nested dirs
copy
cp
a b
Copy file a to b
copy
cp
-r
Copy directory recursively
copy
mv
a b
Move or rename
copy
rm
[file]
Delete file
copy
rm
-rf
Delete folder — careful!
copy
👁
View Content
7
cat
[file]
Print file contents
copy
less
[file]
Scroll through file
copy
head
[file]
First 10 lines
copy
tail
[file]
Last 10 lines
copy
tail
-f
Follow live output
copy
open
.
Open folder in Finder
copy
open
[file]
Open with default app
copy
🔍
Search
6
grep
"x" file
Search text in file
copy
grep
-r
Search recursively
copy
grep
-i
Case-insensitive search
copy
find
. -name
Find files by name
copy
find
. -type f
Find only files
copy
which
[cmd]
Find command location
copy
🔐
Permissions
5
chmod
755 [file]
Set permissions
copy
chmod
+x [file]
Make executable
copy
chown
user [file]
Change owner
copy
sudo
[cmd]
Run as superuser
copy
sudo
!!
Re-run last cmd as sudo
copy
⚙️
Processes
7
ps aux
List all processes
copy
top
Live process viewer
copy
kill
[pid]
Kill by process ID
copy
kill
-9 [pid]
Force kill
copy
killall
[app]
Kill by name
copy
ctrl
+ C
Stop running process
—
ctrl
+ Z
Suspend process
—
🌐
Network
7
ping
[host]
Ping a host
copy
curl
[url]
Fetch URL content
copy
curl
-O [url]
Download file
copy
wget
[url]
Download file
copy
ifconfig
Network interfaces
copy
netstat
-an
Active connections
copy
ssh
user@host
Connect via SSH
copy
📦
Archives
4
tar
-czf
Create .tar.gz
copy
tar
-xzf
Extract .tar.gz
copy
zip
-r archive folder
Zip folder
copy
unzip
[file]
Extract zip
copy
💻
System
8
uname
-a
System info
copy
df
-h
Disk usage
copy
du
-sh *
Folder sizes
copy
free
-h
Memory usage
copy
history
Command history
copy
clear
Clear terminal
copy
echo
[text]
Print text
copy
date
Current date & time
copy
🌿
Git Essentials
8
git init
Init new repo
copy
git clone
[url]
Clone repository
copy
git status
Working tree status
copy
git add
.
Stage all changes
copy
git commit
-m ""
Commit with message
copy
git push
Push to remote
copy
git pull
Pull from remote
copy
git log
--oneline
Compact history
copy
📱
Expo / React Native
1
npx expo
start --clear
Start dev server & clear cache
copy