- man
Used to see help/manual of a command.
Example:
man ls
- ls
Shows files and folders.
Example:
ls
- pwd
Shows current directory path.
Example:
pwd
- cd
Change directory.
Example:
cd Documents
- ls and ls -a
ls → normal files
ls -a → shows hidden files
Example:
ls -a
- ls -l
Shows detailed file info.
Example:
ls -l
- ls -al
Shows detailed + hidden files.
Example:
ls -al
- ls -alh
Shows size in KB/MB (easy to read).
Example:
ls -alh
- ls -alht Sort files from newest to oldest. Example: ls -alht
- ls -alhtr
Sort files from oldest to newest.
Example:
ls -alhtr
- ls -l --sort=time
Sort by time (newest first).
Example:
ls -l --sort=time
- ls -l --sort=time -r
Sort by time (oldest first).
Example:
ls -l --sort=time -r
- cd .. and cd .
cd .. → go one folder up
cd . → stay in same folder
Example:
cd ..
- cd / and cd ~
cd / → go to root directory
cd ~ → go to home directory
Example:
cd ~
- mkdir
Create a folder.
Example:
mkdir myFolder
- Touch
- If
myFile.txtdoes not exist → A new empty file namedmyFile.txtis created. - If
myFile.txtalready exists → The file remains the same, but its last modification timestamp is updated.
Create a new empty file.
If the file already exists, the
touch command does not change its contents—it only updates the file's last modification time.Example:
Loading...What happens?
- Creating Multiple Directories Using
mkdir
Themkdircommand allows you to create one or more directories at the same time. In the example below, three directories—comedy,action, andhorror—are created with a single command. Runninglsconfirms that all the directories were created successfully.

- Creating Nested Directories Using
mkdir -p
The-poption allows you to create an entire directory structure in a single command. In this example,mkdir -p kids/animation/2010creates thekidsdirectory, followed by theanimationsubdirectory and the2010directory. Thels,cd, andpwdcommands are then used to verify that the directory hierarchy was created successfully.

.jpg?table=block&id=29d76b1d-f1a8-8072-a9bf-cc78d1c7d881&cache=v2)
