Lesson 1 - Basic commands to navigate directories
dheeraj koranga
2 min read
pwd
(Print Working Directory):- Displays your current directory (or folder) within the terminal. It's useful to know where you are within the file system.
mkdir
(Make Directory):- Creates a new directory (or folder) in the specified location.
mkdir -v
(Verbose Mode formkdir
):- Creates a directory and prints a message for each directory created. The
-v
flag stands for "verbose" and tells you what action was performed.
- Creates a directory and prints a message for each directory created. The
mkdir -vp
(Verbose + Parent Directories):- Creates a directory along with any necessary parent directories. The
-p
option allows the creation of parent directories that don't exist yet, and the-v
prints the actions.
- Creates a directory along with any necessary parent directories. The
ls
(List):- Lists the files and directories in the current working directory. It shows the names of items in the directory.
ls -R
(Recursive List):- Lists files and directories recursively, showing all files in the current directory and subdirectories.
cd
(Change Directory):
- Changes the current directory to another specified directory. It's how you navigate between directories.
cd ..
:- Moves you up one directory level (i.e., to the parent directory of your current directory).
cd -
(minus sign):- Switch back to the previous directory you were in before the last
cd
command. It acts as a toggle between two directories.
- Switch back to the previous directory you were in before the last
cd
(with no arguments):- It takes you back to your home directory, regardless of where you are in the file system.
0
Subscribe to my newsletter
Read articles from dheeraj koranga directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by