![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change multiple filename formats with WHILE | ScKaSx | UNIX for Dummies Questions & Answers | 5 | 02-27-2008 03:11 PM |
| rsh to change multiple ip in multiple servers? | kenshinhimura | Shell Programming and Scripting | 2 | 02-17-2008 11:04 PM |
| a bit tricky to change it multiple rows in one row and ... | netbanker | Shell Programming and Scripting | 2 | 12-31-2007 09:48 PM |
| I am the owner,yet not allowed the change the ownership | MSHETTY | UNIX for Dummies Questions & Answers | 8 | 09-25-2007 08:08 PM |
| How do I change ownership of a directory and all of it's files. | mborin | UNIX for Dummies Questions & Answers | 1 | 02-25-2001 02:24 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
change multiple ownership
Good afternoon,
Sir's, i owuld like to search for some advice, whats the fastest way to change multiple files ownership. For HostnameA will be their basis, for what ever files and permissions that hostnameA has, it should replicate the permissions and ownership to hostname B. $hostname hostnameA $ pwd /home/tester $ ls -l total 112 drwxr--r-- 3 root staff 256 Jan 03 17:18 a drwxr-xr-x 2 tester staff 256 Jan 16 12:03 aa -rwxr--r-- 1 tester staff 398 Jan 02 15:10 awksol.sh $cd aa /home/tester/aa total 32 -rw-r--r-- 1 tester staff 189 Jan 16 11:37 a -rw-r--r-- 1 tester staff 125 Jan 16 12:03 addd -rw-r--r-- 1 tester staff 186 Jan 16 11:36 b $hostname hostnameB $ pwd /home/agent $ ls -l total 112 drwxr--r-- 3 root staff 256 Jan 03 17:18 a drwxr-xr-x 2 agent staff 256 Jan 16 12:03 aa -rwxr--r-- 1 root staff 398 Jan 02 15:10 awksol.sh -rwxr--r-- 1 root staff 398 Jan 02 15:10 searcher.sh $cd aa /home/agent/aa total 32 -rw-r--r-- 1 root staff 189 Jan 16 11:37 a -rw-r--r-- 1 root staff 125 Jan 16 12:03 addd -rw-r--r-- 1 agent staff 186 Jan 16 11:36 b -rw-r--r-- 1 testing staff 186 Jan 16 11:36 tryout output : $hostname HostnameB total 112 drwxr--r-- 3 root staff 256 Jan 03 17:18 a drwxr-xr-x 2 tester staff 256 Jan 16 12:03 aa -rwxr--r-- 1 tester staff 398 Jan 02 15:10 awksol.sh $cd aa /home/tester/aa total 32 -rw-r--r-- 1 tester staff 189 Jan 16 11:37 a -rw-r--r-- 1 tester staff 125 Jan 16 12:03 addd -rw-r--r-- 1 tester staff 186 Jan 16 11:36 b |
| Forum Sponsor | ||
|
|
|
|||
|
I don't know what is the problem but you could try tar'ring the files including permissions and then uncompressing them with option "-p" if I remember it.
If this cannot be used and you want to make it on your own, and this is going ot be made trough some script, then I cannot see any other way than just displaying "ls" in some formatted way and then iterating trough the items with chown. Note that this can be dangerous (especially because you are running this as root) |
|||
| Google UNIX.COM |