Learn about the GNU/Linux command-line interface (CLI) and basic shell commands.

 Learn about the GNU/Linux command-line interface (CLI) and basic shell commands.

The GNU/Linux command-line interface (CLI) is a text-based interface that allows users to interact with the operating system and execute commands. Here are some basic shell commands commonly used in the GNU/Linux CLI:

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

    • Example: ls or ls -l (to display detailed information)
  2. cd: Change the current directory.

    • Example: cd /path/to/directory or cd .. (to go up one level)
  3. pwd: Print the current working directory.

  4. mkdir: Create a new directory.

    • Example: mkdir new_directory
  5. rm: Remove files and directories.

    • Example: rm file.txt (to remove a file) or rm -r directory (to remove a directory and its contents)
  6. cp: Copy files and directories.

    • Example: cp file.txt /path/to/destination or cp -r directory /path/to/destination (to copy a directory and its contents)
  7. mv: Move or rename files and directories.

    • Example: mv file.txt /path/to/destination (to move a file) or mv file.txt newname.txt (to rename a file)
  8. cat: Display the contents of a file.

    • Example: cat file.txt
  9. grep: Search for specific text patterns within files.

    • Example: grep "pattern" file.txt (to search for a pattern in a file)
  10. chmod: Change the permissions of files and directories.

    • Example: chmod +x script.sh (to make a script executable)
  11. sudo: Execute a command with administrative privileges.

    • Example: sudo apt-get update (to update packages)
  12. man: Access the manual pages for a command to get more information.

    • Example: man ls (to view the manual for the ls command)

These are just a few basic shell commands, but there are many more available in the GNU/Linux CLI. Each command often has additional options and parameters that can be used for more specific actions. It's helpful to explore the manual pages (man) for commands to learn more about their functionalities and usage.

You should also read: