Day-2  #90DaysOfDevOps

Day-2 #90DaysOfDevOps

1) Check your present working directory:-

PWD:- This is the command to check the present working directory.

2) List all the files/directories including hidden files:-

ls - is:- the command where you can list your files and directories. By using various attributes of ls you can check more details i.g date&time, hidden files etc

Attributes:- ls -l:- Its Shows a long list of files/directories.

ls -lh:- It's used to display files in an easy-to-read format

ls -lt:- to display files/directories order by last modifications time

ls -ltr:- sorting the files/directories in the last modifications time in reverse order

ls -a:- It will show all the hidden files in the directory. ls -t Listing all files and the last modified file in first order

  1. Create a nested directory A/B/C/D/E

    mkdir -p first_dir/sec_dir/third_dir/

but if we have several lists of directories to create then the above way is time-consuming hence by using the below command we can create N. number of directories in a single go

mkdir -p my_dir_{1..10}

mkdir -p my_dir_{1..10}

*To create several files we use the below command

touch class_1{1..16}

touch class_1{1..16}
  1. Some other Useful commands in industry.

    tail - It is useful to print the last part of the file (10 Lines by default)

    tail -f this is the mainly used attribute in org to monitor the growth of log files.

    cat - this command is mainly used to reads data from the files and give their content as output. it helps to create, view, and concatenate files.