Listing commands
ls option_flag arguments --> List the subdirectories and files available in the present directory
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)
Directory 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 the directory to one step back.cd ../..
--> Change directory to 2 levels back.mkdir directoryName
--> Use to make a directory in a specific location
Examples:
mkdir newFolder # make a new folder 'newFolder'
-
mkdir .NewFolder # make a hidden directory (also . before a file to make it hidden)
-
mkdir A B C D #make multiple directories at the same time
-
mkdir /home/user/Mydirectory # make a new folder in a specific location
-
mkdir -p A/B/C/D # make a nested directory