Hello guys! We are going to create some quick and simple knowledge articles (so as not to get bored) of things that we often already know, but at some point in an interview or selection exam, we forget, and these simple articles usually exercise our mind to fix and avoid forgetfulness. And always with more intelligent commands that will make us memorize better and better. So let’s go to 5 Useful Commands for your Linux !!!
This command displays creation data, modification date. change and other information.
chmod 0 file.txt
chmod 644 file.txt
sudo chown root file.txt
that way we change the owner and not the group, if we wanted to change the group we would also use: sudo chown root:root file.txt
Viewing again with stat
we notice that the owner and/or the group have been changed, but we realize that the group is only allowed to read (r, read), if we wanted to get that permission, we can also use either chmod
or chown
sudo chmod g-r
, for group (g) get (-) read permission (r, read), if we check the file again we will see that instead of 0644
e -rw-r–r–
and now that is: 0604/-rw—-r–
, others can still read (r–
), but if he is only part of the marcos group, his permission corresponding to the 3rd octet is ZERO 0 or -.We soon realized that 0
is -
.
Tip with image for each number the corresponding output for the octet: