What are other common Linux commands?

075

Here are some common Linux commands along with their basic functions:

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

    ls -l  # Lists with detailed information
  2. cd: Changes the current directory.

    cd /path/to/directory  # Navigate to a specific directory
  3. cp: Copies files or directories.

    cp source.txt destination.txt  # Copy a file
  4. mv: Moves or renames files or directories.

    mv oldname.txt newname.txt  # Rename a file
  5. rm: Removes files or directories.

    rm filename.txt  # Delete a file
  6. mkdir: Creates a new directory.

    mkdir new_directory  # Create a new directory
  7. rmdir: Removes an empty directory.

    rmdir empty_directory  # Remove an empty directory
  8. touch: Creates an empty file or updates the timestamp of an existing file.

    touch newfile.txt  # Create a new empty file
  9. cat: Concatenates and displays the content of files.

    cat filename.txt  # Display the content of a file
  10. grep: Searches for a specific pattern in files.

    grep "search_term" filename.txt  # Search for a term in a file
  11. find: Searches for files and directories in a directory hierarchy.

    find /path/to/search -name "filename.txt"  # Find a file by name
  12. chmod: Changes the permissions of a file or directory.

    chmod 755 script.sh  # Change permissions
  13. chown: Changes the owner of a file or directory.

    chown user:group filename.txt  # Change file ownership
  14. man: Displays the manual page for a command.

    man ls  # Show the manual for the ls command

These commands form the foundation of working in a Linux environment and are essential for file management, navigation, and system administration.

0 Comments

no data
Be the first to share your comment!