cd (Change Directory): Navigate through the file system.

CommandDescription
cd Documentsmoves to the Documents folder
cd ..goes up one directory level
cd ~goes to the home directory
cd -returns to the previous directory
pwd (Print Working Directory): Displays the current directory path.
CommandDescription
pwdprints the full path of your location

ls (List Files): Displays files and directories.

CommandDescription
lslists files and directories in the current directory
ls -ldetailed listing with permissions, size, etc.
ls -aincludes hidden files in the listing
ls -lhdetailed listing with human-readable sizes

File and Directory Creation

touch: Creates empty files.

CommandDescription
touch file.txtcreates an empty file named file.txt

mkdir (Make Directory): Creates new directories.

CommandDescription
mkdir myfoldercreates a folder named myfolder
mkdir -p folder/subfoldercreates nested directories in one step

Wildcards for Multiple Files

Wildcards simplify operations on multiple files.

WildcardExampleDescription
*ls *.txtmatches all files ending in .txt
?ls file?.txtmatches files like file1.txt

Basic File Operations

cp (Copy): Copies files or directories.

CommandDescription
cp file.txt backup.txtcopies file.txt to backup.txt
cp -r folder1 folder2copies the folder and its contents

mv (Move/Rename): Moves or renames files.

CommandDescription
mv oldname.txt newname.txtrenames oldname.txt to newname.txt
mv file.txt /path/to/folder/moves the file to another location

rm (Remove): Deletes files or directories.

CommandDescription
rm file.txtdeletes the file
rm -r folderdeletes the folder and its contents

Helpful Shortcuts

ShortcutDescription
Ctrl + Lclears the terminal screen
Ctrl + Cstops the current command
Ctrl + Rsearches command history interactively
!!repeats the last command
!<cmd>runs the most recent command starting with <cmd>