I want to move all files in a specific folder of size 0 bytes. I know that the following prints all files the size of zero bytes.
find /home/Desktop/ -size 0
But I want to move them to another folder, so I tried:
find /home/Desktop/ -size 0 | xargs -0 mv /home/Desktop/a
But this does not work.? Is there any other way to do this? What am I doing wrong?
You can do this using the function -exec:
-exec
find /home/Desktop/ -size 0 -exec mv '{}' /home/Desktop/a \;
find default , . -print0 , . -0 of xargs , .
find
-print0
-0
xargs
find /home/Desktop/ -size 0 -print0 | xargs -0 -I {} mv {} /home/Desktop/a
find -exec
find -type f, -maxdepth 1, , descend. , !
-type f
-maxdepth 1
Source: https://habr.com/ru/post/1524831/More articles:Why is x () == a window if var x = [] .reverse? - javascriptswitch statement - string vs int - javascriptTesting image processing routines with robolectric - androidΠ½Π΅ ΠΌΠΎΠΆΠ΅Ρ ΠΈΠΌΠΏΠΎΡΡΠΈΡΠΎΠ²Π°ΡΡ ΠΈΠΌΡ get_user_model - pythonClojure: is there a `fn` special character, macro, or special form? - clojureDigest not generated after compiling assets - ruby-on-railsHow to decode golang url.QueryEscape data in javascript? - javascriptJava - Π½Π΅ Π²ΠΈΠΆΡ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ Π² ΠΎΡΠ»Π°Π΄ΠΊΠ΅ Π±Π΅Π· ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ Π΄ΠΎ - compiler-constructionCollecting system data from an iOS device during automated testing - iosΠΠ°ΠΊ ΠΏΠ΅ΡΠ΅Π΄Π°ΡΡ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ ΠΈΠ· ΠΎΠ΄Π½ΠΎΠ³ΠΎ Google-Apps- Script Π² Π΄ΡΡΠ³ΠΎΠΉ ΠΈ Π²ΡΠΏΠΎΠ»Π½ΠΈΡΡ? - google-apps-scriptAll Articles