View of Terminal Commands in GUI

Suggestions and feedback for Linux Mint and the forums
Forum rules
Do not post support questions here. Before you post read: Where to post ideas & feature requests
Post Reply
PrimaryOvertone

View of Terminal Commands in GUI

Post by PrimaryOvertone »

I am trying to learn terminal commands. I think it would be really helpful to be able to see the commands that are passed to the terminal by the GUI. I did a Google search on this and none of the Linux distros seem to have anything like this. It would be really handy to have this. I don't have a way to create this functionallity as I don't know enough about it but I am sure someone does. I think it could be a good way to learn terminal commands in real time.
viking777

Re: View of Terminal Commands in GUI

Post by viking777 »

Which Gui and which commands?

Far and away the most interesting place to learn this is from Synaptic Package Manager. Every time you update it executes dozens of commands all of which are hidden by default, but all you have to do is click the 'Details' button and you can watch them happen, not only that but provided you don't have the 'Automatically Close' option checked, you can review them all afterwards.
PrimaryOvertone

Re: View of Terminal Commands in GUI

Post by PrimaryOvertone »

I had noticed that and that is a good way to learn about the install process but I was really think more about regular everyday movement through the system. It would be nice to see when I click on an icon in the mint menu the terminal commands opening the programs and the coding passing through the GUI to run everything in the program (i.e. open file X, etc.).
viking777

Re: View of Terminal Commands in GUI

Post by viking777 »

That would be good I agree, but it hasn't happened yet so I guess it never will, hell, they can't even be bothered to tell you what a command is actually called half the time. If you click on 'Search for Files' for example does it launch a command called 'Search for Files'? Does it hell :evil: I can't tell you how many man hours I have wasted because of this kind of lunacy. Everybody knows that if you click on 'Search for Files' it launches a program called 'gnome-search-tool' Don't they?? Well actually, no they don't, the vast majority of people don't know that and the vast majority of people would like to know that without having to search high and low for the information first. (Sorry PrimaryOvertone but you have just hit upon one of my many soap boxes here).

I wish I knew an easy answer, sadly I believe it lies with program developers, nearly all of whom assume that it is obvious what their program command is called even if they can't be bothered to tell you. Such a simple change to Linux would make such a massive difference.

To save me banging on forever, this is not exactly what you (and I) are looking for, but it will certainly help you.

https://help.ubuntu.com/community/clicompanion
User avatar
xenopeek
Level 25
Level 25
Posts: 29587
Joined: Wed Jul 06, 2011 3:58 am

Re: View of Terminal Commands in GUI

Post by xenopeek »

Perhaps you have some misunderstanding. Only shell scripts use terminal commands. Programs like Firefox and such might have a shell script to install or to start, but the main program will be an executable, consisting of binary computer code. The program makes system calls to the kernel for doing things like opening files. Those are not terminal commands. If you want to see what system calls a program make, you can use the strace program for that. But I'm thinking this is not what you want.

Going back to Firefox, you can find what the name of the file is that is run when you start it from the menu by installing Alacarte (on Gnome; on other desktop environments you will using something else). Alacarte allows you to see which command is run. For Firefox the command is "firefox %u". To find out more, I hop to the terminal and do the following:
vincent@katya ~ $ which firefox
/usr/bin/firefox
vincent@katya ~ $ file /usr/bin/firefox
/usr/bin/firefox: symbolic link to `../lib/firefox-11.0/firefox.sh'
vincent@katya ~ $ man file
vincent@katya ~ $ file --dereference /usr/bin/firefox
/usr/bin/firefox: POSIX shell script text executable
vincent@katya ~ $ cat /usr/bin/firefox
<contents of the file is shown here, cut for brevity>
I first use the command "which" to find where "firefox" is. Then I use the command "file" to get information about the file. It shows me the firefox file is a symbolic link to some other file. So you see me consulting the manpage for file to find out how I have it follow symbolic links :wink: Next I run it properly and it tells me firefox is a shell script. So it contains terminal commands :D Next I output the contents of the file. You could have done "gedit /usr/bin/firefox" instead to show the contents of the file in a nice editor.

Here is a topic with links to tutorials and documentation on terminal commands: http://forums.linuxmint.com/viewtopic.php?f=213&t=77062
Image
Post Reply

Return to “Suggestions & Feedback”