macOS cheat sheet

terminalje t'aime

~/ $ every command you actually need
0
commands
no results for ""
🗂Files & Folders8
touch [file]Create empty file
mkdir [dir]Create directory
mkdir -pCreate nested dirs
cp a bCopy file a to b
cp -rCopy directory recursively
mv a bMove or rename
rm [file]Delete file
rm -rfDelete folder — careful!
👁View Content7
cat [file]Print file contents
less [file]Scroll through file
head [file]First 10 lines
tail [file]Last 10 lines
tail -fFollow live output
open .Open folder in Finder
open [file]Open with default app
🔍Search6
grep "x" fileSearch text in file
grep -rSearch recursively
grep -iCase-insensitive search
find . -nameFind files by name
find . -type fFind only files
which [cmd]Find command location
🔐Permissions5
chmod 755 [file]Set permissions
chmod +x [file]Make executable
chown user [file]Change owner
sudo [cmd]Run as superuser
sudo !!Re-run last cmd as sudo
⚙️Processes7
ps auxList all processes
topLive process viewer
kill [pid]Kill by process ID
kill -9 [pid]Force kill
killall [app]Kill by name
ctrl + CStop running process
ctrl + ZSuspend process
🌐Network7
ping [host]Ping a host
curl [url]Fetch URL content
curl -O [url]Download file
wget [url]Download file
ifconfigNetwork interfaces
netstat -anActive connections
ssh user@hostConnect via SSH
📦Archives4
tar -czfCreate .tar.gz
tar -xzfExtract .tar.gz
zip -r archive folderZip folder
unzip [file]Extract zip
💻System8
uname -aSystem info
df -hDisk usage
du -sh *Folder sizes
free -hMemory usage
historyCommand history
clearClear terminal
echo [text]Print text
dateCurrent date & time
🌿Git Essentials8
git initInit new repo
git clone [url]Clone repository
git statusWorking tree status
git add .Stage all changes
git commit -m ""Commit with message
git pushPush to remote
git pullPull from remote
git log --onelineCompact history
📱Expo / React Native1
npx expo start --clearStart dev server & clear cache