Basic commands used in the command line interface of a Unix-b ased operating system such as Linux or macOS.
pwd
: Stands for “print working directory.” It shows the current working directory, which is the directory in the file system where the user is currently located.
ls
: Stands for “list.” It shows the contents of the current directory, which can include files, directories, and other types of files.
cd
: Stands for “change directory.” It is used to navigate through the file system and change the current working directory to a new location.
mkdir
: Stands for “make directory.” It creates a new directory (folder) in the file system with the specified name.
touch
: Used to create a new file in the file system with the specified name. If the file already exists, it updates the timestamp of the file.
cd projects
: Changes current directory to the “projects” directory.
mkdir new-project
: Creates a new directory named “new-project” inside the “projects” directory.
touch new-project/newfile.md
: Creates a new file named “newfile.md” inside the “new-project” directory.
cd ..
: Changes the current directory to the parent directory.
ls projects/new-project
: Lists the contents of the “new-project” directory inside the “projects” directory. Since we created a file called “newfile.md” inside that directory, if it is listed then we can confirm the new file was created successfully.