Whether you're deploying code, debugging tricky issues, or managing your project files, mastering these terminal commands will boost your speed and efficiency.
1. scp
— Secure Copy
Copy files and folders between your local machine and a remote server over SSH.
# Copy a file to remote
scp ./app.tar.gz user@remote:/var/www/
# Copy a directory recursively
scp -r ./project user@remote:/home/user/
2. tar
— Archive and Extract
Create or extract .tar.gz
compressed archives.
# Create an archive
tar -czvf archive.tar.gz ./folder
# Extract an archive
tar -xzvf archive.tar.gz
3. rm
— Remove Files or Directories
Use carefully, especially with -rf
.
# Remove a file
rm file.txt
# Remove a directory recursively
rm -rf ./build
4. cp
, mv
— Copy and Move
Move or duplicate files and folders.
cp file.js ./backup/
mv draft.md ./articles/
5. grep
— Search Within Files
Search through text using patterns.
# Find TODOs in the codebase
grep -r "TODO" ./src
6. chmod
, chown
— Permissions and Ownership
Control access and file ownership.
chmod +x script.sh # Make a script executable
chown user:group file.txt # Change file owner and group
7. curl
— API and Web Requests
Interact with web services from the terminal.
curl https://api.github.com/users/yourusername
curl -X POST -d '{"name":"dev"}' https://example.com/api
8. ping
, traceroute
— Network Troubleshooting
Diagnose network issues.
ping google.com
traceroute github.com
9. ssh
— Remote Server Access
Login and work on remote machines securely.
10. top
, htop
— Monitor System Resources
Check running processes and memory usage.
top # Built-in system monitor
htop # Enhanced version (requires install)
11. apt
, brew
— Install Packages
Install development tools or libraries.
# Debian, Ubuntu
sudo apt install git
# macOS with Homebrew
brew install node
12. make
— Run Defined Tasks (When Available)
Automate build, test, or install processes.
make test
make build
⚠️
make
only works if aMakefile
exists in the project. Common in C/C++, DevOps, and some Python or JS tools.
13. gpg
— Encrypt and Decrypt Files
Keep sensitive data safe.
gpg -c secrets.txt # Encrypt
gpg secrets.txt.gpg # Decrypt
14. find
— Locate Files
Search files by name or type.
find . -name "*.log"
15. xargs
— Run Commands on Input Lists
Useful for batch processing from files or piped input.
cat files.txt | xargs rm # Delete all files listed in files.txt
Final Tip
Mastering these commands won't just save you time, they'll also make you feel more at home in your terminal—whether you're shipping code to production or just exploring a new repo.
Feel free to bookmark this list or share it with a teammate who's still googling how to scp
every time 😄
ps. I use Ghostty after many years of iterm2.
Learn More
Want to level up even further? Check out explainshell.com, it breaks down shell commands line-by-line so you can understand what each part does. I love IT!
Top comments (2)
Love seeing xargs and grep get their shoutout - couldn't live without them. Is there one command you reach for daily that didn't make your list?
Oh, that's a tough one, 'cause there are so many commands you just can't live without! But if I had to pick just one I use constantly and that often gets overlooked 'cause it's so simple, I'd have to say cd. I mean, you literally can't do anything in the terminal without changing directories😅