- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Change Files Ownership
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 07:53 PM
тАО12-14-2004 07:53 PM
I know that we can use chown user2 filename but i guess this only apply to 1 file at a time, right? How can I change the ownership of multiple files together?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 07:59 PM
тАО12-14-2004 07:59 PM
Re: Change Files Ownership
chown user2 *
and, if you have any files that start with .,
chown user2 .*
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 08:01 PM
тАО12-14-2004 08:01 PM
Re: Change Files Ownership
Use 'find' command with '-user' switch.
find . -user user1 |xargs chown user2
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 08:03 PM
тАО12-14-2004 08:03 PM
Solutionrunning:
chown user2 .*
as root doesn't just change the ownership of any files beginning with a period (like .profile or .exrc) to user2. It ALSO changes the ownership of the current directory (.) AND the parent directory (..) to user2 - if this a users home area you could end up changing the ownership of the /home directory such that no-one apart from user2 can log in!
I speak from bitter experience on this (ran it on a production system with lots of users).
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 08:05 PM
тАО12-14-2004 08:05 PM
Re: Change Files Ownership
or
find thedirectory -exec chown user2 {} \;
If you want to change only the file owned by user1:
find thedirectory -user user 1 -exec chown user2 {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 08:06 PM
тАО12-14-2004 08:06 PM
Re: Change Files Ownership
I'd give you points, but it's not my thread!
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 08:23 PM
тАО12-14-2004 08:23 PM
Re: Change Files Ownership
#find /directory -user Username -print|xargs chown username:groupname