LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-17-2014, 12:26 AM   #1
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 37
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.
 
Old 05-17-2014, 02:30 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
under hypnosis people tend to remember a lot of things accidentally
 
Old 05-17-2014, 02:34 AM   #3
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
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
 
Old 05-17-2014, 02:35 AM   #4
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
sorry, you are writing about Ubuntu (RHEL in your profile), then dpkg
 
Old 05-18-2014, 06:08 PM   #5
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 937

Rep: Reputation: 174Reputation: 174
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.
 
Old 05-19-2014, 06:44 AM   #6
GNU/Linux
Member
 
Registered: Sep 2012
Distribution: Slackware-14
Posts: 118

Rep: Reputation: Disabled
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.
 
  


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
[SOLVED] Rename latest accessed file/folder yogesh_attarde Programming 5 01-20-2014 02:21 AM
[SOLVED] How to add a folder directory to rename the file ytyyutianyun Linux - Newbie 2 11-21-2011 09:00 PM
rename last character in file/folder name BoraX Programming 9 10-26-2006 11:01 AM
rename file with "mv" not working for folder? Niceman2005 Linux - Newbie 2 03-13-2005 10:34 PM
rename file/folder command hct224 Linux - Newbie 4 09-19-2003 10:44 AM


All times are GMT -5. The time now is 04:14 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration