how to display the permission of the home directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to display the permission of the home directory
# 1  
Old 04-14-2008
how to display the permission of the home directory

can anyone tell me how to display the permissions of a users home directory.
can i use ls -l but it only gives the permissions of the files and directories inside the directory..SmilieSmilieSmilieSmilie
# 2  
Old 04-14-2008
please reply anyone!!!Smilie
# 3  
Old 04-14-2008
what about ls -al?
# 4  
Old 04-14-2008
Try...
Code:
ls -lapd ~

Please note that "bumping-up" posts is against the rules.
# 5  
Old 04-14-2008
guys this is what i wanted to do.. when i run this script i am actually typing a username and script will display the permissions of that users home directories..this what i got so far but it doesnt't work

ls -ld grep $1 /etc/passwd | cut -d: -f6

and i also want to have an output which is in English language string that this directory has read, Write permissions for user read execute for the group and etc etc..hope you know what i mean
# 6  
Old 04-14-2008
Try this.
Code:
awk -v v=$1 -F: '$1==v {print $6}' /etc/passwd | ls -ld

Regards
# 7  
Old 04-14-2008
Quote:
Originally Posted by danmero
Try this.
Code:
awk -v v=$1 -F: '$1==v {print $6}' /etc/passwd | ls -ld

Regards
doesnt workSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies

2. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies

3. Red Hat

Mkdir: cannot create directory `/home/phpmy/html': Permission denied centos

for incompatibility installation problems, I've decided to reinstall Centos 6.3 as can be seem from the df output, I've partitioned both / and and /home directories $ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda8 12G 5.3G 6.5G 45% / tmpfs ... (2 Replies)
Discussion started by: jediwannabe
2 Replies

4. BSD

FreeBSD abnormal permission changes in /home

Hi, I have a bit of a headache with a server doing some rather mysterious yet static changes to permissions in /home. The server in question is a FreeBSD server. It's an older beast with quite a few custom tweaks and now I'm stuck with it :-) The problem is that some of the directories in... (2 Replies)
Discussion started by: brightstorm
2 Replies

5. HP-UX

could not able change permission of /home dir

Hi i am new to this admin area . i have created user with name as "ab" and gave home dir as /home/ab . when i tried to create the /home/ab dir , i got he following error. "mkdir: Failed to make directory "/home/ab"; Operation not applicable " Thanks in advance . (1 Reply)
Discussion started by: expert
1 Replies

6. UNIX for Advanced & Expert Users

about the access permission of users home directory

RHEL5.0 As we know, when root create a new user, a new home directory will be created : /home/user I want to know what determine the access permission of /home/user . Thanks! (1 Reply)
Discussion started by: cqlouis
1 Replies

7. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

8. UNIX for Dummies Questions & Answers

Root cannot change /home permission

Folks; I'm a root but i couldn't change /home directory permission or group. i'm getting operation not permitted. Any help? (6 Replies)
Discussion started by: moe2266
6 Replies

9. UNIX for Advanced & Expert Users

ssh home directory permission

Hi All, I am using sftp to transfer files between two unix machines. As per my knowledge, in order to use public key authentication, the remote user's home directory permission should be set to 750 ( basically group and others should not have write permission ). Is there any way to over ride... (1 Reply)
Discussion started by: shihabvk
1 Replies
Login or Register to Ask a Question