0% found this document useful (0 votes)
55 views4 pages

Important Linux Command List

This document provides a comprehensive list of important Linux commands across various categories including basic commands, file permissions, process management, and networking. Each command is accompanied by a description, important parameters, and examples for clarity. The document serves as a quick reference guide for users to efficiently navigate and utilize Linux commands.

Uploaded by

tanvirahamed0403
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views4 pages

Important Linux Command List

This document provides a comprehensive list of important Linux commands across various categories including basic commands, file permissions, process management, and networking. Each command is accompanied by a description, important parameters, and examples for clarity. The document serves as a quick reference guide for users to efficiently navigate and utilize Linux commands.

Uploaded by

tanvirahamed0403
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IMPORTANT LINUX COMMAND LIST

1. Basic Commands

Command Description Important Parameters Example


Prints current →
pwd No parameters. $ pwd /home/user
working directory.
-l: Long format. -a: Show hidden → Detailed list of all
Lists files and $ ls -lah
ls files. -h: Human-readable sizes. - files with sizes.
directories.
R: Recursive.

..: Parent directory. ~: Home $ cd ~/Documents → Navigate


cd Changes directory.
directory. to Documents.
Creates a new -p: Creates parent directories as $ mkdir -p /tmp/new/folder
mkdir → Creates nested directories.
directory. needed.
Deletes files or $ rm -rf folder → Deletes
rm -r: Recursive. -f: Force deletion.
directories. folder and contents.
Copies files or $ cp -r src dest → Copies
cp -r: Recursive. -i: Interactive.
directories. source directory to destination.
Moves or renames $ mv file1 file2 → Renames
mv -i: Interactive. -v: Verbose.
files. file1 to file2.

Creates an empty $ touch [Link] →


touch No parameters.
file. Creates a file.

2. File Permissions and Ownership

Command Description Important Parameters Example


Changes file u: User. g: Group. o: Others. $ chmod u+x [Link] → Adds
chmod
permissions. a: All. +/-: Add/remove. execute permission for user.

Changes file user:group: Set user and group $ chown -R user:group folder
chown → Changes ownership of folder
ownership. ownership. -R: Recursive. .

Lists files with $ ls -l → Shows permissions,


ls -l -l: Long format.
permissions. ownership, and file sizes.

File Permissions Breakdown:


● -rw-r--r--: First character is - (file) or d (directory).
● First group (rw-): Owner permissions (read/write).
● Second group (r--): Group permissions (read only).
● Third group (r--): Others' permissions (read only).
3. File Searching and Viewing

Command Description Important Parameters Example


-name: By name. -type: File (f) →
Searches for files $ find / -name "*.txt"
find or directory (d). -size: Size-based Find all
and directories. .txt files.
search.
$ grep -ri "error"
grep
Searches for -i: Case-insensitive. -v: Exclude
/var/log → Search for "error"
patterns in files. matching lines. -r: Recursive. recursively.

Displays first lines $ head -n 10 [Link] →


head -n: Number of lines to show.
of a file. Shows first 10 lines.
$ tail -f logfile →
tail
Displays last lines -n: Number of lines. -f: Follows Continuously displays new log
of a file. file updates.
entries.
Interactive file $ less [Link] → Scrollable
less -N: Show line numbers.
viewing. view of file content.

4. Process Management

Command Description Important Parameters Example


Lists running -e: All processes. -f: Full- $ ps -ef → Detailed list of
ps
processes. format listing. processes.
Dynamic process $ top → Displays running processes
top -p: Specify a process.
monitoring. interactively.
Terminates a process $ kill 1234 → Kills process with
kill No parameters.
by PID. PID 1234.
Kills processes by -u: User-specific $ pkill -u user bash → Stops all
pkill
name. processes. Bash processes for user.

5. Disk Usage and System Information

Command Description Important Parameters Example


df
Shows disk space -h: Human-readable. -T: → Disk usage in GB/MB.
$ df -h
usage. Filesystem type.
Shows directory -h: Human-readable. -s: $ du -sh folder → Shows total size
du
size. Summary. of folder.
Shows memory -h: Human-readable. -t: $ free -h → Displays memory usage
free
usage. Total. in human-readable format.
uname
Displays system -a: All system info. -r: → Full system details.
$ uname -a
info. Kernel version.
6. Networking

Command Description Important Parameters Example


Tests network $ ping -c 4 [Link] → Sends 4
ping -c: Number of packets.
connectivity. packets to Google.
$ curl -o [Link]
curl
Transfers data -o: Output to file. -L:
[Link] → Save
to/from a server. Follow redirects. webpage.
Downloads files -c: Resume download. - $ wget -c [Link] → Resumes
wget
from the web. P: Save to directory. download of [Link].
Configures network addr: Show IP. link: $ ip addr show → Displays network
ip
interfaces. Show link status. interfaces.

7. Archiving and Compression

Command Description Important Parameters Example


-c: Create. -x: Extract. -z: Gzip $ tar -czvf [Link]
→ Compresses folder.
tar Archives files. compression. -v: Verbose. -f:
folder/
Filename.

$ gzip file → Creates


gzip Compresses files. No additional parameters.
[Link].

Decompresses $ gunzip [Link] →


gunzip No additional parameters.
Gzip files. Decompresses [Link].
Compresses files $ zip [Link] file1
zip -r: Recursive.
into .zip. file2 → Compresses files.

Extracts .zip $ unzip [Link] →


unzip No additional parameters.
archives. Extracts the contents.

8. User Management

Important
Command Description Example
Parameters
Shows current logged-in $ whoami → Displays current
whoami No parameters.
user. username.
who Shows logged-in users. No parameters. $ who → Shows user session details.
No additional $ sudo adduser newuser → Adds
adduser Adds a new user.
parameters. newuser.

$ passwd username → Changes


passwd Changes user password. No parameters.
username password.
9. Package Management (Debian/Ubuntu)

Important
Command Description Example
Parameters

No additional $ sudo apt update → Updates


apt update Updates package lists.
parameters. package list.

apt Installs available


upgrade -y: Auto-confirm. `$ sudo apt upgrade -
updates.

You might also like