The Most Important Linux Commands

1.  get all directory size within Directory
du -h --max-depth=1 | sort -hr

2. delete directory and all files inside directory
rm -rf dir_name/
NOTE :   running this command be careful because files are permanently delete their is now way to restore it.

 3.get current directory path
pwd

4.List Directory
ls

5. go to root Directory
cd /

6. connect radis in ssh
redis-cli -h 10.0.0.01 -p 6379

7.  Flush radis database cache
FLUSHALL

8.  exit to radis environment
exit

9. login as super user in terminal
$ sudo su

10. Remove file
rm file.txt

11. It is a powerful command-line tool which can perform installation, upgrade, and even removing your software.
$ sudo apt-get update

$ sudo dnf update

12. grep
You need to find a file but you don't remember its exact location or the path. grep will help you to solve this problem.
$ grep user /etc/passwd


13. As a user, you often need to view some of text or code from your script. Again, one of the Linux basic commands is cat command. It will show you the text inside your file.
$ cat CMakeLists.txt

14. download image from url  in bulk in linx
first move to directory where images age saved.
put file images.txt having all files name line by line
run wget -i a.txt

15. see all commands and export in text file
history >> commands.txt

Comments