whereis- Find the path of that executable file.
ls- Shows list.-a- Hidden file.-l- Persmission.-R- Show sub dir.
cd <folder-name>- Change Dir.cd ..- Go one Directory back.cd- Go to home.cd ../<foldername>- Open a previous dir folder.cd <path>- Open a dir with the path.
mkdir <new-dir-name>- Create a new folder.mkdir -p test/test1/test2- Craete a dir between two directories.touch <new-file-name>- create a blank file.pwd- Present working directory.cat <filename>- Display file content.cat > <new-file-name>- Create a file.dd if=/dev/zero of=bos_dosya bs=4G count=1- create empty file with zeroscat >> <filename>- Append the file.cat <filename> <filename2>- Display 2 files at a time.cat <filename> <filename2> > <newfile-name>- Merge both of file content in a single one.cat <file-name> | tr > <new-file-name>- Translate the file.cut -c 1-2 <filename>- cut the file with colum wiseecho "Hello" >> <file-name>
man <commad name>- Know about the command usages and options.man <commad name>- know about the command.
cp <file-name> <new-fie-name>- Make a copy of a file in the current location.mv <file-name> <dir-path>- Move a file from a one dir to a another.mv <file-name> <new-fie-name>- Rename a file.mv -R <dir-name> <dir-path>- Move Dirrm <file-name>- Remove a filerm -R <file-name>- Delete a folder with dir included.head <file-name>- Will display first 10 lines of a file.tail <file-name>- Will display last 10 lines of a file. --n 2- will display last 2 lines.diff <file-1> <file-2>- Show diff between the two files.locate <file>- To find out the file.find <file/folder-name>- Find a file/folder.find <dir-name>- Find files inside the dirfind .-type d- Show only dir..-type f-Sshow only files..-type f -name "*.txt"- Show only files with that specfic name..-type f -iname "*.txt"- Show only files with that specfic name - not case sentive (i).-type f -mmin -20- Show files which modify less than 20 min ago..-type f -mmin +20- show files which modify more than 20 min ago..-type f -maxdepth 2- Will only show 1 folder deep..-size +1k- will only show file/folder with size of 1kb
ps aux- processes which are runningdf- Check the capacity and storage details.m- In megabyte) orhg- (gigabyte).
du- Disk usages capcity-h(human readable)
echo- Get a output of a stringecho $PATH- Check the path varibalesudo- Admin commandsudo chown root text.txt- chnage owner!<command-name>- Run the pevious commandgit add .; git commit -m "message"- Run mutiple commands at a timesort <file-name>"- sort the filejobwget <url>- download the file from the URLtop- what processes are runningkill <process-id>-stop that processUname-zip <file-1> <file-2>- Zip Two or more filesUnzip <file-name>- Unzip filesuseradd <name>passwd <name>uname -<flag>-o -m -rlscpu- get cpu detailsfree- free memoryvmstat- virtual memorylsof- list all the open filexdg-open <file-fath>- open the folder (graphical window) of a file/folder with path.xdg-open .- open the folder of the current directory.vi ~/.bashrc- set your Aliasecho -n 'username' | base64
nslookup google.comnetstat-hostname-whoami-ping google.com
chmod u=rwx,g=rxw,o=rwx <file-name>READ, WRITE AND EXECUTEchmod 777 <file-name>- 4- Read, 2- Write, 1 - Executefind . -perm 777- will only show file/folder with size of 1kbgrep <keyword> <file-name>- To search if the keyword is presnt in the file or notgrep -w <keyword> <file-name>- To search if the keyword is presnt in the file or not (complete word)grep -i <keyword> <file-name>- To search if the keyword is presnt in the file or not (not case sens)grep -n <keyword> <file-name>- To search if the keyword is presnt in the file or not (Line number)grep -B <keyword> <file-name>- Show Line before that keywordgrep -win <keyword> ./*.txt- To search if the keyword is presnt in the file in current dirgrep -win -r <keyword> .*history | grep "ls -l"- Pipping, we filter out the things
histroy
!<number-from-history>
-
ping google.com & pingfacebook.com -
echo "google.com" && echo "facebook.com"- second will oly run if first is sucessful -
echo "google.com" && {echo "facebook.com"; eco "pradumnasaraf.co"} -
echo "google.com" || echo "pingfacebook.com" -
echo "google.com" || echo "pingfacebook.com" -
rm -r !(file.txt) -
printevnv- to print all th env.