LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-20-2005, 04:15 PM   #1
oru
LQ Newbie
 
Registered: Jan 2005
Location: Estonia
Distribution: Slackware 10.0
Posts: 8

Rep: Reputation: 0
wrong command, big PROBLEM


I was moving some stuff around my box and i do little mistake:
Code:
mv stuff/* /*
i mean do to:
Code:
mv stuff/* ./*
and now some programs seem to stop working on my Slackware 10.0.
Code:
-bash: /usr/bin/ls: No such file or directory
-bash: cd: /etc: No such file or directory
What i do now
Try do run SLAX Live CD and fix this??

HELP PLEASE.
 
Old 09-20-2005, 04:32 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
I suppose that really depends on what is (was) in stuff/. I don't see how that should've hosed the whole system. Were you root at the time?
 
Old 09-20-2005, 04:36 PM   #3
oru
LQ Newbie
 
Registered: Jan 2005
Location: Estonia
Distribution: Slackware 10.0
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
I suppose that really depends on what is (was) in stuff/. I don't see how that should've hosed the whole system. Were you root at the time?
In stuff was CMS files, and yes i was root.
Now i see only this: :
Code:
root@server:# cd /
boot/ home/ lib/  man/  proc/ tmp/  var/
it should be:
Code:
root@server:/# cd /
bin/  dev/  home/ mnt/  proc/ sbin/ tmp/  var/
boot/ etc/  lib/  opt/  root/ sys/  usr/
copy of another box.

Last edited by oru; 09-20-2005 at 04:47 PM.
 
Old 09-20-2005, 04:48 PM   #4
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Did you delete any files at any point? (RM of any sort). There's really no way for what you did to REMOVE those directories completely. Unless you did the command like "mv /* stuff" or something.
 
Old 09-20-2005, 04:52 PM   #5
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
Re: wrong command, big PROBLEM

Quote:
Originally posted by oru
i mean do to:
Code:
mv stuff/* ./*
No, you actually meant to do:
Code:
mv stuff/* ./
You can't use wildcards when you specify the destination of moving or copying because you can only move them to one destination (I'm sorry if this sounds obvious). What happens when you use wildcards is that the shell expands them, so when you did "mv stuff/* /*", it became something like this:
Code:
mv stuff/foo stuff/bar stuff/baz ... /bin /boot ... /usr /var
and as a result all the stuff in "stuff" as well as most of the stuff in your / filesystem all got moved into the last directory under / (which is probably /var). In other words, your "ls" is probably now under /var/usr/bin/ls
 
Old 09-20-2005, 05:00 PM   #6
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Wow. I didn't even think of that one. Excellent catch, spooon.
 
Old 09-20-2005, 05:02 PM   #7
oru
LQ Newbie
 
Registered: Jan 2005
Location: Estonia
Distribution: Slackware 10.0
Posts: 8

Original Poster
Rep: Reputation: 0
Code:
root@server:/home/virtualweb/web.ee# mv exponent-0.96.3.tar.gz /home/virtualweb/
root@server:/home/virtualweb/web.ee# ls
exponent-0.96.3/
root@server:/home/virtualweb/web.ee# mv exponent-0.96.3/* /*
mv: cannot overwrite directory `/var/tmp'
mv: cannot move `/boot' to `/var/boot': Device or resource busy
mv: cannot move `/home' to `/var/home': Device or resource busy
mv: cannot overwrite directory `/var/lib'
mv: cannot overwrite directory `/var/man'
mv: cannot move `/proc' to `/var/proc': Device or resource busy
mv: cannot overwrite directory `/var/tmp'
root@server:/home/virtualweb/web.ee# ls
-bash: /usr/bin/ls: No such file or directory
root@server:/home/virtualweb/web.ee# ls
-bash: /usr/bin/ls: No such file or directory
root@server:/home/virtualweb/web.ee# cd /
root@server:/# ls
-bash: /usr/bin/ls: No such file or directory
root@server:/# cd /
root@server:/# ls
-bash: /usr/bin/ls: No such file or directory
root@server:/# ls
-bash: /usr/bin/ls: No such file or directory
root@server:/# w
-bash: /usr/bin/w: No such file or directory
root@server:/# w
-bash: /usr/bin/w: No such file or directory
root@server:/#
root@server:/#
root@server:/#
root@server:/#
root@server:/#
root@server:/#
root@server:/#
root@server:/#
root@server:/#
root@server:/# w
-bash: /usr/bin/w: No such file or directory
root@server:/# ping www.ee
-bash: ping: command not found
root@server:/# ls
NOW I WAS IN PANIC
 
Old 09-20-2005, 05:04 PM   #8
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Yep, that would do it. Now you'll need to straighten out /var by moving /var/bin, et al, back to the original positions. Be quite careful about it.
 
Old 09-20-2005, 05:38 PM   #9
oru
LQ Newbie
 
Registered: Jan 2005
Location: Estonia
Distribution: Slackware 10.0
Posts: 8

Original Poster
Rep: Reputation: 0
Thumbs up

Thanks a lot guys, everything Works!
 
Old 09-20-2005, 09:05 PM   #10
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Glad you got it up and running. I think you just experienced first-hand why people try to avoid doing things as root as much as possible.
 
  


Reply


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
MEncoder: Whats wrong with this command? flamesrock Linux - Software 1 07-15-2004 07:03 PM
df command shows wrong information vdemuth Mandriva 3 06-04-2004 02:30 AM
wtf is wrong with the 'make' command? santasballz Linux - Newbie 16 02-10-2004 09:49 PM
Big, big Problem on vsftpd rhonneil Linux - Newbie 1 10-01-2003 02:18 PM
Installing RH 9 with RAID 5 --Big, big Problem!!! rhonneil Linux - Software 2 09-25-2003 08:13 PM


All times are GMT -5. The time now is 07:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration