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

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:

ADVERTISEMENTS

  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
OR

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

### after some time run ###

# cat /tmp/output

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • smilepiper Apr 24, 2012 @ 23:40

    I wish everything in Linux was a easy to tweak as that NetPix you get off of dotdeb.com.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.