I am trying to understand Linux and I am often solving my problems on a case by case basis without actually learning how to come up with the answer myself, which of course, I prefer not to do.
For example I have set a keyboard shortcut to select an area and take a screenshot of it. Everytime I select an area, it always defaults to /Pictures, and I would like to edit either the default directory or the quick dropdown choices it presents me.
I have found an answer as usual, however this time I would like to know how do people normally approach this if there was no answer. Surely there must be a logical set of steps to pinpoint how a terminal command works/where it takes its arguments.
For this particular case, I have looked online for which command Ubuntu uses to take screenshots, which turns out to be import
.
So my question is, what is/are the approach(es) to
Find where configuration files / location / code level information (like not how to call it but what it specifically does when it is called) of a terminal command
How to find out which terminal command a particular action corresponds to. (Figuring out
import
is called when I took a screenshot for example)
In other words, how could I have figured this out myself if I had no access to internet, or no one knew the answer? :) I am more interested in the approach/logic, however import
in this case would be a good example.
Edit:
I do not think my question is the same with the suggested possible duplicate because I am asking for a way to reach source code if that is possible. In other ways, I am asking for a way to read the source code of a command, and files it uses (for example maybe there is a config file for import function and if I could have found it I would have changed default-save-directory). To clarify even further, the file I am trying to find (if it is possible to find it) a code equivalent to the following pseudo code:
<when run>
change mouse pointer to + shape
..wait for a click..
on click -> wait for release..
on release -> take the area between click and release coordinates
read config file located at ./config and get default-save-directory variable
initialize path to default-save-directory
ask user where to save the image
This has to be saved somewhere in the operating system. "That is not possible because ..." (maybe it is in assembly level for example) is also an answer, but use man to get instructions on what this function does is not an answer because I want to understand how it works.
In yet another words, if a linux ninja was to modify import command on his local computer, where would he go, and say add a signature in the pictures saved with screenshot.