ls --> to see list of files in a folder.
In linux each command can have arguments, to perform different behaviour.
ls -l --> long list of files. It will display long list file details
rwx...... i root 1457 Apr 21 23:23 original-ks.cfg
ls -l / --> it will give directory structure of a folder
ls -lrt --> This will display the list of files based on timestamp modified in reverse order or descending order.
clear --> to clear the screen
mkdir --> to create a directory.
mkdir test --> will create a directory test.
mkdir -p /a/b/c/d/e --> This will create folder inside a folder directly. This will create e folder directly by creating a, b, c, d folder in single shot.
pwd --> present working directory
cd --> change directory
cd test - will move me to test directory.
cd .. --> to take present directory to one level up.
touch --> to create a dummy files.
touch 1 2 3 --> it will create dummy files 1 , 2 , 3.
rm --> to remove/delete file.
rmdir --> delete a directory if folder is empty.
rm -rf --> to remove all files recursively and forcefully
r-> recursively
f-> force
rm -rf /a --> to remove all the directory and files in folder recursively.
This is very dangerous command in Linux. There is nothing like recycle bin in Linux. So you will never get back the file.
rm -rf / ===> all folders will be gone and your Linux machine will be screwed up.
cp --> copy a file or folder
cp file file123 --. This will create another file123 and copy contents from file.
cat --> to list out all the contents of a file.
suppose we have a file called '2' which contains a text 'hello world'
cat 2 -> it will display all the contents of file 2.
hello world