LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rename issue with file /folder (https://www.linuxquestions.org/questions/linux-newbie-8/rename-issue-with-file-folder-4175505273/)

tanveer 05-16-2014 11:26 PM

rename issue with file /folder
 
Hi all,

the other day one of my friend asked me a question that he accidentally renamed a folder in ubuntu in /var/log and then later couldnt remember what was the original folder name before change. He did it from GUI.
Never had this issue but also couldn't answer too. Anyone know how: any easy way?
Thanks in advance.

Ygrex 05-17-2014 01:30 AM

under hypnosis people tend to remember a lot of things accidentally

Ygrex 05-17-2014 01:34 AM

probably RPM should help you: each directory under /var/log should belong to some installed RPM, to find out the original name you can perform a file system integrity check with RPM

Ygrex 05-17-2014 01:35 AM

sorry, you are writing about Ubuntu (RHEL in your profile), then dpkg

JeremyBoden 05-18-2014 05:08 PM

Quote:

the other day one of my friend asked me a question that he accidentally renamed a folder in ubuntu in /var/log and then later couldnt remember what was the original folder name before change. He did it from GUI.
If this is true, then it seems that he had /var/log open in nautilus as root.
In general, its a very bad idea to run a GUI as root.

Chances are that it should fix itself. You could check the contents of the files in
Code:

/etc/logrotate.d
against /var/log/. This should cover the non-empty directories in /var/log. Personally, I wouldn't bother since it is likely that the directories & files will get automatically recreated.

GNU/Linux 05-19-2014 05:44 AM

You can do
Code:

$ ls -ltr /var/log
and see the files at the bottom... But then again, system continuously write to files in that directory.


All times are GMT -5. The time now is 11:32 AM.