Results 1 to 2 of 2

Thread: terminal "mv" command lost file..please help =|

  1. #1
    Join Date
    Sep 2012
    Beans
    7

    terminal "mv" command lost file..please help =|

    i have a directory "programs" which has two child directories "geo_heatfolow_sim" and "twamely_hall_shuffel"

    i accidentally put a file in the geo heatflow folder instead of the twamely one, so i typed


    Code:
    cd geo_heatfolow_sim/ mv sim.cxx ../twamely_hall_shuffel/sim.cxx
    to move it to the twamely folder, but it isn't in the twamely folder and "locate sim.cxx" doesnt find anything..

    where did this go? how do i get it back? this is not good. =|

    edit: i actually just found it laying in the geo folder... why did that command not move it? also why did locate sim.cxx not return anything? o.O
    Last edited by an0nym1ty; September 8th, 2012 at 10:12 PM.

  2. #2
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: terminal "mv" command lost file..please help =|

    Did you type the exact command you entered here? If so, then you needed to put an stop command character (I don't know the exact term for it) in there like this:

    Code:
    cd geo_heatfolow_sim/ && mv sim.cxx ../twamely_hall_shuffel/sim.cxx
    or you could do

    Code:
    cd geo_heatfolow_sim/; mv sim.cxx ../twamely_hall_shuffel/sim.cxx
    I'm not 100% on why you didn't get an error about the move command. But, bash doesn't know where one command ends and the next begins unless you explicitly tell it so. So, you can either use ';' as a separator between commands, or the boolean '&&' to say do the first command, and if that's successful, then do the second command. You could also use a boolean or, '||', if you prefer.

    As to the locate command, the file probably had not yet been indexed by the system. I think that happens every hour or so. To manually update the index, you would run:

    Code:
    sudo updatedb
    Hope that helps!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •