Register
It is currently Fri Dec 19, 2014 6:28 am

REQ: chown all user directories


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Thu Jul 26, 2007 7:12 am   

Joined: Thu Jul 26, 2007 7:05 am
Posts: 2
I need a script which can read in all the user directory names and chown them recursively.

Something along the lines of:

for all /home/$usernames
do chown -R $username:$username /home/$username

Thanks, that would be a huge help.

Peter


Top
 Profile  
 PostPosted: Thu Jul 26, 2007 8:09 am   

Joined: Wed Jul 25, 2007 11:45 am
Posts: 11
pwestde wrote:
I need a script which can read in all the user directory names and chown them recursively.

Something along the lines of:

for all /home/$usernames
do chown -R $username:$username /home/$username

Thanks, that would be a huge help.

Peter


Code:
cd /home
for i in * ; do
  chown -R $i:$i $i
done


Top
 Profile  
 PostPosted: Thu Jul 26, 2007 8:16 am   

Joined: Thu Jul 26, 2007 7:05 am
Posts: 2
slacker_nl wrote:
Code:
cd /home
for i in * ; do
  chown -R $i:$i $i
done


Thanks slacker_nl, that's awesome.

Peter

(note to self: must learn BASH)


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP