Basic Linux Commands List with Examples 2023

Here is an Image attached which shows Most Commonly used Basic Linux Commands 2023 👇


Here are some essential Linux commands and their descriptions with examples:

 

1. ls: List files and directories in the current directory.

   Example: “ls”

 

2. pwd: Print the current working directory.

   Example: “pwd”

 

3. cd: Change the current directory.

   Example: “cd /path/to/directory”

 

4. mkdir: Create a new directory.

   Example: “mkdir new_directory”

 

5. rmdir: Remove a directory (only works if it's empty).

   Example: “rmdir empty_directory”

 

6. touch: Create an empty file.

   Example: “touch filename.txt”

 

7. cp: Copy files or directories.

   Example: “cp sourcefile destination”

 

8. mv: Move or rename files or directories.

   Example: “mv oldfile newfile” or “mv source destination”

 

9. rm: Remove files or directories.

   Example: “rm filename.txt” (be careful with this command)

 

10. cat: Concatenate and display the contents of a file.

    Example: “cat file.txt”

 

11. less: View the contents of a file one page at a time.

    Example: “less file.txt”

 

12. head: Display the beginning lines of a file.

    Example: “head file.txt”

 

13. tail: Display the ending lines of a file.

    Example: “tail file.txt”

 

14. grep: Search for patterns in text.

    Example: “grep "pattern" file.txt”

 

15. find: Search for files and directories.

    Example: “find /path/to/search -name "filename"“

 

16. chmod: Change file permissions.

    Example: “chmod permissions filename”

 

17. chown: Change file owner and group.

    Example: “chown user:group filename”

 

18. ps: List running processes.

    Example: “ps aux”

 

19. kill: Terminate a process.

    Example: “kill process_id”

 

20. sudo: Execute a command with superuser privileges.

    Example: “sudo command”

 

21. tar: Archive files.

    Example: “tar -cvzf archive.tar.gz files_to_archive”

 

22. wget: Download files from the internet.

    Example: “wget URL”

 

23. df: Display disk space usage.

    Example: “df -h”

 

24. du: Show directory space usage.

    Example: “du -sh directory”

 

These are just some of the fundamental Linux commands. To learn more about each command and their options, you can refer to the Linux manual pages by typing “man command_name” in the terminal (e.g., “man ls” for information about the “ls” command).

#BasicLinuxCommands #BasicLinuxCommandsList

Post a Comment

0 Comments