1833451 Members
2994 Online
110052 Solutions
New Discussion

ls

 
SOLVED
Go to solution
Darren Murray_1
Frequent Advisor

ls

Is there anyway of doing a ls of a file and having the permissions displayed as (example)
777 instead of rwx rwx rwx filename
5 REPLIES 5
Michael Tully
Honored Contributor
Solution

Re: ls

Have a look at 'els' You can get it from here:

http://hpux.connect.org.uk/hppd/hpux/Users/els-1.48a/

There is a small section in the man page (also on this link page) called "Enhanced LS: FORMATTING" that indicates that it can be done.
I've not tried it.

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"
Anyone for a Mutiny ?
H.Merijn Brand (procura
Honored Contributor

Re: ls

Or use 'lsi', my version of ls available in the 10.20 download section on http://www.cmve.net/~merijn or https://www.beepz.com/personal/merijn

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: ls

And since that command is graved into my daily set of commands, and it did /not/ work on my new SuSE linux box (surprise) and compilation there yielded some trouble, I ended up in a perl rewrite (surprised?).

Attached

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
John Meissner
Esteemed Contributor

Re: ls

is it really that hard to translate from rwx rwx rwx to 777?

I don't think it's worth your time to try to

r=4
w=2
x=1
rwx=7
rw=6
rx=5

(i'm sure you knew that already... just wanted to reiterate)

All paths lead to destiny
Jean-Louis Phelix
Honored Contributor

Re: ls

Just for fun a very simple one ... I used it in scripts to generate chmod commands for files and dir to be recreated on another system.

#include
#include
#include

main(argc,argv)
int argc;
char *argv[];
{
struct stat bufstat;

if (stat(argv[1], &bufstat) != 0)
{
exit(1);
}
printf("chmod %o %s\n", bufstat.st_basemode, argv[1]);
exit(0);
}

Regards.
It works for me (© Bill McNAMARA ...)