- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Chown multiple dot files
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
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
тАО10-18-2005 05:34 AM
тАО10-18-2005 05:34 AM
Is there a way to chown multiple dot files in a directory? Obviously, chown .* is not the way to go, but I am tired of chowing each and every dot file in a directory.
Thanks,
S
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 05:57 AM
тАО10-18-2005 05:57 AM
Re: Chown multiple dot files
can we have
# chown -R owner:group
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 05:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 05:59 AM
тАО10-18-2005 05:59 AM
Re: Chown multiple dot files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 05:59 AM
тАО10-18-2005 05:59 AM
Re: Chown multiple dot files
this will change the ownership of most every dot file in a given directory.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 05:59 AM
тАО10-18-2005 05:59 AM
Re: Chown multiple dot files
find . -type f -name '.*' -prune -exec chown owner:group {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:00 AM
тАО10-18-2005 06:00 AM
Re: Chown multiple dot files
ll | grep -v total | head -7 | awk '{print $9}'
The 7 would be the number of files in the directory that you want.
You can put that into a for-do loop or a maybe an xargs pipe.
Not so elegant, but I hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:00 AM
тАО10-18-2005 06:00 AM
Re: Chown multiple dot files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:03 AM
тАО10-18-2005 06:03 AM
Re: Chown multiple dot files
It will also chown the . files in subdirectories downstream from the current directiory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:04 AM
тАО10-18-2005 06:04 AM
Re: Chown multiple dot files
as .. (i.e. the upper directory) is found as a result of the find command, it may try to change the ownership of the files in the directory above which may wreak havoc in certain cases.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:07 AM
тАО10-18-2005 06:07 AM
Re: Chown multiple dot files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:32 AM
тАО10-18-2005 06:32 AM
Re: Chown multiple dot files
chown user1:group2 .[!.]*
As with any sweeping command using filename matching, always verify the results with a preview:
echo chown user1:group2 .[!.]*
Oops. This will not match . or .. but it does match directories and that might not be desired. In that case, use find to locate only files.
Bill Hassell, sysadmin