If you’re new to Linux, mastering the command line might seem like a daunting task. But don’t worry—once you get familiar with a few basic commands, you’ll find that it’s a powerful way to interact with your system. Here’s a curated list of 50 basic Linux commands that every user should know to navigate and control the system like a pro.


1. pwdPrint Working Directory

Displays the current directory you are in. This is helpful when you get lost in the depths of your file system.
Example:

pwd

2. lsList Directory Contents

Shows the files and directories within your current location. Add options to customize the output (like ls -la to show hidden files).
Example:

ls -la

3. cdChange Directory

Allows you to move between directories. Use cd .. to move up one level or provide a full path to switch to a specific folder.
Example:

cd /var/www/html

4. touchCreate Empty Files

The easiest way to create a file without any content. Useful for placeholders or quick testing.
Example:

touch newfile.txt

5. catConcatenate and Display File Content

Combine files and show their contents. Perfect for reading smaller files right in the terminal.
Example:

cat file.txt

6. cpCopy Files or Directories

Copies files or directories from one location to another. Add -r for directories.
Example:

cp source.txt destination.txt

7. mvMove or Rename Files

Move files or directories to a new location, or rename them.
Example:

mv oldname.txt newname.txt

8. rmRemove Files or Directories

Deletes files or directories. Use with caution—once gone, it’s hard to recover files! Use -r for directories.
Example:

rm -r directory_name

9. mkdirMake a New Directory

Create new directories with this command. Add the -p option to make parent directories if they don’t exist.
Example:

mkdir -p /home/user/newdir

10. rmdirRemove Empty Directories

Deletes directories only if they are empty. If not, use rm -r.
Example:

rmdir emptydir

11. echoDisplay Text or Variables

Use echo to print a string of text or the value of a variable to the terminal.
Example:

echo "Hello World"

12. nanoSimple Text Editor

Nano is a beginner-friendly text editor. It runs in the terminal and is ideal for quick edits.
Example:

nano file.txt

13. viAdvanced Text Editor

Vi is a powerful, feature-rich text editor. It’s often a bit more complex, but ideal for seasoned users.
Example:

vi file.txt

14. chmodChange File Permissions

Modifies the read, write, and execute permissions for files and directories.
Example:

chmod 755 script.sh

15. chownChange File Owner

Change the ownership of files and directories. You can also assign groups.
Example:

chown user:group filename

16. findSearch for Files

Search for files within a directory structure. This command is highly customizable with parameters like -name or -type.
Example:

find /home -name "*.log"

17. grepSearch Text Patterns

Extract specific lines from files based on patterns. Perfect for filtering log files.
Example:

grep "error" logfile.txt

18. manManual Pages

Shows the manual for a command, offering in-depth explanations of usage and options.
Example:

man ls

19. psProcess Status

Displays information about active processes.
Example:

ps aux

20. killTerminate a Process

Kill a process by specifying its PID (Process ID).
Example:

kill 1234

21. topSystem Monitor

A real-time process viewer that displays system resource usage like CPU and memory.
Example:

top

22. dfDisk Space Usage

Reports available disk space on your file systems.
Example:

df -h

23. duEstimate File Space Usage

Shows the disk usage of files and directories. Add -h for human-readable output.
Example:

du -h /home/user

24. freeMemory Usage

Displays the amount of free and used memory in the system.
Example:

free -m

25. unameSystem Information

Print detailed system information. Add -a to get all system details.
Example:

uname -a