To understand Linux better I want to see which commands run in background. For example when I create new file via GUI, is there any way to see the which command runs in terminal?
If you create something via a GUI, normally the only command that runs is the GUI, it doesn't call other commands that you would invoke from the commandline.
E.g. if the GUI is used to create a directory, it calls the C function
mkdir(), not the command
mkdir that you would use on the commandline (
mkdir() as well and they both rely on a system call to actually create the directory on the filesystem).
You could try to run your GUI under
strace to see what system calls it makes , but you have to make sure it stays in the foreground.