Linux.com

Home Learn Linux Linux Answers Storage How do I rename a file in another directory?
Answers
  • 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
    do:
    mv /tmp/mymac/tuesday/thirteen /tmp/mymac/tuesday/twelve
    or, (cd /tmp/mymac/tuesday mv thirteen twelve)

    Answered by snipertyler
    9 months 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
    9 months 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. LFD411 Embedded Linux Development
    25 Aug » 29 Aug - Santa Clara, CA
    Details
  2. LFS422 High Availability Linux Architecture
    08 Sep » 11 Sep - Raleigh, NC
    Details
  3. LFS426 Linux Performance Tuning
    08 Sep » 11 Sep - New York
    Details

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