Quantcast
Channel: Find and move with exclude - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 5 View Live

Answer by Gilles for Find and move with exclude

It's generally a bad idea to parse the output of ls or find, because you can't distinguish which characters are part of a file name and which characters are separators. If you don't control the file...

View Article



Answer by AntumDeluge for Find and move with exclude

Using "find" command: find ./*.xml -type f ! -name "deposit.xml" -exec mv {} ./Archive ';' Using "find" with "xargs" command: find ./*.xml -type f ! -name "deposit.xml" | xargs -I {} mv {} ./Archive...

View Article

Answer by Renjith for Find and move with exclude

find . ! -name "deposit.xml" -name "*.xml" -exec mv {} ./temp \; find has -exec option using which we can execute commands with the result file as operand and use '! -name' option to exclude file.

View Article

Answer by YoMismo for Find and move with exclude

And the problem is that you don't want to display the error message or that you don't want the command being run if there are no .xml? In the first case redirect output 2>/dev/null and no error...

View Article

Find and move with exclude

I need to use find and mv together requirement : Need to find all file *.xml but exclude deposit.xml and move it to another folder ( fairly simple) My attempt : mv `find ./*.xml '!' -type d | fgrep -v...

View Article

Browsing latest articles
Browse All 5 View Live




Latest Images