Could someone show me how to rename all files extension inside folder in sftp?
Example, I have folder "Test" in sftp and inside this folder have few files, such as, test1.tmp
, test2.tmp
….. and I want to rename all files that have extension 'tmp' to .csv. so the result after rename should be like this. test1.csv
, test2.csv
…… But in sftp not all bash command that can execute.
I tried like this already
find . -name "*.tmp" -exec rename 's/\.tmp$/.csv/' '{}' \;
but it say Invalid Command, seem command find no working in sftp.
Best Answer
There is a
rename
SFTP command too. If you're using Windows and using WinSCP then you're lucky enough to use wildcards and simply runrename *.tmp *.csv
.In Linux you likely need to script this since the Openssh or the Putty implementation does not support wildcards.