- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Change ownership, chmod?
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
Forums
Discussions
Discussions
Discussions
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
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
10-05-2004 12:41 AM
10-05-2004 12:41 AM
Change ownership, chmod?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2004 12:46 AM
10-05-2004 12:46 AM
Re: Change ownership, chmod?
find -user apple | xargs chown pear {};
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2004 12:49 AM
10-05-2004 12:49 AM
Re: Change ownership, chmod?
What you are trying to do can be done with a single command. That would as follows.
find . -user apple -type f -exec chown pear {} \;
This would change the ownership of all files to pear. The following command would change the ownership of all directories to pear.
find . -user apple -type d -exec chown pear {} \;
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2004 12:49 AM
10-05-2004 12:49 AM
Re: Change ownership, chmod?
should be:
find / -user apple | xargs chown pear {}
Rgds.....Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2004 02:20 AM
10-05-2004 02:20 AM
Re: Change ownership, chmod?
So for the below command:
find / -user apple | xargs chown pear {}
Will it changes the directory ownership as well?
I would like to change the ownership of the directories and files. Would just one command be able to do all these? thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2004 02:30 AM
10-05-2004 02:30 AM
Re: Change ownership, chmod?
Do either of these to get files and directories, except in the find without the pipe to xargs, strip off the '-type' flag for the find command. It does entire heirarchy by default.
John
(You could just do a find '/ -user apple' to get the list first, if you want to verify...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2004 02:31 AM
10-05-2004 02:31 AM
Re: Change ownership, chmod?
Just a thought - another option you have - is to delete user apple, then create user pear with apple's old uid.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2004 02:34 AM
10-05-2004 02:34 AM
Re: Change ownership, chmod?
find / -user
will give all files who owner is
To change that permission to pear then,
find / -user apple -type f "*" -exec chown pear {} \;
If you want to change directory too then,
find / -user apple \( -type f -o type d \) -exec chown pear {} \;
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 12:34 AM
10-06-2004 12:34 AM
Re: Change ownership, chmod?
Would the orange account be able to access all the files and directories that are previously from apple account?
What are the things to take note when changing of ownership? thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 12:55 AM
10-06-2004 12:55 AM
Re: Change ownership, chmod?
Now, here's another tip - if apple and orange belong to the same group - say orchard, and the permissions on the file(s)/directory(s) are 664 or 775, then both apple and orange will have write access to the file(s)/directory(s).
Things to take note are - any scripts that say "su - apple -c "some command" will have to be change to su - orange.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 02:00 AM
10-06-2004 02:00 AM