Skip to main content

30 Linux Commands You Should Know


Linux is a powerful operating system used by developers, system administrators, and tech enthusiasts worldwide. Whether you're new to Linux or brushing up on your skills, here are 30 essential commands every Linux user should know:


Start Learning  Linux Fundamentals For Free

1. ls

Lists files and directories in the current directory.

ls

2. cd

Changes the current directory.

cd /path/to/directory

3. pwd

Prints the current working directory.

pwd

4. touch

Creates an empty file.

touch filename

5. mkdir

Creates a new directory.

mkdir new_directory

6. rm

Removes files or directories.

rm filename

Use rm -r for directories.

7. cp

Copies files or directories.

cp source destination

8. mv

Moves or renames files and directories.

mv oldname newname

9. cat

Displays the contents of a file.

cat filename

10. nano

Opens a simple text editor.

nano filename

11. vim

A powerful text editor.

vim filename

12. chmod

Changes file permissions.

chmod 755 filename

13. chown

Changes file ownership.

chown user:group filename

14. find

Searches for files and directories.

find /path -name filename

15. grep

Searches for patterns in files.

grep "pattern" filename

16. df

Displays disk space usage.

df -h

17. du

Shows disk usage of files and directories.

du -sh

18. top

Displays real-time processes and resource usage.

top

19. ps

Lists running processes.

ps aux

20. kill

Terminates processes by their PID.

kill PID

21. tar

Archives files and directories.

tar -cvf archive.tar files

Extract:

tar -xvf archive.tar

22. zip/unzip

Compresses and extracts files.

zip archive.zip files
unzip archive.zip

23. wget

Downloads files from the internet.

wget http://example.com/file

24. curl

Transfers data from or to a server.

curl http://example.com

25. ssh

Connects to a remote server via SSH.

ssh user@hostname

26. scp

Copies files over SSH.

scp file user@remote:/path

27. history

Displays the command history.

history

28. alias

Creates shortcuts for commands.

alias ll='ls -la'

29. sudo

Executes commands with superuser privileges.

sudo command

30. reboot

Restarts the system.

sudo reboot

Mastering these commands can significantly boost your productivity and efficiency in Linux. Practice them regularly to get comfortable with their usage.

Comments