Day 2:- Basic linux commands

Day 2:- Basic linux commands

Listing commands

  1. ls option_flag arguments --> list the sub directories and files avaiable in the present directory

  2. ls -l--> list the files and directories in long list format with extra information

  3. ls -a --> list all including hidden files and directory

  4. ls *.sh --> list all the files having .sh extension.

  5. ls -i --> list the files and directories with index numbers inodes

  6. ls -d */ --> list only directories.(we can also specify a pattern)

Directory commands

  1. pwd --> print work directory. Gives the present working directory.

  2. cd path_to_directory --> change directory to the provided path

  3. cd ~ or just cd --> change directory to the home directory

  4. cd - --> Go to the last working directory.

  5. cd .. --> change directory to one step back.

  6. cd ../.. --> Change directory to 2 levels back.

  7. mkdir directoryName --> to make a directory in a specific location

  8. mkdir -p a/b/c/d --> to make a nested directory