Discussion in 'Beginner Tutorials' started by Rob, Jul 9, 2013.
the link says it all!
I hope that helps. Explaining to people how a folder is executable is hard to explain.
thank u..u made it very simple for me
If you want a bit more information than ls -l file/directory provides, you can use the command stat. Lets say i have a file called file1.txt:
ls -l file1.txt
-rw-r--r-- 1 username username 71 Mar 24 20:45 file1.txt
Size: 71 Blocks: 24 IO Block: 4096 regular file
Device: 14h/20d Inode: 6029568 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/username) Gid: ( 1000/username)
Access: 2014-03-24 21:37:49.826768784 +0000
Modify: 2014-03-24 21:50:23.618789336 +0000
Change: 2014-03-24 21:50:23.618789336 +0000
As you can see stat gives more detail, including the numeric 'chmod' value: 0644
Handy if you want to check the corresponding numeric value permission of a file or directory!
ls -l file1.txt
I wanted to know if we can check when the permission of a directory got changed in Linux?
By ls -l directory_name , you can check permission of directory.
Thanks!! but I want to know the time the directory permissions got changed.
You can see the bash history with time stamp by the following command
HISTTIMEFORMAT="%d/%m/%y %T "
and then type 'history'
To see your modifications you can use grep.
history | grep directory_name
Now you can see all the modifications made through terminal.
I love your answers. Thanks!
You all are welcome
I am using Ubuntu and Windows 7 on a same machine. Just install Ubuntu on your Windows OS. You will see dual boot option at the time of startup.
ps: You can install both OS in same directory
Hi Rob, really good explanation. I liked it...
Thanks for the lesson ... time to practice!!
Another fancy but simple way of assigning permission like chmod 777 is
chmod ugo+rwx filename
This means all permissions are granted to all.
where u=user, g=group and 0=others
Also r=read, w=write and x=execute.
You can assign individual permisions like;
chmod u+r filename
This means only the user is given that read permission to that file/directory.
If you want to remove a permision you can say
chmod u-r filename
This means the user no longer has read permission i.e. "-" removes while "+" adds permission(s).
In case of directories/folder, if you want the permissions to be recurring use "-R" option then the permissions will apply to everything in that directorye.g
chmod -R ugo+rwx directory_name
Kundal, thank you for the instructions. These are simple and explicit instructions.
thanks, excellent info for newbies, very concise
Excellent explanation of chmod...this helped me a lot: specifically I thought it was decimal.
Separate names with a comma.