Posts mit dem Label commands werden angezeigt. Alle Posts anzeigen
Posts mit dem Label commands werden angezeigt. Alle Posts anzeigen

Sonntag, 11. Dezember 2011

List only symbolic links in current directory

find . -type l -exec ls -la {} \;

Got to say that here: find with -exec param is sooooo mighty!

Mittwoch, 7. Dezember 2011

Copy files recursively without keeping directory structure (Linux)

We had to copy many files that were located in a very complex directory structure. The following snippet searches the current directory and its subdirectories for *.xml files & executes the cp command on every file it finds (the braces {} represent the file):

find -type f -iname '*.xml' -exec cp {} /target/dir/for/all/xmls/ \;

The target dir now contains all *.xml files without directories.