ssh - add prefix to files with rename - error argument too long -
i have thousands of files inside directory need rename adding prefix "th_" files th_65461516846.jpg can't due error "argument long"
i have used command
rename 's/^/th_/' *
thanks!
the xargs program used break command lines multiple commands avoid blowing shell line length limit. in case, you'd use:
ls | xargs rename 's/^/th_/'
which repeatedly executes rename
portion of output of ls
until list of files exhausted. aware idiom requires special attention if file names have spaces or other funny characters in them (which i'm assuming isn't based on example).
Comments
Post a Comment