chmod command is used to change the permissions of files or directories. In this tutorial, I will get
For example, Check Linux file and folder permissions with the ls command as below
[vagrant@app1 ~]$ ls -l /home/vagrant/*
-rw-rw-r--. 1 vagrant vagrant 64 Feb 26 15:30 /home/vagrant/a
-rwxrwxr-x. 1 vagrant vagrant 241 Dec 10 15:31 /home/vagrant/bashscript.sh
-rw-rw-r--. 1 vagrant vagrant 3327 Nov 13 12:07 /home/vagrant/id_rsa
-rw-rw-r--. 1 vagrant vagrant 439 Feb 26 15:30 /home/vagrant/lastmodifyofifle.sh
Using stat command as below
[vagrant@app1 ~]$ stat --format='%a %U:%G %n' /home/vagrant/*
The result as below
664 vagrant:vagrant /home/vagrant/a
775 vagrant:vagrant /home/vagrant/bashscript.sh
664 vagrant:vagrant /home/vagrant/id_rsa
664 vagrant:vagrant /home/vagrant/lastmodifyofifle.sh
You make it 🙂
Conclusion
You have to get permission of chmod as numerical value on Linux. I hope will this your helpful. Thank you for reading the DevopsRoles page!