25/04/2026 02:48am

Terminal/Command Line Pro Edition: Essential Commands You Must Know
#Developer Terminal
#Shell Scripting
#Command Line Interface
#Terminal Commands
Using Terminal or Command Line is one of the skills that clearly distinguishes novice programmers from professionals. Many people still think Terminal is complex and intimidating, but the truth is that when you learn to use it properly, it becomes a tool that makes you work faster and more efficiently than traditional GUI methods. This article will compile essential commands, advanced techniques, and professional usage methods that will change your way of working forever.
Why Must Programmers Master Terminal?
Superior Efficiency and Speed
Using Terminal allows you to do multiple tasks simultaneously at lightning speed. Performing batch operations, managing large numbers of files, or automating various tasks can be done in seconds, while using GUI might take several minutes.
Navigating between folders, searching for files, and managing version control through Terminal is several times faster than clicking around with a mouse.
Detailed and Precise Control
Terminal provides more detailed control than GUI, especially in managing permissions, working with system processes, and configuring various systems.
Necessity in Real Work
In DevOps, Backend Development, and Server management careers, using Terminal is unavoidable. Knowing how to use Terminal is therefore an essential basic skill.
Essential Basic Commands
Navigation and File Management
The cd (change directory) command is the first command everyone must learn. cd /path/to/directory changes to the specified folder, cd .. goes back to the parent folder, and cd ~ returns to the home directory.
The ls command is used to view file and folder lists. ls -la shows all details including hidden files and permissions for each file.
The pwd (print working directory) command tells you which folder you're currently in, which is very useful when working with projects that have complex structures.
Creating and Deleting Files/Folders
mkdir directory_name creates a new folder. mkdir -p path/to/nested/directory creates multiple nested folders at once.
touch filename.txt creates a new empty file or modifies the timestamp of an existing file.
rm filename deletes a file. rm -rf directory_name deletes a folder and everything inside (use carefully as it's irreversible).
Copying and Moving Files
cp source_file destination copies a file. cp -r source_directory destination copies an entire folder.
mv old_name new_name renames a file or folder, or mv file_name /path/to/destination moves a file to a new location.
Search and Data Filtering Commands
Finding Files with find
The find command is a powerful tool for searching files. find /path -name "*.js" searches for all JavaScript files in the specified folder.
find . -type f -mtime -7 finds files modified in the past 7 days.
find . -name "*.log" -size +10M finds log files larger than 10MB.
Searching Text with grep
grep "search_term" filename searches for text in a file. grep -r "search_term" directory searches in all files in a folder.
grep -n "error" log_file.txt shows lines containing "error" with line numbers.
ps aux | grep "process_name" searches for running processes.
Process and System Management Commands
Viewing Running Processes
ps aux shows all running processes. top or htop shows processes in real-time with CPU and RAM usage.
jobs shows background jobs. fg %1 brings job 1 back to foreground.
Process Control
command & runs a command in background. Ctrl+C stops program execution. Ctrl+Z temporarily suspends execution.
kill PID stops a process. kill -9 PID forces process termination.
nohup command & runs a command that doesn't stop when Terminal is closed.
File and Text Management
Viewing File Contents
cat filename shows entire file contents. less filename or more filename shows content page by page.
head filename shows first 10 lines. tail filename shows last 10 lines. tail -f logfile tracks file changes in real-time.
Editing Files
nano filename edits files with an easy-to-use text editor. vim filename or vi filename edits with the powerful vim editor.
Basic vim usage: press i to enter edit mode, press Esc to exit edit mode, type :wq to save and exit.
Text Processing
sort filename sorts lines in a file. uniq filename removes duplicate lines. wc filename counts lines, words, and characters.
cut -d',' -f1 filename.csv cuts the first column from a CSV file. awk '{print $1}' filename prints the first column of each line.
Using Pipes and Redirection
Pipes (|) for Connecting Commands
Pipe is one of Terminal's most powerful features. command1 | command2 sends output from command1 as input to command2.
ls -la | grep "pdf" shows only PDF files. cat logfile.txt | grep "error" | wc -l counts lines containing "error".
history | grep "git" searches for previously used git commands. ps aux | grep "node" | awk '{print $2}' finds PID of node processes.
Redirection for Output Management
command > filename saves output to file (overwrites). command >> filename appends output to file.
command 2> error.log saves errors to file. command > output.txt 2>&1 saves both output and errors.
Network and Connectivity
Checking Connections
ping google.com tests internet connection. curl https://api.example.com tests API endpoints.
wget https://example.com/file.zip downloads files. scp file.txt user@server:/path copies files via SSH.
SSH Management
ssh user@hostname connects to remote servers. ssh-keygen creates SSH key pairs.
rsync -av local_folder/ user@server:/remote_folder/ syncs files between machines.
Git and Version Control
Basic Git Commands
git status views repository status. git add . adds all files to staging area.
git commit -m "commit message" records changes. git push origin main sends changes to remote repository.
git pull pulls latest changes from remote. git log --oneline views commit history in short format.
Branch Management
git branch views all branches. git checkout -b new_branch creates and switches to new branch.
git merge branch_name merges branches. git branch -d branch_name deletes branch.
Advanced Techniques and Customization
Aliases and Shortcuts
Create aliases to shorten frequently used commands. Add to .bashrc or .zshrc:
alias ll='ls -la'
alias gs='git status'
alias gp='git push'
alias gpl='git pull'
alias ..='cd ..'
alias ...='cd ../..'
Using History and Tab Completion
!! repeats last command. !n repeats command number n from history. !string repeats last command starting with string.
Press Tab for autocomplete filenames and commands. Press Tab twice to see all options.
Environment Variables
export VAR_NAME=value sets environment variables. echo $VAR_NAME shows variable value.
export PATH=$PATH:/new/path adds new path to PATH.
Using Terminal in Development
Running Development Servers
npm start runs Node.js applications. python manage.py runserver runs Django servers.
docker-compose up runs Docker containers. make build runs build according to Makefile.
Dependency Management
npm install package_name installs npm packages. pip install package_name installs Python packages.
composer install installs PHP dependencies. bundle install installs Ruby gems.
Debugging and Monitoring
tail -f application.log tracks log files in real-time. lsof -i :3000 sees who's using port 3000.
netstat -tuln views open ports. df -h views disk space usage.
Advanced Tools Worth Knowing
tmux for Session Management
tmux helps manage multiple terminal sessions simultaneously. tmux new -s session_name creates new sessions.
Ctrl+b d exits session while keeping it running. tmux attach -t session_name returns to session.
awk for Text Processing
awk '{print $1, $3}' filename prints columns 1 and 3. awk '/pattern/ {print $0}' filename prints lines matching pattern.
sed for Text Substitution
sed 's/old/new/g' filename replaces text. sed -i 's/old/new/g' filename edits file directly.
Automating Work with Scripts
Basic Bash Scripts
Create script files starting with #!/bin/bash and make them executable with chmod +x script.sh.
#!/bin/bash
echo "Starting deployment..."
git pull origin main
npm install
npm run build
echo "Deployment completed!"
Using Cron Jobs
crontab -e edits cron jobs. 0 2 * * * /path/to/script.sh runs script daily at 2:00 AM.
Efficiency Tips
Essential Keyboard Shortcuts
Ctrl+A goes to beginning of line. Ctrl+E goes to end of line. Ctrl+U deletes entire line.
Ctrl+R searches commands from history. Ctrl+L clears screen.
Using Wildcards
* represents any characters of any length. ? represents single character. [abc] represents characters a, b, or c.
rm *.tmp deletes all .tmp files. ls file?.txt shows files starting with "file" followed by single character.
Mistakes to Avoid
Careless Use of rm -rf
The rm -rf command can delete everything. Always verify path before running, or use rm -i to ask for confirmation before deletion.
Not Using Version Control
Should use git regularly, commit frequently, and always have backups. Using Terminal without version control is high risk.
Not Understanding Permissions
Using sudo unnecessarily or changing permissions incorrectly can damage systems. Should learn file permissions well.
Future Learning Paths
Advanced Topics to Study
Advanced shell scripting, using regular expressions, managing system services with systemctl, and using Docker efficiently.
Practice and Improvement
Try using Terminal for daily work instead of GUI, learn new commands regularly, and write scripts to automate repetitive tasks.
Join communities and read Terminal articles to learn new techniques from experts.
Summary: Terminal is the Key to Becoming an Efficient Programmer
Seriously learning Terminal will change your way of working forever. From slow and complicated work with GUI to fast and efficient work with just a few command lines.
The important thing is to start using Terminal in daily work. Begin with basic commands, then gradually learn advanced commands when encountering real needs. Regular practice will make you a more efficient and reliable programmer.
Mastering Terminal isn't difficult, but requires time and patience. Start today, and you'll see clear differences in your own work.
Are you ready to become a programmer who uses Terminal professionally?
🔵 Facebook: Superdev School (Superdev)
📸 Instagram: superdevschool
🎬 TikTok: superdevschool
🌐 Website: www.superdev.school