Day 2 of 90DaysOfDevOps  ๐Ÿš€

Day 2 of 90DaysOfDevOps ๐Ÿš€

ยท

1 min read

Basic Linux Commands ๐Ÿง:

Listing commands ๐Ÿ“‹:

  • ls --> display all files and directories.

  • ls -l --> display a list of all files and directories including the extra information.

  • ls -a --> List out all the files and directories including hidden files and directories.

  • ls *.txt --> List all files that end with the .txt extension.

  • ls -d */ --> List only directories.

Directory commands ๐Ÿ“‚:

  • pwd --> Give the present working directory.

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

  • cd .. --> come out from the current directory.

  • cd ../.. --> to change the directory to 2 levels back.

  • cd ~ --> to change the directory to the home directory.

  • mkdir new_folder --> to make a new folder 'new_folder'.

  • mkdir -p a/b/c/d --> to make the nested folders.

  • rm -r directory_name --> to remove the directory.

File commands ๐Ÿ“:

  • touch file_name --> to create an empty file.

  • cat file_name --> to read the content of the file.

  • cat file_name >> "text_content" --> to write content in file.

  • vi file_name --> to write the content in the file.

  • rm file_name --> to remove the file.

ย