[solved]lost file using mv command

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
captcharis
Level 1
Level 1
Posts: 26
Joined: Fri Sep 01, 2017 9:11 am
Location: Greece

[solved]lost file using mv command

Post by captcharis » Thu Mar 08, 2018 3:57 am

Hello people!!

I made some exercises using "mv & mv -v" command but after moving of files, I couldn't locate them anymore.

Code: Select all

cptcharis@CaptaCharis-Inspiron-5323 ~/Desktop $ mv foo.txt /Imee
mv: cannot move 'foo.txt' to '/Imee': Permission denied
cptcharis@CaptaCharis-Inspiron-5323 ~/Desktop $ sudo mv foo.txt /Imee
cptcharis@CaptaCharis-Inspiron-5323 ~/Desktop $ cd Imee
cptcharis@CaptaCharis-Inspiron-5323 ~/Desktop/Imee $ ls -l
total 624
drwxr-xr-x 3 cptcharis cptcharis   4096 Mar  2 14:31 Backup
drwxr-xr-x 2 cptcharis cptcharis   4096 Mar  6 13:36 callisthenics
drwxr-xr-x 2 cptcharis cptcharis   4096 Mar  2 14:31 GTT
drwxr-xr-x 2 cptcharis cptcharis   4096 Mar  2 14:32 WinDlg_v1_31
-rw-r--r-- 1 cptcharis cptcharis 619792 Feb 28 15:12 WinDlg_v1_31.zip
cptcharis@CaptaCharis-Inspiron-5323 ~/Desktop/Imee $ 
As can you see no any foo.txt file inside /Imee.
Do you have any idea what is going on?
Last edited by captcharis on Thu Mar 08, 2018 5:04 am, edited 1 time in total.
el pueblo unido jamás será vencido

User avatar
catweazel
Level 14
Level 14
Posts: 5453
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: lost file using mv command

Post by catweazel » Thu Mar 08, 2018 4:00 am

captcharis wrote:
Thu Mar 08, 2018 3:57 am
Hello people!!

I made some exercises using "mv & mv -v" command but after moving of files, I couldn't locate them anymore.

Code: Select all

/Imee
Try /Imee/
A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. - Max Planck

captcharis
Level 1
Level 1
Posts: 26
Joined: Fri Sep 01, 2017 9:11 am
Location: Greece

Re: lost file using mv command

Post by captcharis » Thu Mar 08, 2018 4:23 am

Try /Imee/
The printout

Code: Select all

No such file or directory
el pueblo unido jamás será vencido

User avatar
catweazel
Level 14
Level 14
Posts: 5453
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: lost file using mv command

Post by catweazel » Thu Mar 08, 2018 4:34 am

captcharis wrote:
Thu Mar 08, 2018 4:23 am
Try /Imee/
The printout

Code: Select all

No such file or directory
lol ... with your original command you're moving the file to / (root) and if you look there you'll see a file called Imee

ls /

The correct command is mv foo.txt ./Imee
A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. - Max Planck

Mute Ant
Level 13
Level 13
Posts: 4783
Joined: Tue Sep 03, 2013 7:45 pm

Re: lost file using mv command

Post by Mute Ant » Thu Mar 08, 2018 4:39 am

"Do you have any idea what is going on?" Yup. The original file ~/foo.txt is now in the OS root / called Imee because that's what you told it to do.

The Permission Denied error is the first-and-final warning that your attempted action threatens the OS. Using sudo to see what happens is 'unwise'.
In Chapter One, Boron slays the entire Marketing Department by explaining Asynchronous Protocols.

captcharis
Level 1
Level 1
Posts: 26
Joined: Fri Sep 01, 2017 9:11 am
Location: Greece

Re: lost file using mv command

Post by captcharis » Thu Mar 08, 2018 4:43 am

Lol :D :mrgreen:

Thanks guys
el pueblo unido jamás será vencido

Post Reply

Return to “Newbie Questions”