LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-15-2012, 01:14 AM   #1
monag
LQ Newbie
 
Registered: Jun 2011
Posts: 21

Rep: Reputation: Disabled
Dir with files has changed to a file


Hello,
I was using a directory with some files in it. I do not remember exactly what I did...I cannot even see a trace of it in the bash history...I think I may have used the mv command wrongly.

Looking at its size I am pretty sure its a directory. But I do not know how to change it back to a dir..
I have been on the forums and on various sites but I dont see a solution to this.
I think using chmod 0777 (a correct value ...the above is wrong ) may work...However I dont know how to set the d attribute to this file now.

Can someone suggest what to do...Will appreciate this very much as this directory contains some important files..

Regards
 
Old 02-15-2012, 03:01 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
If chmod cannot solve fsck can fix that. Probably the sticky bit is altered at the swap.

If the directory is in a mounted volume you unmount the volume first and run
Quote:
"fsck -a /dev/partition_of_volume"
If the file in the system drive/partition you will need to shutdown and boot into a live cd or any linux repair cd and there you can issue the same command against the system partition:

Quote:
fsck -a /dev/sda(whatever, whichever)
Hope that helps.

mm
 
Old 02-16-2012, 02:42 AM   #3
monag
LQ Newbie
 
Registered: Jun 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thanks for your reply.
I will try that out...but I dont think I used the right command for chmod.
What is the command for chmod to set the attribute for the dir.

Is it chmod 0777 filename
or .....
I would like to first try the right chmod command before trying to do and fsck and unmounting volumes which I am not expert at...However if there is no alternative I will have to try your suggestion. Thanks very much for it..
Is there a flaw in the mv command....Because I think it happened when I was using the mv commands..
Thanks in advance for your suggestions/tips/replies.
 
Old 02-23-2012, 02:50 AM   #4
monag
LQ Newbie
 
Registered: Jun 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
Would appreciate if someone can give me a hint of what are the correct values to be given to the chmod command ...I know how to use the chmod command but dont know what is the sticky bit to be sit for a dir...I have looked up online but dont seem to be getting an answer to this simple issue....Please suggest/help
 
Old 02-23-2012, 03:13 AM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
When you think you made a mistake, atleast in my case, I go back to my terminal & press the arrow key up & review all of the commands I entered.
Or you can look at your bash history, although it will not show those issued as root.
I often just su or open root terminal & scroll to see what I did as root
It would help if you to;d us the name of the directory in question.

Last edited by EDDY1; 02-23-2012 at 03:15 AM.
 
  


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
Shell Script for Identifying the file and zip all files, move the files to Target Dir gvenkat Linux - Newbie 3 05-07-2011 10:53 AM
rsync -u Does it update the contents of a dir if that dir is changed? crazyivan Linux - Software 1 04-02-2008 03:08 AM
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 02:57 PM
Q. moving /bin dir files to /dev dir?? Texas_student Linux - Software 2 03-26-2006 11:42 PM
How xterm get known that current dir changed? pvv Programming 3 03-15-2004 08:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:00 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