Day-2 of DevOps

Day-2 of DevOps

Basic Linux commands

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 information

  • ls -a --> list all including hidden files and directory

  • ls *.jpg --> list all the files having .jpg extension.

  • ls -s --> Prints the allocated size of each file, in blocks.

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

  • Directoy commands

    • mkdir directoryname--> Make a Directory.
  • mkdir .directoryname--> Make a Hidden Directory.

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

  • cd path_to_directory --> change directory to the provided path

  • cd ~ or just cd --> change directory to the home directory

  • cd - --> 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

  • mkdir -p x/y/z --> to make a nested directory.