Where Is The Xorg.conf File Located under Unix / Linux / BSD?

Posted on in Categories last updated April 24, 2012

I want to find and edit my xorg.conf file for tweaking and configure it for new settings. The problem is that I’m unable to find the file. According to my research, xorg.conf should in /etc/X11 or /usr/X11R6/lib/X11/ directory. I found directories but not the file in directories. How do I find the xorg.conf under Unix or Linux like operating systems?

On most modern Linux or Unix like system Xorg is all about auto-configuring settings without using xorg.conf file. Xorg server will generate a temporary xorg.conf on startup if no config file is found in /etc/, or /etc/X11, or /usr/X11R6/lib/X11/ directory. However, you can use the following command to create a new config file:
Xorg -configure
It will creates xorg.conf.new in your current directory. Edit as per your requirements, test it and move to /etc/X11:
# vi xorg.conf.new
# X -config -retro xorg.conf.new
# cp xorg.conf.new /etc/X11

See this faq for more information. The default location for Unix / Linux / BSD operating systems are as follows:

  1. /etc/X11/xorg.conf
  2. /etc/xorg.conf
  3. /usr/X11R6/lib/X11/xorg.conf

Also, you can use the following find command to locate xorg.conf:
# find / -type f -name xorg.conf

# find / -type f -name xorg.conf &>/tmp/output &

### after some time run ###

# cat /tmp/output

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

1 comment

Comments are closed.