Linux – bash script to rename (mv) a file on a remote machine in linux

linuxscripting

I would like to have a script rename a remote file (with ssh?). I'm not sure how to do it.

Best Answer

You can use ssh to execute the mv command directly

ssh user@remotehost.tld mv file filenew