I created a command to remove all leading spaces of all folder / file names in a directory (with subdirectories).
find /dir/* -depth -execdir rename 's/^\s+//g' * "{}" \;
It works in some small directories (with some subdirectories), but for large directories it lasted a lot . I see that the command takes longer to complete than necessary, but I don’t know why.
Can anyone suggest how to speed it up?
/ edit: I use Debian 8.2 as an OS.
, , -execdir find. rename , , . rename *, N rename N ^ 2. (+1 "{}", find.)
-execdir
find
rename
*
"{}"
, rename - *. , "{}".
, ( ):
-regex
+
;
./
, / , rename * . Gut, , , , .
rename *
(, -!)
Source: https://habr.com/ru/post/1621357/More articles:Is it possible to make Emm Monad in Clojure? - scalaNode.js load file into buffer instead of / tmp - node.jsЧто означает "входной файл компоновщика не используется, потому что ссылка не выполнена" означает? (C makefile) - cPass variables from python file to robot structure variables - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1621356/eclipse-jar-in-jar-fails-to-find-a-jodatime-class&usg=ALkJrhi9yeb0skEByC0Xe7xJTFHJWN1ejAHow to import js files dynamically at compile time as input for browser? - javascriptLearning to read and write recursively - recursionКак создать for-loops с jq в bash - bashHow can I execute jq nested for-loops from bash? - bashResponsive Android PushNotifications - androidAll Articles