Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

darakok

macrumors newbie
Original poster
Jul 21, 2010
23
0
Dear mac users,

My mac is running latest version of snowleopard. From the terminal windows, I want to read a foder content. even though i use the sudo command, i still get empty result.

the permission setting from the "ls -l" command, only the owner and group member can read it.

So i want to know if there is a way that root user can read this foder content without becoming member of the group.

Thanks,

dara kok
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
Dear mac users,

My mac is running latest version of snowleopard. From the terminal windows, I want to read a foder content. even though i use the sudo command, i still get empty result.

the permission setting from the "ls -l" command, only the owner and group member can read it.

So i want to know if there is a way that root user can read this foder content without becoming member of the group.

Thanks,

dara kok

Could you temporarily give everyone permission to read the folder (and its contents) using the chmod command?
 

darakok

macrumors newbie
Original poster
Jul 21, 2010
23
0
<quote>
Could you temporarily give everyone permission to read the folder (and its contents) using the chmod command?</quote>

Yes, that's the first solution that came to my mind. But as a root, it suppose to be able to read any folder. that's why I'm asking if there is an alternative way.

Thanks for your comment.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
<quote>
Could you temporarily give everyone permission to read the folder (and its contents) using the chmod command?</quote>

Yes, that's the first solution that came to my mind. But as a root, it suppose to be able to read any folder. that's why I'm asking if there is an alternative way.

Thanks for your comment.

Questions:

What do you mean by "be able to read the folder"? Do you mean "be able to list the contents of the folder"?

What happens if you enter

Code:
ls -l path-to-folder-here
?

What is the output from

Code:
ls -l path-to-folder-here/../
?

Would using sudo -u or sudo -g do what you want?
 

darakok

macrumors newbie
Original poster
Jul 21, 2010
23
0
that's what i'm looking for

Thank LPZ, sudo -g or sudo -u

that's what i want to be able to use another user credential to list the folder content.

Thanks alot. Christmas is coming. Wish u a great holiday.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.