1

There is no stat command in Solaris 10. Is there any way to get numeric file permission?

4

GNU stat is available in the SUNWgnu-coreutils package. If you're not able to install that, the pkgproto command is an alternative.

From the manual page:

pkgproto /bin=bin /usr/bin=usrbin /etc=etc
   f none bin/sed=/bin/sed 0775 bin bin
   f none bin/sh=/bin/sh 0755 bin daemon
   f none bin/sort=/bin/sort 0755 bin bin
   f none usrbin/sdb=/usr/bin/sdb 0775 bin bin
   f none usrbin/shl=/usr/bin/shl 4755 bin bin
   d none etc/master.d 0755 root daemon
   f none etc/master.d/kernel=/etc/master.d/kernel 0644 root daemon
   f none etc/rc=/etc/rc 0744 root daemon

It's trivial to extract that output so that you just have the octal file permissions.

0

You can try lstat, or lstat64 if it is a 64-bit machine.

  • I believe the question related to the stat command and not the stat system call. lstat and lstat64 are system calls, not commands. – mjturner Jul 13 '15 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.