LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-21-2010, 01:47 AM   #1
neverland
Member
 
Registered: Mar 2010
Posts: 31

Rep: Reputation: 15
mistake during type mv command


hello guys
I accidentally type mv command wrong.
actually it supposed to be
mv SNAP-20101215* dec10/week3_dec10/
but i type the below instead
mv SNAP-20101215* dec10/week3_dec2010/

Note: there is a folder name "dec10/week3_dec10/"
but there is no folder name "dec10/week3_dec2010/"

as a result of it, instead of having those files under dec10/week3_dec10 but it merge those files into one file name "week3_dec2010" , is there any way to change it back to orginal files?
 
Old 12-21-2010, 05:58 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
What distro/shell are you using? On both zsh and bash (under Ubuntu, but I don't think that would affect it) it doesn't let me do that:
Code:
joshua@joshua-desktop:~/test$ rm *
joshua@joshua-desktop:~/test$ echo "Hello 1" > bob1
joshua@joshua-desktop:~/test$ echo "Hello 2" > bob2
joshua@joshua-desktop:~/test$ mv bob* foo
mv: target `foo' is not a directory
Assuming that you HAVE actually made a file (and not moved them into a directory), what is inside the file? Is it the contents of one of the SNAP-20101215 files? Or the contents of all of them one after the other? Or something strange and peculiar?

Last edited by Snark1994; 12-21-2010 at 05:59 AM.
 
Old 12-21-2010, 08:59 AM   #3
ordinary
Member
 
Registered: Apr 2007
Location: the Rocket City
Distribution: Debian, Ubuntu, CentOS; in days past Fedora, Solaris, SunOS, 4.2BSD, 4.3BSD, SVR4, AIX, HP-UX
Posts: 101

Rep: Reputation: Disabled
Neverland, I don't have an immediate solution, but I believe that the trailing "/" is part of the cause. At least it is why your case is different than Snark's example.

If the source files are actually merged into one destination file, it is likely that your only solution is to manually extract it. If it is human readable, vi or grep or somesuch could help. If it is not human readable, I suspect you have some aggravation in your immediate future.

Good luck!
 
Old 12-22-2010, 05:16 AM   #4
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
'fraid not...

Code:
[joshua@joshua-desktop:~/test]$ mv bob* foo/                      (12-22 11:15)
mv: target `foo/' is not a directory
[joshua@joshua-desktop:~/test]$ bash                              (12-22 11:15)
joshua@joshua-desktop:~/test$ mv bob* foo/
mv: target `foo/' is not a directory
 
Old 12-27-2010, 09:12 PM   #5
neverland
Member
 
Registered: Mar 2010
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Snark1994 View Post
What distro/shell are you using? On both zsh and bash (under Ubuntu, but I don't think that would affect it) it doesn't let me do that:
Code:
joshua@joshua-desktop:~/test$ rm *
joshua@joshua-desktop:~/test$ echo "Hello 1" > bob1
joshua@joshua-desktop:~/test$ echo "Hello 2" > bob2
joshua@joshua-desktop:~/test$ mv bob* foo
mv: target `foo' is not a directory
Assuming that you HAVE actually made a file (and not moved them into a directory), what is inside the file? Is it the contents of one of the SNAP-20101215 files? Or the contents of all of them one after the other? Or something strange and peculiar?
my info.
SNAP-20101215 files are pictures from ip camera.
I use /bin/bash.
GNU bash, version 2.05b.0(1)-release (i586-mandrake-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.

Last edited by neverland; 12-27-2010 at 09:34 PM. Reason: more info.
 
Old 12-30-2010, 08:54 AM   #6
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Quote:
Originally Posted by Snark1994 View Post
Assuming that you HAVE actually made a file (and not moved them into a directory), what is inside the file? Is it the contents of one of the SNAP-20101215 files? Or the contents of all of them one after the other? Or something strange and peculiar?
Sorry, I think you misunderstood my question... What is inside the file you made, 'week3_dec2010'?
 
Old 12-30-2010, 09:48 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by Snark1994 View Post
What distro/shell are you using? On both zsh and bash (under Ubuntu, but I don't think that would affect it) it doesn't let me do that:
Code:
joshua@joshua-desktop:~/test$ rm *
joshua@joshua-desktop:~/test$ echo "Hello 1" > bob1
joshua@joshua-desktop:~/test$ echo "Hello 2" > bob2
joshua@joshua-desktop:~/test$ mv bob* foo
mv: target `foo' is not a directory
It's not the shell that is doing that, it's the mv command as confirmed by the "mv:" at the start of the message.
 
  


Reply

Tags
mv



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] undoing a mistake on the command line... oznola Linux - Newbie 2 05-15-2010 08:17 AM
How can I type a command that does the following? KevinAlaska Linux - Newbie 4 05-10-2007 11:58 PM
type sudo command then i cant type in a password turoblaztr Linux - General 5 01-14-2007 09:58 AM
command to see RAM type curos Linux - General 2 03-15-2006 10:00 AM
what command do I type Mr. Mojo Risin Linux - Hardware 4 07-26-2004 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:49 AM.

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