Common Linux Commands – Part 2

File Search Commands:

1. find directory -name “filename Search for files by name

2. find directory -type f -name “*.txt” Find specific type of files

3. grep “text” filename Search for text in a file

4. grep -r “text” directory Recursively search for text in a directory

5. locate filename Quickly find a file

6. which command_name Show the full path of a command

7. whereis command_name Show the binary, source, and manual location of a command

Permission Management Commands:

8. chmod 755 filename Change file permissions

9. chmod +x filename Add executable permission

10. chown user:group filename Change file owner

11. chgrp group_name filename Change file group ownership

12. umask Show or set the default file permission mask

System Information Commands:

13. uname -a Show system information

14. hostname Show hostname

15. uptime Show system uptime

16. whoami Show current username

17. who Show logged-in users

18. w Show logged-in users and their activities

19. date Show or set system date and time

20. cal Show calendar

21. free -h Show memory usage

22. df -h Show disk space usage

23. du -sh directory Show directory size

24. top Dynamically display process information

25. htop Enhanced version of top (requires installation)

26. ps aux Show all processes

27. ps -ef | grep process_name Find a specific process

28. kill PID Terminate a process

29. kill -9 PID Forcefully terminate a process

30. lscpu Show CPU information

31. lsblk List block device information

32. lspci List PCI devices

33. lsusb List USB devices

Leave a Comment