Difference between pages "File:Snapshot-bg-xclock.png" and "Find out where configuration changes are stored"

From Linuxintro
(Difference between pages)
(Maintenance script uploaded "File:Snapshot-bg-xclock.png": Importing image file)
 
imported>ThorstenStaerk
(Created page with "Whenever I set up a computer, I start konsole and change its settings. I choose Settings -> Configure Current Profile -> Tabs -> "Show 'New Tab' and 'Close Tab' buttons in tab ba...")
 
Line 1: Line 1:
 +
Whenever I set up a computer, I start konsole and change its settings. I choose Settings -> Configure Current Profile -> Tabs -> "Show 'New Tab' and 'Close Tab' buttons in tab bar. Today I wanted to write a script to do this configuration change for me. The most important question is - where is this setting being saved?
  
 +
I could find this out using the command
 +
strace -ffe open konsole
 +
[[strace]] is a cool [[command]] that shows you every syscall invoked by a program (in the above case konsole). When called with the -e open argument, it will only show the open syscalls. This gives you a powerful tool into your hands: A monitor which files are read and/or modified by a program. The output will read like this:
 +
[pid 29951] open("/etc/localtime", O_RDONLY) = 3
 +
[pid 29951] open("/etc/kde4rc", O_RDONLY|O_CLOEXEC) = 3
 +
[pid 29951] open("/root/.kde4/share/config/kdeglobals", O_RDONLY|O_CLOEXEC) = 3
 +
The -ff argument is needed so strace still follows spawning processes; for more information, read [http://man-wiki.net/index.php/1:strace strace's man page].

Revision as of 21:45, 19 December 2011

Whenever I set up a computer, I start konsole and change its settings. I choose Settings -> Configure Current Profile -> Tabs -> "Show 'New Tab' and 'Close Tab' buttons in tab bar. Today I wanted to write a script to do this configuration change for me. The most important question is - where is this setting being saved?

I could find this out using the command

strace -ffe open konsole

strace is a cool command that shows you every syscall invoked by a program (in the above case konsole). When called with the -e open argument, it will only show the open syscalls. This gives you a powerful tool into your hands: A monitor which files are read and/or modified by a program. The output will read like this:

[pid 29951] open("/etc/localtime", O_RDONLY) = 3
[pid 29951] open("/etc/kde4rc", O_RDONLY|O_CLOEXEC) = 3
[pid 29951] open("/root/.kde4/share/config/kdeglobals", O_RDONLY|O_CLOEXEC) = 3

The -ff argument is needed so strace still follows spawning processes; for more information, read strace's man page.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current14:34, 13 January 2021Thumbnail for version as of 14:34, 13 January 2021579 × 582 (33 KB)Maintenance script (talk | contribs)

The following page uses this file:

Metadata