How do I create a new file in a folder owned by root? Specifically, I want to add a file to /etc/X11/xorg.conf.d
17,116
First, create the file, using the editor of your choice. Store it in a user directory, something in or under $HOME
Check it to be sure it says what you think it says, and does what you want. Then, and only then:
sudo cp yourfile /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Related videos on Youtube
Author by
Laa-Laa
Updated on September 18, 2022Comments
-
Laa-Laa over 1 year
I want to add a new file to
/etc/X11/xorg.conf.d
as seen at the bottom of this page, but I can't as it's owned by root user. How to?EDIT: I managed it using the information on this page:
-
goo almost 9 yearsAre you looking for a "command line" answer, or are you a Point-Click-and-Wonder-What-Happened type of questioner>?
-
Laa-Laa almost 9 yearsI'd like a command line answer I guess. Sorry if it's a stupid question, just got Ubuntu yesterday coming from windows
-
-
Laa-Laa almost 9 yearsThis is what I tried first! But when I try to save it it says "Could not find the file “/etc/X11/xorg.conf.d/50-mouse-acceleration.conf”. Please check that you typed the location correctly and try again."
-
Stephen almost 9 yearsSorry, updated, I forgot, ubuntu uses a different location
-
Laa-Laa almost 9 yearsThanks, I should have realized to try that again when I learnt that Ubuntu used a different path :) ... and even more should have used the correct path in my post -_-
-
Stephen almost 9 yearsWhy the edit, A.B.?
-
A.B. almost 9 years@Stephen sorry for the edit without a comment. But you shouldn't use
sudo
to start a GUI, it's OK, to start an application with a CLI. Usesudo -i
,pkexec
orgksudo
for applications with a GUI like Gedit and so on. -
A.B. almost 9 yearsIf you write me a message, use
@A.B.
. I don't get a ping without the@
-
Stephen almost 9 years@A.B. So the potential side effect of not doing "-i" and inheriting root's environment is that you get temp files created in your home that could prevent the correct operation of programs running as your user? Are there other side effects?
-
A.B. almost 9 yearsAnywhere on Ask Ubuntu is a very long discussion for this.