LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-16-2014, 11:26 PM   #1
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 39
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, 01: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, 01: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, 01: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, 05:08 PM   #5
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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, 05:44 AM   #6
GNU/Linux
Member
 
Registered: Sep 2012
Distribution: Slackware-14
Posts: 120

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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