![]() |
Command to find file attributes
hi guys,
Is there any command or function through which i can get attributes of a file like following attributes hidden archive read etc |
Please note that it is against forum rules to cross-post. Be a real gentleman and READ the friggin' rules, wouldya?
|
Those attributes are for Windows files, not UNIX files. e.g., there is no such thing as a hidden UNIX file.
|
Using `ls -lastr` would give you a decent list of file properties. The "hidden" files in linux are typically called "dot files". If you preceed the filename with a dot (as in .fileName), it would "hide" from the default `ls` command.
The -a flag of the ls command would find all dot files, so in effect they aren't really hidden. However, you could probably effectively hide a file by prefixing the filename with nongraphic characters. Although the -b flag of `ls` would print octal escapes in the place of the nongraphic character... The use of -b is not as commonly known as -a. When in doubt, encrypt the file and change ownership and permissions. |
IF -
I disagree - you can hide unix files the way you describe but stat - which is the definitive statement about file properties -- does not have any such thing as hidden in UNIX files. Windows filesystems support that property - as well as archive, etc. I am not arguing "functionality" I'm arguing defined properties - what you did was to confuse the poor OP. IMO. I guess shell scripting includes windows/DOS bat files. There isn't a stat shell command available from standard Windows XP distributions, so that leaves UNIX :) Well, Linux stat.... Hence, the comment. |
By the way, Windows files having the archive flag means nothing. I've seen many non-archive files with it.
|
The Archive flag was created so backup utilities would know which files to back up. I don't believe it's used much in practice.
|
| All times are GMT -5. The time now is 11:23 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC