Skip to content

Tip #12: Versteckte Dateien kopieren

Wie kann man alle versteckten Dateien mit den Mitteln der zsh in den Ordner foobar kopieren? Ganz einfach: cp $HOME/.*(.) /foobar.

Wie kann man auch die versteckten Ordner mit Inhalten in das Verzeichnis foobar kopieren? Auch das ist einfach: cp $HOME/.*~$HOME/(.|..)(^@) /foobar.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

Jörg Sommer on :

Wieso expandiert bei Dir . zu .. und .?
CODE:
<br />  % HOME=/tmp zsh<br />  ibook% ls -d $HOME/.</strong><br />  /tmp/.ICE-unix  /tmp/.X0-lock<br />  /tmp/.X11-unix<br />

Und fehlt dem cp nicht noch ein -r wenn es Verzeichnisse kopieren soll?

Sehr nützlich in dem Zusammenhang ist die Ergänzung von allen Dateien, sowohl verstecken als auch normalen, mit echo *(D)

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
BBCode format allowed
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Form options
cronjob