Sponsored Content
Top Forums Shell Programming and Scripting Working with multiple home directories. Post 302195770 by trey85stang on Friday 16th of May 2008 12:01:29 AM
Old 05-16-2008
Working with multiple home directories.

I need to rename a directory in every home directory on a given workstation. I am a newb to scripting so maybe thats why I cant exactly figure out how to correctly do this.

The first thing I need to be able to do to write this script is figure out how to list all the directorys (these are not actual home directorys).

Im using solaris so that may complicate things for me.

ls -d only lists "." so that command is worthless.. for this.

find /path/to/users -type d ; somewhat works but it also lists every directory past users. I cant seem to find a way to tell it to only look in the one directory.the output is the following:

/path/to/user1
/path/to/user1/dir1
/path/to/user1/dir2
/path/to/user2/
/path/to/user2/dir1
/path/to/user2/dir2

I need to only see /path/to/user1 and /path/to/user2.

Anyone have any ideas on else I could try? Also, if it matters, Im using solaris to work on/write this script.. but the actual script will be for OSX, a post install script for an application upgrade.

Last edited by trey85stang; 05-16-2008 at 01:14 AM..
 

10 More Discussions You Might Find Interesting

1. AIX

HACMP users home directories

What would be the best approach to configure one external /home f/s in simple two node config and have concurrent access ? (1 Reply)
Discussion started by: zz2kzq
1 Replies

2. UNIX for Dummies Questions & Answers

Delete old home directories

I have a script that deletes obselete users from /etc/passwd then moves their home directories to another location. After 30 days, I need to delete the home directories that were moved to the new location. I would appreciate any ideas on how to delete the directories after the 30 days? (2 Replies)
Discussion started by: munch
2 Replies

3. Solaris

How to backup /home directories?

I know that how to backup the home directories in sun sparc server. Firstly, umount the filesystem, Secondly, fsck the filesystem, Thirdly, ufsdump the filesystem. Anybody know how to type the full command line backup the /home directory? (1 Reply)
Discussion started by: kingsan
1 Replies

4. UNIX for Dummies Questions & Answers

UNIX home directories

Hi All, Could someone help, am a complete beginner when it comes to UNIX. However I have been tasked with investigating automatic creation of UK unix home directories. Is someone able to help? Thanks in advance! (7 Replies)
Discussion started by: zainster
7 Replies

5. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

6. Shell Programming and Scripting

List /home directories in a file

Hi, i was looking at a unix paper i found and one of the tasks was to create a file called 'usernames' that contains a list of all directories in /home. This file should be located in the /home/userinfo directory. How would i go about doing this without changing directories from the home... (2 Replies)
Discussion started by: warlock129
2 Replies

7. UNIX for Dummies Questions & Answers

home directories not being created by useradd

greetings. I'm using debian lenny, bash shell environment. It is my understanding that by default, the useradd command should create subdirectories under the /home directory, with the same name as the user being created, but this is not happening. I checked useradd -D and it showed, among... (2 Replies)
Discussion started by: fguy
2 Replies

8. Shell Programming and Scripting

cp -p /home/* home/exp/*.date not working please help

:( ---------- Post updated at 01:51 AM ---------- Previous update was at 01:50 AM ---------- Not working ---------- Post updated at 02:04 AM ---------- Previous update was at 01:51 AM ---------- cp -p /home/* home/exp/*.`date` i am using this (4 Replies)
Discussion started by: rishiraaz
4 Replies

9. HP-UX

Home directories in packages

Hi, At my new company they use HP-UX on all the servers. They use Serviceguard to provide different packages, which are treated as if they where seperate systems. Therefore people log into packages instead of Host, and even the home directories live in the package. Now there are a different... (4 Replies)
Discussion started by: michas
4 Replies

10. UNIX for Dummies Questions & Answers

Deleting multiple directories inside multiple directories

Hi, Very unfamiliar with unix/linux stuff. Our admin is on vacation so, need help very quickly. I have directories (eg 40001, 40002, etc) that each have one subdirectory (01). Each subdir 01 has multiple subdirs (001, 002, 003, etc). They are same in each dir. I need to keep the top and... (7 Replies)
Discussion started by: kkouraus1
7 Replies
quota(1M)						  System Administration Commands						 quota(1M)

NAME
quota - display a user's ufs file system disk quota and usage SYNOPSIS
quota [-v] [username] DESCRIPTION
quota displays users' ufs disk usage and limits. Only the super-user may use the optional username argument to view the limits of other users. quota without options only display warnings about mounted file systems where usage is over quota. Remotely mounted file systems which do not have quotas turned on are ignored. username can be the numeric UID of a user. OPTIONS
-v Display user's quota on all mounted file systems where quotas exist. USAGE
See largefile(5) for the description of the behavior of quota when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). FILES
/etc/mnttab list of currently mounted filesystems ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
edquota(1M), quotaon(1M), quotacheck(1M), repquota(1M), rquotad(1M), attributes(5), largefile(5) NOTES
quota will also display quotas for NFS mounted ufs-based file systems if the rquotad daemon is running. See rquotad(1M). quota may display entries for the same file system multiple times for multiple mount points. For example, quota -v user1 may display identical quota information for user1 at the mount points /home/user1, /home/user2, and /home/user, if all three mount points are mounted from the same file system with quotas turned on. SunOS 5.10 17 Dec 1998 quota(1M)
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy