[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
On 28-04-2010 22:35, Verner Kjærsgaard wrote: > > Per Kofod skrev: > >> On 28-04-2010 21:35, Verner Kjærsgaard wrote: >> >>> - tænk jeg ved ikke det her...sorry >>> - det er sikkert indlysende, ok, here goes... >>> >>> Jeg har brug for at vide, hvorledes man kopierer dot-directories fra et >>> sted til et andet (recursivt). Altså eksempelvis >>> >>> kopier -Rp .mozilla /tmp/somewhere >>> >>> Det virker fint, men nu vil jeg jo gerne kopiere en bunke dot >>> biblioteker samtidigt... >>> >>> Denne konstruktion her virker jo ikke: >>> >>> cp -Rp .* /tmp/dot >>> >>> - fordi det indledende punktum i den her sammenhæng jo af bash >>> oversættes til 'dette bibliotek'. >>> - så det gælder vel om at få det indledende dot 'escaped' på en eller >>> anden måde. >>> >>> Alle ideer er velkomne. >>> >>> >>> >>> >> cp -Rp .?* /tmp/dot >> >> Per >> >> > - tak for alle svar - men hvis i prøver det, vil i se, at det ikke > funker...helt. Ovennævnte medtager også selve det bibliotek, indefra > hvilket kommandoen gives... > > > hvis du bruger '.*' , betyder det medtag . + 0 eller flere karekterer, og current directory er jo netop '.'. det er derefor du bruger '.?*' da ? matcher præcis 1 karakter, så betyder det . + 1 eller flerer karakterer, og . (eller current directory) medtages ikke. og da . ikke matches af ? medtages heller '..' som er parrent directory. Som root kan det muligvis værenødvendigt at bruge .??* for ikke at matche '..' Dette virker, jeg har brugr det 100vis af gange. tux2:~ # ll total 4152 -rw------- 1 root root 0 Feb 17 15:36 .ICEauthority -rw------- 1 root root 153 Feb 17 16:17 .Xauthority drwx------ 3 root root 4096 Jan 21 13:18 .adobe -rw------- 1 root root 3959 Apr 8 09:26 .bash_history drwx------ 2 root root 4096 Jan 21 10:31 .cache drwxr-xr-x 5 root root 4096 Jan 21 10:47 .config drwx------ 3 root root 4096 Jan 21 10:31 .dbus -rw------- 1 root root 26 Jan 21 10:31 .dmrc -rw------- 1 root root 16 Jan 21 12:50 .esd_auth -rw-r--r-- 1 root root 1332 Nov 23 2005 .exrc drwx------ 3 root root 4096 Feb 17 16:16 .gconf drwx------ 2 root root 4096 Feb 17 16:17 .gconfd drwx------ 3 root root 4096 Jan 21 12:48 .gnome2 drwx------ 2 root root 4096 Jan 21 12:48 .gnome2_private drwx------ 3 root root 4096 Feb 23 09:25 .gnupg drwx------ 3 root root 4096 Feb 17 15:36 .google drwx------ 2 root root 4096 Jan 21 10:31 .gvfs drwx------ 2 root root 4096 Jan 21 12:51 .icedteaplugin -rw-r--r-- 1 root root 0 Jan 21 15:08 .javafx_eula_accepted drwxr-xr-x 2 root root 4096 Jan 21 10:27 .kbd drwx------ 3 root root 4096 Feb 17 15:36 .kde drwx------ 4 root root 4096 Jan 21 12:49 .kde4 drwx------ 3 root root 4096 Jan 23 23:49 .kdm drwxr-xr-x 3 root root 4096 Jan 21 10:31 .local drwx------ 3 root root 4096 Jan 21 13:18 .macromedia drwx------ 4 root root 4096 Jan 21 12:48 .mozilla -rw------- 1 root root 0 Jan 21 12:45 .mysql_history drwxr-xr-x 7 root root 4096 Jan 21 15:10 .nbi drwxr-xr-x 2 root root 4096 Jan 21 15:09 .netbeans drwxr-xr-x 3 root root 4096 Jan 21 15:09 .netbeans-registration drwx------ 2 root root 4096 Jan 21 10:31 .pulse -rw------- 1 root root 256 Jan 21 10:31 .pulse-cookie drwxr-xr-x 2 root root 4096 Feb 17 15:36 .qt drwxr-xr-x 2 root root 4096 Jan 21 10:31 .skel -rw------- 1 root root 1072 Feb 17 16:14 .viminfo drwxr-xr-x 2 root root 4096 Feb 17 15:36 .wapi drwxr-xr-x 2 root root 4096 Mar 30 16:43 .wireshark -rw------- 1 root root 49 Feb 18 11:17 .xauthB8BTTX -rw------- 1 root root 49 Feb 16 14:44 .xauthiG85h0 drwxr-xr-x 2 root root 4096 Jan 21 10:31 .xine -rw------- 1 root root 9872 Feb 17 16:17 .xsession-errors drwxr-xr-x 2 root root 4096 Jan 21 15:07 Desktop drwxr-xr-x 2 root root 4096 Jan 21 10:31 Documents drwxr-xr-x 2 root root 4096 Jan 21 10:31 Download drwxr-xr-x 2 root root 4096 Jan 21 10:31 Music drwxr-xr-x 2 root root 4096 Jan 21 10:31 Pictures drwxr-xr-x 2 root root 4096 Jan 21 10:31 Public drwxr-xr-x 2 root root 4096 Jan 21 10:31 Templates drwxr-xr-x 2 root root 4096 Jan 21 10:31 Videos tux2:~ # ll total 4152 -rw------- 1 root root 0 Feb 17 15:36 .ICEauthority -rw------- 1 root root 153 Feb 17 16:17 .Xauthority drwx------ 3 root root 4096 Jan 21 13:18 .adobe -rw------- 1 root root 3959 Apr 8 09:26 .bash_history drwx------ 2 root root 4096 Jan 21 10:31 .cache drwxr-xr-x 5 root root 4096 Jan 21 10:47 .config drwx------ 3 root root 4096 Jan 21 10:31 .dbus -rw------- 1 root root 26 Jan 21 10:31 .dmrc -rw------- 1 root root 16 Jan 21 12:50 .esd_auth -rw-r--r-- 1 root root 1332 Nov 23 2005 .exrc drwx------ 3 root root 4096 Feb 17 16:16 .gconf drwx------ 2 root root 4096 Feb 17 16:17 .gconfd drwx------ 3 root root 4096 Jan 21 12:48 .gnome2 drwx------ 2 root root 4096 Jan 21 12:48 .gnome2_private drwx------ 3 root root 4096 Feb 23 09:25 .gnupg drwx------ 3 root root 4096 Feb 17 15:36 .google drwx------ 2 root root 4096 Jan 21 10:31 .gvfs drwx------ 2 root root 4096 Jan 21 12:51 .icedteaplugin -rw-r--r-- 1 root root 0 Jan 21 15:08 .javafx_eula_accepted drwxr-xr-x 2 root root 4096 Jan 21 10:27 .kbd drwx------ 3 root root 4096 Feb 17 15:36 .kde drwx------ 4 root root 4096 Jan 21 12:49 .kde4 drwx------ 3 root root 4096 Jan 23 23:49 .kdm drwxr-xr-x 3 root root 4096 Jan 21 10:31 .local drwx------ 3 root root 4096 Jan 21 13:18 .macromedia drwx------ 4 root root 4096 Jan 21 12:48 .mozilla -rw------- 1 root root 0 Jan 21 12:45 .mysql_history drwxr-xr-x 7 root root 4096 Jan 21 15:10 .nbi drwxr-xr-x 2 root root 4096 Jan 21 15:09 .netbeans drwxr-xr-x 3 root root 4096 Jan 21 15:09 .netbeans-registration drwx------ 2 root root 4096 Jan 21 10:31 .pulse -rw------- 1 root root 256 Jan 21 10:31 .pulse-cookie drwxr-xr-x 2 root root 4096 Feb 17 15:36 .qt drwxr-xr-x 2 root root 4096 Jan 21 10:31 .skel -rw------- 1 root root 1072 Feb 17 16:14 .viminfo drwxr-xr-x 2 root root 4096 Feb 17 15:36 .wapi drwxr-xr-x 2 root root 4096 Mar 30 16:43 .wireshark -rw------- 1 root root 49 Feb 18 11:17 .xauthB8BTTX -rw------- 1 root root 49 Feb 16 14:44 .xauthiG85h0 drwxr-xr-x 2 root root 4096 Jan 21 10:31 .xine -rw------- 1 root root 9872 Feb 17 16:17 .xsession-errors drwxr-xr-x 2 root root 4096 Jan 21 15:07 Desktop drwxr-xr-x 2 root root 4096 Jan 21 10:31 Documents drwxr-xr-x 2 root root 4096 Jan 21 10:31 Download drwxr-xr-x 2 root root 4096 Jan 21 10:31 Music drwxr-xr-x 2 root root 4096 Jan 21 10:31 Pictures drwxr-xr-x 2 root root 4096 Jan 21 10:31 Public drwxr-xr-x 2 root root 4096 Jan 21 10:31 Templates drwxr-xr-x 2 root root 4096 Jan 21 10:31 Videos drwxr-xr-x 5 root root 4096 Jan 21 10:01 inst-sys -rw-r--r-- 1 root root 4050424 Mar 31 16:59 oldflashplugins.tar.gz drwxr-xr-x 5 root root 4096 Jan 21 10:01 inst-sys -rw-r--r-- 1 root root 4050424 Mar 31 16:59 oldflashplugins.tar.gz tux2:~ # mkdir /tmp/dottest tux2:~ # cp -Rp .??* /tmp/dottest tux2:~ # ll /tmp/dottest total 160 -rw------- 1 root root 0 Feb 17 15:36 .ICEauthority -rw------- 1 root root 153 Feb 17 16:17 .Xauthority drwx------ 3 root root 4096 Jan 21 13:18 .adobe -rw------- 1 root root 3959 Apr 8 09:26 .bash_history drwx------ 2 root root 4096 Jan 21 10:31 .cache drwxr-xr-x 5 root root 4096 Jan 21 10:47 .config drwx------ 3 root root 4096 Jan 21 10:31 .dbus -rw------- 1 root root 26 Jan 21 10:31 .dmrc -rw------- 1 root root 16 Jan 21 12:50 .esd_auth -rw-r--r-- 1 root root 1332 Nov 23 2005 .exrc drwx------ 3 root root 4096 Feb 17 16:16 .gconf drwx------ 2 root root 4096 Feb 17 16:17 .gconfd drwx------ 3 root root 4096 Jan 21 12:48 .gnome2 drwx------ 2 root root 4096 Jan 21 12:48 .gnome2_private drwx------ 3 root root 4096 Feb 23 09:25 .gnupg drwx------ 3 root root 4096 Feb 17 15:36 .google drwx------ 2 root root 4096 Jan 21 10:31 .gvfs drwx------ 2 root root 4096 Jan 21 12:51 .icedteaplugin -rw-r--r-- 1 root root 0 Jan 21 15:08 .javafx_eula_accepted drwxr-xr-x 2 root root 4096 Jan 21 10:27 .kbd drwx------ 3 root root 4096 Feb 17 15:36 .kde drwx------ 4 root root 4096 Jan 21 12:49 .kde4 drwx------ 3 root root 4096 Jan 23 23:49 .kdm drwxr-xr-x 3 root root 4096 Jan 21 10:31 .local drwx------ 3 root root 4096 Jan 21 13:18 .macromedia drwx------ 4 root root 4096 Jan 21 12:48 .mozilla -rw------- 1 root root 0 Jan 21 12:45 .mysql_history drwxr-xr-x 7 root root 4096 Jan 21 15:10 .nbi drwxr-xr-x 2 root root 4096 Jan 21 15:09 .netbeans drwxr-xr-x 3 root root 4096 Jan 21 15:09 .netbeans-registration drwx------ 2 root root 4096 Jan 21 10:31 .pulse -rw------- 1 root root 256 Jan 21 10:31 .pulse-cookie drwxr-xr-x 2 root root 4096 Feb 17 15:36 .qt drwxr-xr-x 2 root root 4096 Jan 21 10:31 .skel -rw------- 1 root root 1072 Feb 17 16:14 .viminfo drwxr-xr-x 2 root root 4096 Feb 17 15:36 .wapi drwxr-xr-x 2 root root 4096 Mar 30 16:43 .wireshark -rw------- 1 root root 49 Feb 18 11:17 .xauthB8BTTX -rw------- 1 root root 49 Feb 16 14:44 .xauthiG85h0 drwxr-xr-x 2 root root 4096 Jan 21 10:31 .xine -rw------- 1 root root 9872 Feb 17 16:17 .xsession-errors tux2:~ #
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |