Linux Commands
Linux offers a wide range of commands for managing files, directories, and processes.
Here’s a table of some essential commands:
| Command | Description | Example |
|---|---|---|
man | Provides access to the user manual. | man ls |
ls | Lists files and directories. | $ ls → Documents Downloads |
pwd | Prints the current working directory. | $ pwd → /home/user |
cd | Changes the current directory. | $ cd Documents → Navigate to Documents. |
mkdir | Creates a new directory. | $ mkdir new_folder |
rmdir | Removes an empty directory. | $ rmdir new_folder |
touch | Creates an empty file. | $ touch file.txt |
rm | Removes files or directories. | $ rm file.txt |
cp | Copies files or directories. | $ cp file.txt /path/to/destination |
mv | Moves or renames files. | $ mv old_name.txt new_name.txt |
cat | Displays file content. | $ cat file.txt → Hello, World! |
nano/vim | Edits files in terminal. | $ nano file.txt or $ vim file.txt |
chmod | Changes file permissions. | $ chmod 755 script.sh |
chown | Changes file ownership. | $ chown user:group file.txt |
ps | Displays running processes. | $ ps |
kill | Terminates a process using its PID. | $ kill 1234 |
df | Shows disk usage. | $ df -h |
top | Monitors system resources in real-time. | $ top |
wget | Downloads files from the internet. | $ wget http://example.com/file.zip |
tar | Compresses or extracts tar archives. | $ tar -cvf archive.tar folder_name |
sudo | Executes commands as a superuser. | $ sudo apt update |