Ubuntu-L1-Cadet

File & Directory Navigation

  1. pwd — Show the current working directory

    pwd
  2. ls — List files and directories

    ls
    ls -l
    ls -a
  3. cd — Change directory

    cd Documents
    cd ..
    cd ~
  4. tree — Display directory structure as a tree (install first)

    sudo apt install tree
    tree

File & Directory Management

  1. touch — Create an empty file

    touch file.txt
  2. mkdir — Create a directory

    mkdir myfolder
  3. rmdir — Delete an empty directory

    rmdir myfolder
  4. rm — Remove files or directories

    rm file.txt
    rm -r foldername
  5. cp — Copy files or directories

    cp file1.txt file2.txt
    cp -r dir1 dir2
  6. mv — Move or rename files

    mv old.txt new.txt
    mv file.txt /tmp/

Viewing & Reading Files

  1. cat — Display file contents

  2. less — View file page by page

  3. head — View first lines of a file

  4. tail — View last lines of a file


System & User Information

  1. whoami — Show current user

  2. uname -a — Show system information

  3. df -h — Show disk usage

  4. free -h — Show memory usage


Package Management (Ubuntu-specific)

  1. sudo — Run command as administrator

  2. apt update — Update package list

  3. apt install — Install software

  4. apt remove — Remove software


Searching & Help

  1. find — Search for files

  2. grep — Search text inside files

  3. man — View command manual


Last updated