Operations 10 min read

Commonly Used Linux Commands: A Quick Reference Guide

This article provides a comprehensive cheat‑sheet of the 21 most frequently asked Linux commands, covering file navigation, content viewing, searching, permissions, text processing, archiving, system control, and process management for interview preparation and daily use.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
Commonly Used Linux Commands: A Quick Reference Guide

This article compiles the 21 most frequently used Linux commands, often asked in interviews, serving as a quick‑reference manual.

1. File and Directory

cd : change directory (e.g., cd /home, cd .., cd -).

pwd : display current working directory.

ls : list files ( ls -l, ls -a, ls -R, etc.).

2. Viewing File Content

cat : display file, with options like cat -n file.

more , head , tail : paginate or show specific lines (e.g., head -n 2 file, tail -n +1000 file).

Combination example: cat filename | head -n 3000 | tail -n +1000 shows lines 1000‑3000.

3. File Search

find : locate files (e.g., find / -name file1, find /usr/bin -type f -atime +100).

whereis and which : locate binaries or source files.

Delete files larger than 50 M:

find /var/mail/ -size +50M -exec rm {} \;

4. Permissions

chmod : modify mode (e.g., chmod ugo+rwx dir, chmod go-rwx dir).

chown : change owner (e.g., chown user1 file, chown -R user1 dir).

chgrp : change group (e.g., chgrp group1 file).

5. Text Processing

grep : filter lines (e.g., grep Aug /var/log/messages).

sed : stream editor for substitution and deletion.

paste : merge files (e.g., paste file1 file2).

sort and uniq : sort and deduplicate.

comm : compare two sorted files.

6. Archiving and Compression

tar : create, list, extract archives with options -c, -t, -x, -z, -j, -v, -f, -C.

Examples: tar -jcv -f archive.tar.bz2 dir, tar -jxv -f archive.tar.bz2 -C /dest.

Other tools: gzip, bzip2, gunzip, rar, zip, unzip.

7. System Shutdown and Reboot

shutdown -h now

, init 0, telinit 0 – power off. shutdown -r now, reboot – restart. logout – log out. time command – measure execution time.

8. Process Management

jps : list Java processes.

ps : display processes (e.g., ps aux, ps -lA).

kill , killall , pkill : send signals to terminate processes (e.g., kill -9 pid).

top : interactive performance monitor.

Check listening ports: netstat -tunlp | grep PORT.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

process managementShellcommand-lineSystem Administrationfile management
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.