Day2: Basic of Linux
Day 2: we are going to learn the basic command of Linux.
Linux is a family of free and open-source operating systems based on the Linux kernel. Operating systems based on Linux are known as Linux distributions or distros. Examples include Debian, Ubuntu, Fedora, CentOS, Gentoo, Arch Linux, and many others.
Listing commands
ls option_flag arguments --> List the sub directories and files available in the present directory
Examples:
ls -l--> List the files and directories in long list format with extra informationls -a--> List all including hidden files and directoryls *.sh--> list all the files having .sh extension.ls -I--> list the files and directories with index numbers Inodesls -d */--> list only directories.(we can also specify a pattern)
Directoy commands
pwd--> print work directory. Gives the present working directory.cd path_to_directory--> change directory to the provided pathcd ~or justcd--> change directory to the home directorycd ---> Go to the last working directory.cd ..--> change directory to one step back.cd ../..--> Change directory to 2 levels back.mkdir directoryName--> to make a directory in a specific location
Task:
Task#1: Check your present working directory.
To check our present working directory, we can use the following command depending on the operating system you are using:
The pwd command stands for "print working directory." When you execute this command, it will display the absolute path of your current working directory.
Task#2: List all the files or directories including hidden files.
To list all the files and directories, including hidden files, we can use the following command, depending on your operating system:
Let's break down the ls -a command:
- On Linux and macOS, the
lscommand is used to list files and directories. The-aoption stands for "all" and includes hidden files and directories in the output.
Task#3: Create a nested directory A/B/C/D/E.
To create a nested directory structure A/B/C/D/E, we can use the command line interface (CLI) or a terminal. Here's the command we can use:

Thank you .