How to rename files in a folder using the ls command output as a pipe ?
- by user1179459
I am using GNU/Linux and BASH shell,
What i wanted to do is in server is to
i need to be able to download the files stating with B* and D* and then rename them to ~B* and ~D*(same file name just ~ in-front)
i wrote following which works fine for the downloading part ideally i would like it to use ls command output as well but dont know how to do that.
cd inbox
get D*
get B*
ls B*|rename $0 ~B.*
bye
Any idea ?
ideally what i would like to do is ls command to send the list of files one by one to the get command and then the once the get command is completed i want rename command executed renaming the server files