Welcome to the VirtuQ Forums.
Results 1 to 6 of 6
  1. #1

    Unable to move file from one directory to another directory

    sir,

    I was using the command mv to move the file from one directory to another directory, but it doesn't move the file and it delete the file which was to move .
    The syntax was :mv Virtuq.txt ankit/
    one more thing that, File was moved when i change directory to the default directory of virtuq lab.

    anon10043

  2. #2
    VirtuQ Moderator
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    40
    Anon10043,

    It is difficult to figure out from your post what went wrong. :mv is not command, the command is mv. Did you do a ls in the directory to see that the file exists? Did you make sure that the target directory exists? Please check.

    I will delete this post if the above errors were caused due to some typos in the command entered.

    Thanks,

    Anup

  3. #3
    Sir,

    I thing it could be more clear to you with following attachment.

    Thanku
    Attached Files Attached Files

  4. #4
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    Anon10043,

    The errors are self-explanatory. In the first case you tried to move a file with the name Virtuq.txt and that file did not exist. UNIX file names are case-sensitive. The name of the file in your directory is virtuq.txt. In the second case you appended a '/' in the destination which told mv that it should be a directory, however, it did not find any directory with that name and hence cribbed. If you remove the '/' and execute the command it will work. Anything after that is because the file does not exist. You should do a 'ls' and then see that the file exists before moving it.

    Thanks,

    Anup

  5. #5
    Sir,

    command runs after removing '/' and file was moved from directory but it was not present in directory where it was moved.screen shot is there to clear all those thing which i want to say.

    anon10043a.zip

  6. #6
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    There are lots of things which are getting mixed up here. The target without a forward slash is treated like a file. So,

    mv virtuq.txt ankit

    will mean that the file virtuq.txt has been moved as file ankit or it has been renamed. You cannot cd to a file. Do a

    ls -l

    and look for d in the first line to see which are directories. These will also show up in blue color.

    Anup


 

Posting Permissions

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