What are common Linux commands?

0109

Common Linux Commands

Linux is a powerful operating system that offers a wide range of commands to help users manage their systems effectively. Here are some of the most common Linux commands that you should be familiar with:

  1. cd (change directory): This command allows you to navigate through the file system and change the current working directory.
    Example: cd /home/user/documents

  2. ls (list): This command displays the contents of the current directory.
    Example: ls -l (displays detailed information about the files and directories)

  3. pwd (print working directory): This command displays the full path of the current working directory.
    Example: pwd

File Management Commands

  1. mkdir (make directory): This command creates a new directory.
    Example: mkdir new_folder

  2. rm (remove): This command deletes files or directories.
    Example: rm file.txt (removes a file), rm -r directory (removes a directory and its contents)

  3. cp (copy): This command creates a copy of a file or directory.
    Example: cp source_file.txt destination_file.txt

  4. mv (move): This command moves or renames a file or directory.
    Example: mv file.txt new_location/file.txt

Process Management Commands

  1. ps (process status): This command displays information about running processes.
    Example: ps aux (displays all running processes)

  2. top: This command provides a real-time view of the running processes, including CPU and memory usage.
    Example: top

  3. kill: This command terminates a running process.
    Example: kill 1234 (terminates the process with ID 1234)

System Information Commands

  1. uname: This command displays information about the Linux system, such as the kernel version, operating system, and hardware architecture.
    Example: uname -a (displays detailed system information)

  2. df (disk free): This command displays information about the available disk space on the system.
    Example: df -h (displays disk space in human-readable format)

  3. free: This command displays information about the system's memory usage.
    Example: free -m (displays memory usage in megabytes)

File Manipulation Commands

  1. cat: This command displays the contents of a file or concatenates multiple files.
    Example: cat file.txt

  2. grep: This command searches for a specific pattern within a file or the output of a command.
    Example: grep "search_term" file.txt

  3. sed (stream editor): This command is used for text manipulation, such as search and replace.
    Example: sed 's/old_text/new_text/g' file.txt

These are just a few examples of the many Linux commands available. As you continue to work with Linux, you will discover more commands and explore their various options and use cases.

graph TD A[Linux Commands] B[Navigation] C[File Management] D[Process Management] E[System Information] F[File Manipulation] A --> B A --> C A --> D A --> E A --> F B --> cd B --> ls B --> pwd C --> mkdir C --> rm C --> cp C --> mv D --> ps D --> top D --> kill E --> uname E --> df E --> free F --> cat F --> grep F --> sed

0 Comments

no data
Be the first to share your comment!