ls
Displays all files and directories in the current folder.
Think of it as asking, "What are the contents of the current directory?"
Example:
ls
pwd
Prints the current working directory (shows where you are).
Think of it as asking, "What is my current directory?"
Example:
pwd
cd [directory_path]
Changes the current directory to the specified directory.
Example:
cd Documents
cd ../
Moves one step back to the parent directory.
Works like the back button in a file manager.
Example:
cd ../
mkdir [directory_name]
Creates a new directory (folder).
Example:
mkdir new_folder
touch [filename]
Creates a new file.
Linux allows files with the same name but different cases (case-sensitive).
Example:
touch file1.txt
cp [source] [destination]
Copies a file from one location to another.
Example:
cp file1.txt /home/user/Documents/
mv [source] [destination]
Moves a file from one location to another. It can also be used to rename a file.
Example:
mv file1.txt /home/user/Documents/
rm [filename]
Deletes a file.
Example:
rm file1.txt
touch .[filename]
Creates a hidden file (file names starting with a dot are hidden in Linux).
Example:
touch .hiddenfile
ls -a
Lists all files in the directory, including hidden files.
Example:
ls -a
ls -R
Recursively lists all files and directories, including their subdirectories.
Example:
ls -R
clear
Clears the terminal screen (does not delete commands but scrolls them out of view).
Example:
clear