Linux read file permissions
Hi,
Is there a Linux command, or a series of commands, which will allow me to get the permissions of a file in "0644" format? Thanks, Adrien |
Code:
chmod Code:
man chmod |
While your response has a remote relationship to my inquiry it
doesn't really cover my question at all. The correct command is: Code:
stat -c 0%a /etc/passwd |
Quote:
Second, you asked how to change the permissions on a file, and that is exactly what the command chmod is for. So you should better learn to ask smart questions, maybe you will get the answers you want. Reported. |
Indeed. That could have been worded in a more constructive way;
see my edited version above as a guideline. Cheers, Tink |
Quote:
|
The command
Quote:
|
Unintentional double post
|
Quote:
found a solution, using 'stat'. |
Quote:
Code:
stat -c 0%a /etc/passwd prepend ANY permission string w/ a 0, so if the file in question, e.g. were a setgid directory, your version would print: Code:
stat -c0%a FILENAME I think what you really want is: Code:
stat -c %a FILENAME | xargs printf "%04d\n" Cheers, Tink P.S.: Note how I didn't call you useless? ;} |
All times are GMT -5. The time now is 07:15 AM. |