The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding Multiple Lines to Multiple Files dayinthelife Shell Programming and Scripting 2 06-04-2008 08:50 AM
Splitting input files into multiple files through AWK command arund_01 Shell Programming and Scripting 3 05-13-2008 06:17 AM
Multiple search in multiple files maxvirrozeito Shell Programming and Scripting 2 12-13-2007 09:32 AM
when I try to run rm on multiple files I have problem to delete files with space umen UNIX for Dummies Questions & Answers 1 09-20-2005 12:20 AM
Searching multiple files with multiple expressions Anahka Shell Programming and Scripting 6 01-07-2004 02:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-16-2005
Registered User
 

Join Date: Jul 2005
Posts: 2
Stumble this Post!
CHOWN Multiple Files

We have a test and training directory. The test is a copy of training. We need to change the ownership and group for a list of specific files from the training directory. Is there a way to feed the CHOWN command the list of files we need changed? We are performing the CHOWN as root. Thanks in Advance.

Last edited by Teganii; 08-16-2005 at 09:01 AM.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-16-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Stumble this Post!
Code:
chown -R user:group training
Reply With Quote
  #3 (permalink)  
Old 08-16-2005
Registered User
 

Join Date: Jul 2005
Posts: 2
Stumble this Post!
I guess I'm not making myself too clear. The specific files in the training directory have different owners. I have created a list of the files in the training directory that I need to have the ownership changed in the test directory. It's getting that list of files into CHOWN that I'm having the issue with. I tried chown user:group < file_list with no luck. I'm just getting into the UNIX so my learning curve has been VERY steep.
Reply With Quote
  #4 (permalink)  
Old 08-16-2005
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 923
Stumble this Post!
Maybye something more like
Code:
chown user:group `cat list_of_files`
Note that those are backticks, not ordinary single quotes -- same key as ~ but without shift. What it does is execute the command inside it and convert it's output into text, so it would print the contents of the file and convert them into a string which it feeds as commandline parameters into chown.
Reply With Quote
  #5 (permalink)  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 1
Stumble this Post!
Worked perfectly for me.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0