Home Learn Linux Linux Answers Storage How do I rename a file in another directory?
  • My guess is you are doing something similar to this:
    $ pwd
    mv Documents/test111 test999
    Then discovering that test999 is in ~/
    This is because the syntax for mv is /path/to/filename /path/to/newfilename
    So you are instructing each time to move it into the current directory on the second arguement

    So instead of mv /tmp/mymac/tuesday/thirteen twelve
    mv /tmp/mymac/tuesday/thirteen /tmp/mymac/tuesday/twelve
    or, (cd /tmp/mymac/tuesday mv thirteen twelve)

    Answered by snipertyler
    One year ago
    0 0
  • use
    mv /tmp/mymac/tuesday/thirteen/myfile.txt /tmp/mymac/tuesday/thirteen/newmyfile.txt

    make sure to use absolute path in destination.

    Answered by rawat
    One year ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Storage

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA
  2. LFD331 Developing Linux Device Drivers
    16 Feb » 20 Feb - San Jose - CA
  3. LFS220 Linux System Administration
    16 Feb » 19 Feb - Virtual

View All Upcoming Courses

Community Answers - Search

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board