Tag: mv
-
How to move files starting with special chars as dashes
If it has come that you have tried to scape, enclose or do whatever to files starting with for example a dash, so as you can rename it, or copy it or scp it and didn’t find out how, this is how you can do it: mv -file-with-a-dash file-without-dash #one of the possible ways mv…
-
Move small files to separate directory in one command
Loop files under a set weight to move it to a directory. for f in `find . -iname “*.JPG” -size -500k`; do mv ${f} small; done
-
Snippet to remove caps and spaces from filename
Remove caps and spaces from names in files in current directory with tr command. First step is parse the name of the file or directory and then rename it. for f in *; do file=$(echo $f | tr A-Z a-z | tr ‘ ‘ _) [ ! -f $file ] && mv “$f” $file done