Skip to content

Basic-Commands

Basic File Commands πŸ“

File Navigation

  • ls - List directories and files πŸ“‚

    Example:

    ls
    
    Use Case: To list the contents of the current directory.

  • ls -a - List all files and directories, including hidden ones πŸ•΅οΈ

    Example:

    ls -a
    
    Use Case: To list all files and directories, including hidden ones.

  • ls -l - List files and directories in long format πŸ“ƒ

    Example:

    ls -l
    
    Use Case: To list files and directories in long format.

  • pwd - Print Working Directory πŸ—‚οΈ

    Example:

    pwd
    
    Use Case: To display the current working directory.

  • cd - Change Directory πŸšΆβ€β™‚οΈ

    Example:

    cd /path/to/directory
    
    Use Case: To navigate to a different directory.


File Management

  • mkdir - Create a new directory πŸ“‚

    Example:

    mkdir new_directory
    
    Use Case: To create a new directory.

  • mv - Move or rename files and directories πŸ”„

    Example:

    mv file1 file2
    
    Use Case: To move or rename files and directories.

  • cp - Copy files and directories πŸ“„

    Example:

    cp file1 file2
    
    Use Case: To create copies of files and directories.

  • rm - Remove files and directories πŸ—‘οΈ

    Example:

    rm file.txt
    
    Use Case: To delete files or directories.

  • touch - Create blank/empty files πŸ“

    Example:

    touch new_file.txt
    
    Use Case: To create empty files.