Day 3: Learning Linux Basic commands

Day 3: Learning Linux Basic commands

learning in Open Source

·

3 min read

Table of contents

Today I have practiced Linux Basic commands as follows:

  1. locate
  2. find
  3. chmod
  4. chown
  5. grep
  6. history
  7. alias
  8. sort
  9. jobs
  10. ping
  11. wget
  12. top
  13. uname
  14. zip
  15. unzip
  16. hostname
  17. useradd
  18. userdel
  19. lscpu
  20. free
  21. umstat
  22. id
  23. getent
  24. lsof
  25. nslookup
  26. netstat
  27. sed
  28. cut
  29. htop

Description:

  1. To locate a file and return the directory it present in
locate
  • In case to display all files and the directory it present in
locate "*.txt"
  1. To display all files in the directory
find .
  • display in the previous direc
find ..
  • display only direc
find . -type d
  • display only files
find . -type f
  • display files with a specific name
find . -type f -name "two"
  • display files modifies specific time ago
find . -type f -mmin-20
  • display files that are empty
find . -empty
  • display files with read,write,execute
find . -perm 777
  • find all text files and remove
find . -type f -name "*.txt" -exec rm -rf {} +
  1. To control/modify file permissions
chmod u=rwx,g=rw,o=r  file.txt
  • modifying with numbers, 4 for read, 2 for write, 1 for execute
chmod 777 file.txt
  1. To change file owner
chown root file.txt
  1. To search for a string in group of files
grep "kunal" names.txt
  • search complete word
grep -w "kunal kush" names.txt
  • search and display line number
grep -n "name" names.txt
  • complete word which is case sensitive, line number in all files
grep -win "name" ./*.txt
  1. To know the history of commands used
histroy
  1. To replace one string with another
alias
  1. To sort in a file
sort
  1. To show running processes
jobs
  1. To connect to server and receive packet
ping
  1. To download
wget
  1. To show running softwares
top
  1. To display kernel name
uname
  1. To create compressed file
zip
  1. To unzip file
unzip
  1. To obtain hostname and DNS info
hostname
  1. To add user
useradd
  1. To delete user
userdel
  1. To show cpu details
lscpu
  1. To show free memory check
free
  1. To show virtual memory check
umstat
  1. To see groups
id
  1. To see user exit
getent
  1. To list all open files
lsoff
  1. To check IP of a domain
nsloopup
  1. To see active ports
netstat
  1. stream editor logs
sed
  1. To cut out selected portions of each file of a line
cut
  1. To show resource consumptions
htop

Conclusion: I have completed training on basic Linux commands on day 3 of learning devops course by kunal.

Source: Kunal YT

Did you find this article valuable?

Support dheerajy by becoming a sponsor. Any amount is appreciated!