Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I have my ~/ directory that is being flooded by ".Xauthority.43652W" files with "43652W" being any combination of letter and digits...

I only have 40 of these files for the moment, but it's ever growing and I don't want to pollute my ~/ too much.

Any idea what should I do ?

share|improve this question

marked as duplicate by vasa1, Eric Carvalho, Kevin Bowen, Warren Hill, Jorge Castro Sep 20 '13 at 13:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Remove them? Just leave the base .XAuthority file. –  Thomas W. Sep 19 '13 at 5:43
:-) Nice suggestion... I would have prefer a configuration parameter that would have help me stop producing them :-) –  Stephane Rolland Sep 19 '13 at 5:53
I have just 5 since installing 13.04 in April. Before that, something similar was happening with .goutput (?) –  user25656 Sep 19 '13 at 6:01

1 Answer 1

up vote 1 down vote accepted

For those -- like me -- wishing to get rid of this "pollution" in the user directory (apparently caused by a lightdm bug described in Why do I have so many .Xauthority.* files in my home directory?), an interim solution could be placing something like the following (executable) script file (which assumes you are the first user after root) into the /etc/cron.daily directory:

USER="$(users | awk -F ' ' '{print $2}')"
ls /home/"$USER"/.Xauthority.* > /home/"$USER"/.Xauthority-Files.txt
NFILES="$(grep -c Xauthority /home/"$USER"/.Xauthority-Files.txt)"
echo -e "$(date +"%x %R"): "$NFILES" .Xauthority.* files deleted" >> "$LOG"
rm -f /home/"$USER"/.Xauthority.*
rm -f /home/"$USER"/.Xauthority-Files.txt
exit 0

NOTE: This updated script keeps a log file named ".Xauthority-Files.log" so that you can follow up if a recent update has put an end to this bug, and then remove the script when it's no longer needed.

share|improve this answer

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