</>StackKit
</>StackKit

Developer tutorials & guides

Linux terminal with commands
Linux

25 Linux Commands Every Developer Needs to Know

From file navigation to process management to text processing, these are the Linux commands that show up constantly in a developer's daily workflow.

M
Marcus Lee
April 10, 20259 min read
#linux#command-line#bash#terminal#devops

The Terminal Is Your Superpower

Every developer eventually has to work in a Linux environment — whether it's SSH-ing into a production server, running CI/CD pipelines, or just using macOS's Terminal. Fluency with the command line multiplies your productivity. Here are the 25 commands that come up most.


Navigation

pwd          # print working directory
ls -lah      # list files (long format, all, human-readable sizes)
cd -         # go to previous directory
cd ~         # go to home directory

File Operations

cp -r src/ dest/          # copy directory recursively
mv file.txt ~/Documents/  # move or rename
rm -rf old-folder/        # delete directory (careful!)
mkdir -p a/b/c            # create nested directories
touch file.txt            # create empty file or update timestamp

Viewing Files

cat file.txt              # print entire file
less file.txt             # paginated view (q to quit)
head -n 20 file.txt       # first 20 lines
tail -n 50 file.txt       # last 50 lines
tail -f app.log           # follow log file in real time

Searching

# Find files
find . -name "*.ts" -type f
find . -newer package.json -type f

# Search inside files
grep -rn "TODO" src/
grep -rn "function auth" --include="*.ts"

# Powerful searching with ripgrep (faster than grep)
rg "TODO" src/

Text Processing

# Count lines, words, characters
wc -l file.txt

# Sort lines
sort names.txt
sort -rn scores.txt       # reverse numeric sort

# Remove duplicates
sort names.txt | uniq

# Cut columns from CSV
cut -d',' -f1,3 data.csv

# Stream editor — find/replace
sed 's/foo/bar/g' file.txt
sed -i 's/foo/bar/g' file.txt  # in-place edit

Piping & Redirection

# Pipe output into next command
cat access.log | grep "404" | wc -l

# Redirect output to file
ls -la > files.txt        # overwrite
ls -la >> files.txt       # append

# Redirect stderr
command 2> errors.log
command 2>&1 | tee all.log  # stdout + stderr to file and terminal

Process Management

ps aux                    # all running processes
ps aux | grep node        # find specific process
kill -9 <pid>             # force kill process
pkill -f "node server"    # kill by name pattern
top                       # live process monitor
htop                      # better live monitor (if installed)

# Background processes
command &                 # run in background
jobs                      # list background jobs
fg %1                     # bring job 1 to foreground
nohup command &           # run after terminal closes

Permissions

chmod +x script.sh        # make executable
chmod 755 script.sh       # rwxr-xr-x
chmod -R 644 public/      # recursive

chown user:group file.txt
sudo chown -R $USER /app

Networking

curl -I https://example.com          # HTTP headers only
curl -X POST https://api.example.com/users   -H "Content-Type: application/json"   -d '{"name":"Alex"}'

wget https://example.com/file.zip   # download file
ping google.com                     # check connectivity
netstat -tulnp                      # listening ports
ss -tulnp                           # modern netstat

Disk & System Info

df -h                     # disk space usage
du -sh folder/            # size of folder
free -h                   # memory usage
uname -a                  # system info
uptime                    # how long system has been running

Shortcuts That Save Time

!!          # repeat last command
!grep       # repeat last grep command
Ctrl+R      # reverse search command history
Ctrl+A      # jump to start of line
Ctrl+E      # jump to end of line
Ctrl+K      # delete from cursor to end
Ctrl+L      # clear screen

Conclusion

These 25 commands cover the vast majority of what you'll do in a Linux terminal day to day. Learn them by doing — next time you're tempted to reach for a GUI tool, see if you can do it from the command line instead. After a month of deliberate practice, the terminal will feel faster than any GUI.

#linux#command-line#bash#terminal#devops