View of Terminal Commands in GUI

Write suggestions and new ideas in here
More ideas here http://community.linuxmint.com/idea/welcome
Forum rules
No support questions here please.
Do not post ideas for application developers. Please use GitHub for Cinnamon and Nemo ideas.

View of Terminal Commands in GUI

Postby PrimaryOvertone on Sat Mar 10, 2012 12:56 pm

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.
Linux Mint 12 (64 bit) with GNOME shell on
Acer Aspire one 722 with 2GB RAM
PrimaryOvertone
Level 1
Level 1
 
Posts: 15
Joined: Sat Feb 11, 2012 11:04 am

Linux Mint is funded by ads and donations.
 

Re: View of Terminal Commands in GUI

Postby viking777 on Sat Mar 10, 2012 1:12 pm

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.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: View of Terminal Commands in GUI

Postby PrimaryOvertone on Sat Mar 10, 2012 1:20 pm

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.).
Linux Mint 12 (64 bit) with GNOME shell on
Acer Aspire one 722 with 2GB RAM
PrimaryOvertone
Level 1
Level 1
 
Posts: 15
Joined: Sat Feb 11, 2012 11:04 am

Re: View of Terminal Commands in GUI

Postby viking777 on Sat Mar 10, 2012 2:11 pm

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
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: View of Terminal Commands in GUI

Postby xenopeek on Sun Mar 11, 2012 7:29 am

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: viewtopic.php?f=213&t=77062
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15245
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands


Return to Suggestions & New Ideas

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests