DEV Community

Cover image for UNDERSTANDING WHAT LINUX COMMAND IS ALL ABOUT.
ANDREW ARIGU AYUBA
ANDREW ARIGU AYUBA

Posted on

UNDERSTANDING WHAT LINUX COMMAND IS ALL ABOUT.

INTRODUCTION
A Linux command is a text-based instruction entered into a terminal or command-line interface to perform a specific task on a Linux operating system. These commands allow users to interact with the system, manage files, configure settings, run programs, and more. Linux commands are typically executed in a shell (like Bash), which interprets and processes the input.
Linux commands are the backbone of interacting with a Linux operating system through the terminal. They allow users to perform tasks ranging from file management to system administration, often with more precision and flexibility than graphical interfaces.

What Are Commands in Linux?

Commands in Linux are essentially programs or utilities that perform operations when invoked. They can be built into the shell (internal commands) or exist as separate executable files (external commands). Here’s a breakdown:
Internal Commands: These are part of the shell itself (e.g., Bash) and don’t require separate executable files. Examples include:
cd: (change directory)
echo: (display text)
pwd: (print working directory)

External Commands: These are standalone programs located in directories like /bin, /usr/bin, or /usr/local/bin. Examples include:
ls: (list directory contents, though often aliased to dir in some setups)
cat: (concatenate and display file content)
grep: (search text in files)

Common Linux Commands

Here are some widely used Linux commands, categorized by purpose:

File Management

ls: Not typically a native command, but often dir or aliases simulate it; use ls in many distributions with proper setup.
cp: Copy files or directories.
mv: Move or rename files or directories.
rm: Remove or delete files or directories.
touch: Create an empty file or update a file's timestamp.
ls: List directories or files.
clear: Clear the terminal display.

Directory Navigation

cd: Change the current directory or to navigate through directories.
mkdir: Create a new directory.
rmdir: Remove an empty directory.
pwd: Show the current directory path or print working directory.
cat: Display file content on the terminal.
cmp: allows to check if two files are identical.
diff: find the difference between two files.
sort: Rearrange a file’s content in a specific order.

File Viewing and Editing

cat: Display file contents.
less: View file contents page by page.
nano, vi, or vim: Edit text files.
tail: Return specified number of lines from the bottom.
head: Return specified number of lines from the top.

System Information

uname: Display system information (e.g., uname -a for all details).
top: Monitor running processes.
df: Show disk space usage or disk file system information.
free: Display memory usage.
pwd: Show name of current working directory

Permissions and Ownership

chmod: Change file permissions.
chown: Change file ownership.
passwd: Create password
useradd and usermod: Add a new user or change existing user data.

Process Management

ps: List running processes.
kill: Terminate a process by its ID.
bg/fg: Manage background or foreground jobs.
zip: To compress one or multiple files.
unzip: To extract a compressed file or files.

Networking

ping: Test network connectivity.
wget: Download files from the web.
curl: Transfer data to/from a server.

Linux commands are powerful and flexible, forming the backbone of system administration and user interaction in a Linux environment. Also, Linux commands are usually case sensitive.

Top comments (0)