Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 1.22 KB

File metadata and controls

67 lines (52 loc) · 1.22 KB

Basic Linux Commands

Navigating Directories

  1. cd foldername
    Navigate to the directory named foldername.

    cd foldername
  2. cd ..
    Move to the parent directory of the current directory.

    cd ..

Listing Files and Directories

  1. ls
    Display a list of files and directories in the current directory.

    ls
  2. ls -a
    Show all files and directories, including hidden ones (those starting with .).

    ls -a

Creating Files and Directories

  1. mkdir foldername
    Create a new directory named foldername.

    mkdir foldername
  2. touch filename.txt
    Create an empty file named filename.txt.

    touch filename.txt

Editing and Viewing Files

  1. vi file.txt
    Open file.txt in the vi editor for editing. Press i to insert text and :wq to save and exit.

    vi file.txt
  2. cat file.txt
    Display the contents of file.txt in the terminal.

    cat file.txt

Deleting Files

  1. rm -rf file.txt
    Permanently delete file.txt. Use caution, as this action is irreversible.
    rm -rf file.txt