Re: get file mode

[email protected] (Bob Proulx)
Newsgroups gmane.comp.gnu.fileutils.bugs
Message-ID <[email protected]>
Zanette Arrigo <[email protected]> [2002-11-25 16:14:15 +0100]:

> There is a way to get the file mode (octal or text)?

Sounds like you are looking for:

  ls -ld file | awk '{print$1}'

Putting it into a variable.

  filemode=$(ls -ld file | awk '{print$1}')

Bob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.