Operations 9 min read

Master Essential Linux Commands for Efficient System Management

This guide introduces the most commonly used Linux command‑line tools for file handling, content viewing, system monitoring, networking, and permission management, providing clear examples and options to help users quickly become proficient in everyday Linux administration tasks.

Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Master Essential Linux Commands for Efficient System Management

File and Directory Management

1. ls – List directory contents

The ls command displays files and directories. Common options include -l for detailed listings and -a to show hidden entries.

ls</code>
<code>ls -l</code>
<code>ls -a

2. cd – Change directory

Use cd to move between directories. .. refers to the parent directory and ~ to the user's home.

cd /path/to/directory</code>
<code>cd ..</code>
<code>cd ~

3. pwd – Print working directory

Shows the absolute path of the current directory.

pwd

4. mkdir – Create directories

mkdir new_directory

creates a single folder; -p creates nested directories as needed.

mkdir new_directory</code>
<code>mkdir -p /path/to/new_directory

5. rm – Remove files or directories

Delete a file with rm file. Use -r for recursive removal of directories.

rm file</code>
<code>rm -r directory

6. cp – Copy files or directories

Copy a file with cp source_file destination_file. Use -r to copy directories recursively.

cp source_file destination_file</code>
<code>cp -r source_directory destination_directory

7. mv – Move or rename files/directories

Move or rename items using mv old_name new_name or mv file /path/to/destination.

mv old_name new_name</code>
<code>mv file /path/to/destination

8. touch – Create empty file or update timestamps

Creates a new empty file or updates the access/modification time of an existing file.

touch new_file

File Content Viewing and Editing

1. cat – Concatenate and display file content

Shows the entire content of a file, suitable for small files.

cat file

2. less – Page through file content

Provides interactive paging for large files.

less file

3. head – Display the first lines

Shows the first 10 lines by default; use -n to specify a different count.

head -n 10 file

4. tail – Display the last lines

Shows the last 10 lines by default; -n changes the number of lines.

tail -n 10 file

5. nano and vim – Text editors

nano file

offers a simple, user‑friendly interface, while vim file provides powerful editing capabilities for experienced users.

nano file</code>
<code>vim file

System Management

1. ps – View running processes

ps aux

lists all processes for all users with detailed information.

ps aux

2. top – Real‑time system resource monitor

Displays CPU, memory, and other resource usage live.

top

3. kill – Terminate a process

Terminate a process by PID; -9 forces termination.

kill PID</code>
<code>kill -9 PID

4. df – Disk space usage

Shows filesystem disk usage; -h formats sizes in a human‑readable way.

df -h

5. du – Directory size

Displays the size of a directory; -sh provides a summarized, human‑readable total.

du -sh directory

6. free – Memory usage

Shows memory statistics; -h makes the output human‑readable.

free -h

7. uname – System information

Provides kernel and system details; -a prints all available information.

uname -a

Network Management

1. ifconfig – Configure network interfaces

Displays and configures network interface parameters.

ifconfig

2. ping – Test network connectivity

Sends ICMP echo requests to verify reachability of a host.

ping www.example.com

3. netstat – Network connections and routing

Shows active connections, routing tables, and interface stats; -an lists all connections.

netstat -an

4. ssh – Secure remote login

Connects to a remote host over the SSH protocol.

ssh user@host

5. scp – Secure copy files

Copies files between local and remote machines securely.

scp file user@host:/path/to/destination</code>
<code>scp user@host:/path/to/source file

Permission Management

1. chmod – Change file permissions

Adjusts access rights using numeric (e.g., 755) or symbolic modes (e.g., u+x).

chmod 755 file</code>
<code>chmod u+x file

2. chown – Change file ownership

Sets the owning user and group of a file or directory.

chown user:group file

3. sudo – Execute commands as superuser

Runs a command with elevated privileges. sudo command Mastering these commands greatly improves productivity when working in Linux environments.

LinuxshellCommand LineUnixSystem Administration
Full-Stack DevOps & Kubernetes
Written by

Full-Stack DevOps & Kubernetes

Focused on sharing DevOps, Kubernetes, Linux, Docker, Istio, microservices, Spring Cloud, Python, Go, databases, Nginx, Tomcat, cloud computing, and related technologies.

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.