Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a bugreport using ubuntu-bug and I would like to include the log files of Gnome Display Manager (GDM) which I found in /var/log/gdm. To minimize the noise that may be in the logs I would like to empty them before I reproduce the bug.

What is the best way to empty the log files?

share|improve this question
up vote 1 down vote accepted

There are several ways to do this. You can move the log file to a backup with

sudo mv gdm.log gdm.log.old

and then you can create an empty file with

sudo touch gdm.log
share|improve this answer
Do you know if it is safe to delete them? If so, which files - all in the directory? – JJD Feb 12 '12 at 12:28
The files ending on .[0-9] are older logs (zipped files). Any log you delete here should be recreated when needed by the system so it should be safe. Always better to create a backup though ;) – Rinzwind Feb 12 '12 at 14:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.