On 7/1/23 14:12, Sergey Ponomarev wrote: > To rename a file a user need to use mv command and specify the DEST dir: > > mv /some/very/long/path/file /some/very/long/path/ > > This makes it not so easy to use when typing a command but also makes a > script line longer.
Assuming you meant $ mv /some/very/long/path/file /some/very/long/path/file2 as in the other example - this could be done with: $ cd /some/very/long/path && mv file file2 or (with GNU coreutils' env): $ env -C /some/very/long/path mv file file2 Have a nice day, Berny