I present to you a compilation of the most useful Linux commands regarding File and Directory Operations
In commands that require entering file or directory names, you can press tab twice to autocomplete the path or get a list of available files.
Navigating Between Directories
Go to root directory
cd
Go to previous directory
cd ..
Enter directory (absolute path)
cd /directory1/directory
Enter directory (relative path)
cd directory1/directory2
Go to user directory
cd ~
Go to last visited directory
cd -
Show current path
pwd
Listing Files and Directories
Show files and directories
ls
Show files and directories with details
ls -l
Show files and directories, including hidden ones
ls -a
Show files and directories sorted by modification date
ls -lt
Show files and directories in list format, including sizes
ls -lh
File and Directory Manipulation
Rename or move a file or directory
mv source destination
Copy a file
cp file destination
Copy a directory
cp -r source destination
Delete the file named file
rm file
Delete directory if it is empty
rm -d directory
Delete directory and its contents
rm -r directory
Create new directory
mkdir directory
Create multiple directories simultaneously
mkdir directory1 directory2
Create directory path
mkdir -p /directory1/directory2
Create empty file
touch file
Change file date (format year, month, day, and hour)
touch -t 19901230000 file
Symbolic Links
Create a symbolic link to the file or directory
ln -s file link1
Create a hard link to the file or directory
ln file link1
View details about a symbolic link
ls -l link1