- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- .snapshot
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
03-11-2008 02:43 PM
03-11-2008 02:43 PM
.snapshot
I have to chown recursively a directory and need to leave just one directory underneath it called .snapshot.
Is it possible.Is the below command right?
Thanks Much
chown -R wic /project4 -prune .snapshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2008 02:50 PM
03-11-2008 02:50 PM
Re: .snapshot
find . -name '*' | egrep -w '.snapshot' | xargs chown -R wic -
hth,
-S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2008 03:03 PM
03-11-2008 03:03 PM
Re: .snapshot
u had it right...your command should work
i have been of no help :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2008 11:17 PM
03-11-2008 11:17 PM
Re: .snapshot
There is no -prune in chown, only in find(1).
>slydmin: find . -name '*' | egrep -w '.snapshot' | xargs chown -R wic -
This is close but you need some corrections:
find /project4 | fgrep -v .snapshot | xargs chown wic
You also might be able to use ! -name .snapshot and -prune with -exec.
And this will work if not too many files:
$ cd /project4
$ chown -R wic $( ls !(.snapshot) )
>you had it right. your command should work
I don't see how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2008 10:42 AM
03-12-2008 10:42 AM
Re: .snapshot
My initial thought was, hey only find have --prune option, so I posted that xargs command, ofcourse that did not work as expected.
But "chown someuser * -prune .somedir"
actually works (after cding to the correct directory) on my system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2008 11:36 PM
03-12-2008 11:36 PM
Re: .snapshot
It doesn't work for me. -prune is just a file.
Basically I got errors because the chown were done twice for the name after -prune and I didn't own it the second time.
Besides doing the easy find | fgrep -v | xargs chown, you can work much harder:
$ find . \( ! -path "./.snapshot" -a ! -path "./.snapshot/*" \) | xargs chown ...