- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to display file permission
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 10:07 AM
01-28-2005 10:07 AM
how to display file permission
How do I display file permission in numeric instead of characters.
example:
From:
-rwxr-xr-x 1 oracle dba 3554 Dec 20 13:53 DataRefresh.sh
To:
755 1 oracle dba 3554 Dec 20 13:53 DataRefresh.sh
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 02:34 PM
01-28-2005 02:34 PM
Re: how to display file permission
you cannot do that. the rwx is the standard naming convention.
You can always put a wrapper around the ls command, but i do not think that would be a recommended choice.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 02:58 PM
01-28-2005 02:58 PM
Re: how to display file permission
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 03:16 PM
01-28-2005 03:16 PM
Re: how to display file permission
fmode.pl
----------------------------
#!/usr/bin/perl -w
use strict;
my $i = 0;
my $cc = 0;
while ($i <= $#ARGV && $cc == 0)
{
if (-e $ARGV[$i])
{
my $mode = (stat($ARGV[$i]))[2];
printf("%s\t%03o\n",$ARGV[$i],$mode & 777);
}
else
{
printf STDERR ("File '%s' not found.\n",$ARGV[$i]);
$cc = 2;
}
++$i;
}
exit($cc);
------------------------------------
Use it like this:
fmode.pl myfile myfile2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2005 06:19 AM
01-30-2005 06:19 AM
Re: how to display file permission
alias lll='fmode.pl'
The command lll will give you the numbers. :-)
- Bob
Ps. I don't know if the sticky bits will be translated correctly with that perl script. ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 01:05 AM
01-31-2005 01:05 AM
Re: how to display file permission
Here's an example for using it:
# getchmod /etc/group
0444 -r--r--r-- file bin:bin /etc/group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 06:40 AM
01-31-2005 06:40 AM