Basic Linux Commands (original) (raw)

Last Updated : 12 May, 2026

Linux commands are used to interact with the operating system through the terminal and perform tasks like file management, navigation, and system monitoring. Learning basic Linux commands helps beginners understand how Linux works and use it efficiently for daily tasks.

25_basic_linux_commands

25 Basic Linux Commands

If you're looking to set up your own Linux server to practice these commands or host projects, Hostinger can be a great option. Hostinger provides affordable VPS hosting plans with full Linux support, including popular distributions like Ubuntu, Cent-OS, and Debian. Its VPS hosting offers full root access, scalable resources, and high-performance servers, making it an excellent choice for both beginners and experienced developers looking for reliable and cost-effective hosting solutions.

25 Basic Linux commands to help beginners start working with Linux confidently.

1. ls

The ls command in Linux is used to list files and directories present in the current working directory.

**Syntax:

ls [options] [directory]

**Example:

ls

**Output:

ls

Output

2. pwd

The pwd command in Linux is used to display the full path of the current directory.

**Syntax:

pwd

**Example:

pwd

**Output:

pwd

Output

**3. mkdir

The mkdir command in Linux is used to create new directories or folders.

**Syntax:

mkdir directory_name

**Example:

mkdir GeeksforGeeks

**Output:

mkdir

Output

4. cd

The cd command in Linux is used to change the current working directory.

**Syntax:

cd directory_name

**Example:

cd GeeksforGeeks

**Output:

cd

Output

5. rmdir

The rmdir command in Linux is used to delete empty directories.

**Syntax:

rmdir directory_name

**Example:

rmdir TestFolder

**Output:

rmdir

Output

6. cat

The cat command in Linux is used to display file contents and combine multiple files.

**Syntax:

cat file_name

**Example:

cat test.txt

**Output:

cat

Output

7. cp

The cp command in Linux is used to copy files or directories.

**Syntax:

cp source destination

**Example:

cp file1.txt file2.txt

**Output:

cp

Output

8. mv

The mv command in Linux is used to move or rename files and directories.

**Syntax:

mv old_name new_name

**Example:

mv old.txt new.txt

**Output:

mv

Output

9. rm

The rm command in Linux is used to delete files permanently.

**Syntax:

rm file_name

**Example:

rm demo.txt

**Output:

rm

Output

10. uname

The uname command in Linux is used to display system information.

**Syntax:

uname [OPTIONS]

**Example:

uname

**Output:

uname

Output

11. locate

The locate command in Linux is used to find files using a database.

**Syntax:

locate file_name

**Example:

locate demo.txt

**Output:

locate

Output

12. touch

The touch command in Linux is used to create empty files and updates file timestamps.

**Syntax:

touch file_name

**Example:

touch test.txt

**Output:

touch

Output

13. ln

The ln command in Linux is used to create links between files.

**Syntax:

ln -s source link_name

**Example:

ln -s file1.txt link1.txt

**Output:

ln

Output

14. clear

The clear command in Linux is used to clear the terminal screen.

**Syntax:

clear

**Example:

clear

**Output:

clear

Output

15. ps

The ps command in Linux is used to display running processes.

**Syntax:

ps

**Example:

ps

**Output:

ps

Output

16. man

The man command in Linux is used to display command manuals.

**Syntax:

man command_name

**Example:

man ls

**Output:

man

Output

man--ls

Output

17. grep

The grep command in Linux is used to search text patterns.

**Syntax:

grep "text" file_name

**Example:

grep "Python" notes.txt

**Output:

image

Output

18. echo

The echo command in Linux is used to display text in the terminal.

**Syntax:

echo "text"

**Example:

echo "Hello Linux"

**Output:

echo

Output

19. wget

The wget command in Linux is used to download files from the internet using URL

**Syntax:

wget url

**Example:

wget http://example.com/file.zip%3C/span>

**Output:

wget

Output

20. whoami

The whoami command in Linux is used to display the current user.

**Syntax:

whoami

**Example:

whoami

**Output:

whoami

Output

21. sort

The sort command in Linux is used to sort file contents.

**Syntax:

sort file_name

**Example:

sort test.txt

**Output:

sort

Output

22. cal

The cal command in Linux is used to display the calendar.

**Syntax:

cal

**Example:

cal

**Output:

cal

Output

The current month calendar is displayed.

23. whereis

The whereis command in Linux is used to locate command files.

**Syntax:

whereis command_name

**Example:

whereis ls

**Output:

whereis

Output

24. df

The df command in Linux is used to display disk space usage.

**Syntax:

df [options]

**Example:

df -h

**Output:

df

Output

25. wc

The wc command in Linux is used to count words, lines, and characters.

**Syntax:

wc [OPTION] file_name

**Example:

wc test.txt

**Output:

wc

Output