What are other basic terminal commands?

0142

Here are some essential basic terminal commands that are commonly used in Linux:

1. pwd

  • Purpose: Prints the current working directory.
  • Usage: Simply type pwd and press Enter.
  • Example:
    pwd
    This will display the full path of your current directory.

2. ls

  • Purpose: Lists the contents of a directory.
  • Usage: Type ls to see files and folders in the current directory.
  • Example:
    ls
    You can also use options like -l for a detailed list or -a to include hidden files:
    ls -la

3. cd

  • Purpose: Changes the current directory.
  • Usage: Type cd followed by the directory name.
  • Example:
    cd Documents
    To go back to the home directory, simply type cd without any arguments.

4. mkdir

  • Purpose: Creates a new directory.
  • Usage: Type mkdir followed by the name of the new directory.
  • Example:
    mkdir new_folder

5. rmdir

  • Purpose: Removes an empty directory.
  • Usage: Type rmdir followed by the directory name.
  • Example:
    rmdir old_folder

6. cp

  • Purpose: Copies files or directories.
  • Usage: Type cp followed by the source file and the destination.
  • Example:
    cp file.txt backup_file.txt

7. mv

  • Purpose: Moves or renames files or directories.
  • Usage: Type mv followed by the source and destination.
  • Example:
    mv old_name.txt new_name.txt

8. cat

  • Purpose: Displays the contents of a file.
  • Usage: Type cat followed by the file name.
  • Example:
    cat file.txt

9. grep

  • Purpose: Searches for a specific pattern in files.
  • Usage: Type grep followed by the pattern and the file name.
  • Example:
    grep "search_term" file.txt

10. man

  • Purpose: Displays the manual for a command.
  • Usage: Type man followed by the command name.
  • Example:
    man ls

These commands form the foundation of using the terminal effectively. As you practice, you'll become more comfortable with navigating and managing files in a Linux environment. If you have any specific commands you'd like to learn more about, feel free to ask!

0 Comments

no data
Be the first to share your comment!