Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-29-2011, 12:39 AM   #1
LQ Newbie
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
Talking What mv file /Volumes/Samples/* does to you HDD

Guys I know it's messed up combination but I've just realized how smart I am.

I was trying to move zip file into one of the locations on remote drive:

mv ~/Downloads/ /Volumes/Samples/*

Of course all my files have disappeared including folders. ls -la won't show anything. Although volume indicator shows that there are files on it.

Any suggestions? Is that it?
Old 11-29-2011, 01:40 AM   #2
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
Just rename it back.

mv /Volumes/Samples/* /Volumes/Samples/

But make sure you put your other stuff inside /Volumes/Samples into somewhere else. This works ( I tried it ) if the amount of the file is only one.


This only happens if the /Volumes/Samples is initially empty.

Last edited by melinda_sayang; 11-29-2011 at 01:42 AM.
Old 11-29-2011, 01:56 AM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
The * character is a wild card which expands to a sorted list of all the files and directories.

What does "ls /Volumes/Samples/" show?
In other words, what does /Volumes/Samples/* expand to? If the last item is a directory, you may have moved and all files in /Volumes/Samples/ into a directory. All but the last item will be taken as files and directories to move.
If /Volumes/Samples/ has only on directory in it, that may be where the went to.

mv /Volumes/Samples/* /Volumes/Samples/ will not work right because it is selecting everything in /Volumes/Samples/. It will only work if there is one file in /Volumes/Samples, and that file used to be

If a file was renamed instead, and you don't have the extension to go by, try the "file" command. It analyzes what a file is by its contents (i.e. signature) and reports what the type of file is. Just don't blindly use wild cards in commands if you don't know what it will expand to.

Last edited by jschiwal; 11-29-2011 at 01:58 AM.
1 members found this post helpful.
Old 11-29-2011, 02:14 AM   #4
LQ Newbie
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thumbs up

Originally Posted by jschiwal View Post
If /Volumes/Samples/ has only one directory in it, that may be where the went to.
You're so right !
There was one folder left but it was occupied with process so I thought that's all left.

I went ahead and check insides and yes all my stuff is there.

But mv /* / was good advise too but it works if folder was initially empty.

Appreciate your explaining me.
Old 11-29-2011, 02:14 PM   #5
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,842

Rep: Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004
A safer way to run the mv command in cases like this is to use the -t option to explicitly specify the directory to move the files to. That way you're in less danger of permanently losing anything.

Also consider using the -n or -i option, or at least enable -v so you can see immediately what the thing did.

For example, there was at least one time where I ran multiple mv -f commands in a loop, and I ended up overwriting the same filename with one input after another, so that all but the last file was lost. That wouldn't happen with -t.
Old 11-29-2011, 03:19 PM   #6
LQ Newbie
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled

Thank you guys so much.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding samples from one PCM file into another ryancuomo Programming 1 08-12-2009 12:34 AM
Hide dots file with (wIn) Explorer on mounted Linux volumes sylvaticus Linux - General 4 03-30-2009 06:18 AM
File system for large volumes archangel_617b Linux - Enterprise 2 08-30-2007 04:06 PM
Invalid File Credentials When Creating on NFS Volumes Linux - Networking 0 08-13-2006 12:05 PM
Volumes of file systems rasmib Linux - Software 1 07-24-2003 04:32 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration