ls
– List directory contentsFunction: Displays files and directories.
Syntax:
ls # list files
ls -l # detailed listing
ls -a # show hidden files
Lesson: Always use ls -l
to check permissions and ownership.
cd
– Change directoryFunction: Navigate directories.
Syntax:
cd /home/user
cd .. # go up one level
cd ~ # go to home directory
Lesson: Always confirm location with pwd
before major actions.
pwd
– Print working directoryFunction: Shows the current directory.
Syntax:
pwd
Lesson: Crucial when navigating deeply nested directories.
mkdir
– Make a directoryFunction: Creates new directories.
Syntax:
mkdir projects
mkdir -p folder/subfolder
Lesson: Using p
saves time by creating nested folders in one step.