Table of contents
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.