LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2009, 02:33 PM   #1
drachenchen
Member
 
Registered: Feb 2006
Location: Kalamazoo, Michigan, in what used to be the USA
Distribution: (Ex-Ubuntu due to Unity), Debian Squeeze, Bodhi w/ E-17 "Stable", MacPup525, Legacy (TeenPup) Live
Posts: 43

Rep: Reputation: 34
Question Seeking CLI learning tool; a "glass-bottomed boat" to output GUI actions to Terminal.


Howdy. I've just spent my morning and half my afternoon googling and searching forums on this question, and I am fresh out of ideas for other ways to phrase it. I think that my technical vocabulary is depleted, because I'm starting to wax metaphorical. I have been using Ubuntu since Dapper Drake, so I'm not a complete Newbie, but I posted here because finding an answer for this question might make it easier to learn CLI, I think. Is there some utility, or a command in Terminal, that would echo the goings-on "under the hood" of the Gnome desktop? I see that Synaptic, for instance, gives you the option of watching the terminal version of what you've just ordered the GUI to download and install. I find those little glimpses very illuminating, like having a glass-bottomed boat to float around on the GUI, and watch all the cool stuff beneath the surface. If I knew how to do this, I think I'd just open a small terminal with that solution, and leave it running all the time. There are so many things that I know how to do from the GUI, but I haven't a clue where to start at the command line. For instance, I can change and customize themes all day long, but to make a "cron" job or an "at time" job out of it? I have no clue what all those GUI commands do, what directories they access to do it, or what files they use. With a glass-bottomed boat, I could look and see.
The only other post I've found that was on this subject was here:

http://www.linuxquestions.org/questi...d.php?t=324214

Unfortunately, they only got one incomplete, KDE-specific answer. I really think that a tool like this would be an enormous help for all of us "visual knowledge" types who are trying to pick up on the "symbolic knowledge" paradigm of CLI. It might furnish many "Aha!" moments. Any ideas or help on this would be greatly appreciated. Thanks!

-drachenchen
 
Old 08-10-2009, 02:45 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Kind of a neat idea. However, generally speaking, I suspect that a lot of what you might see in such a glass-bottom-boat would not be very enlightening or educational to the average user (meaning, *most* of us, who aren't actively trying to debug software)..

One suggestion however, would be, where possible, start any GUI-type applications FROM a console, i.e. Gnome Terminal, and also where possible, enable any debugging flags that there might be available with the GUI-type application.

So, as an example (ONLY an example -- this probably doesn't work), I usually click a button to start 'kinfocenter'; instead, if I open a console, and type "kinfocenter -v -d" the intention would be to turn on debugging, and verbosity. Try the GUI-type application with a -h or --help option, and you may be pleasantly surprised.

It may not work for a lot, or many, or most, applications, but it does work for some.

Sasha
 
Old 08-10-2009, 03:37 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,807
Blog Entries: 27

Rep: Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103
Hi,

If you don't understand the language then how would you interpret what you see? That's the problem with a 'GUI', you are insulated from the shell/cli/scripting. I would suggest that you look at the 'Tutorial' section of 'Slackware-Links'. More than just Slackware® links! There you will find a lot of help to learn shell scripting, cli and several other useful links. The whole wiki has loads of informational links that will keep you busy long into the night for awhile.
 
Old 08-10-2009, 03:46 PM   #4
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42
As far as Synaptic giving you the option of seeing what's happening on the command-line, that isn't a language. Some GUI programs output information of some sort to the command-line, and if you run the program from the command-line, you can see that output.
 
Old 08-10-2009, 05:12 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by drachenchen View Post
Howdy. I've just spent my morning and half my afternoon googling and searching forums on this question, and I am fresh out of ideas for other ways to phrase it. I think that my technical vocabulary is depleted, because I'm starting to wax metaphorical. I have been using Ubuntu since Dapper Drake, so I'm not a complete Newbie, but I posted here because finding an answer for this question might make it easier to learn CLI, I think. Is there some utility, or a command in Terminal, that would echo the goings-on "under the hood" of the Gnome desktop?
Your error here is that you are assuming that all the graphical tools do use command line tools under the hood. Some do, but most don't. Instead they use api calls to libraries of many kinds, specially those that integrate on a desktop like gnome or kde, which is all about reusability of the code.

They will eventually spit out debug info and other stuff to the console if they have one vt asociated to them, but that's not going to teach you anything about what the application is doing nor about how it does its work.

Synaptic is one of the applications that do use command line tools, there are many others, but these are very specialized applications. Most graphical applications work in a very different way.

Being that said, if you are really interested it can be done (but it won't show the kind of info you want to know, not most times).

If you are starting via command line using "startx", it's just as easy as doing this instead:

Code:
startx > ~/mylogfile.log
Then on X just open an xterm (or whatever you prefer), and do:

Code:
tail -f ~/mylogfile.log
It will show whatever is spit out by your x session or any child process (thus, anything you are running inside that X session).

If you use a graphical login manager like gdm, kdm or any other you will probably need to find another way, I know nothing about these these days, it's been years since I've felt the need to use a graphical login manager.
 
Old 08-10-2009, 05:40 PM   #6
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42
From what I know and remember of the Synaptic output (I've never paid very close attention), it's pretty much the same as the output you get when you use apt-get. It isn't even command-line tools, really ... it's just output commenting on what is being done.
 
Old 08-10-2009, 11:17 PM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I like the idea and have been thinking about something similar for a while (read couple of years). My implementation would be slightly different as it would be a commandline tool. A nice little interface/frontend (e.g. ncurses based) to the commands for user maintenance, network configuration etc and showing the user the command that is or will be issued.

Don't think I will ever write it, but the idea is there.
 
Old 08-11-2009, 06:31 AM   #8
dezza
Member
 
Registered: Nov 2004
Location: Denmark
Distribution: ArchLinux, Debian
Posts: 133

Rep: Reputation: 18
http://www.pythonturtle.com is rather nice, not for learning CLI, but Python programming .. After all, shell/cmdline is much alike programming .. I think it's coming for Linux too, right not it's only a Windows program, but it gives OK introduction to Python meanwhile you're better off with having "Byte of Python" or "Dive Into Python" by your side ..
 
Old 08-20-2009, 10:36 PM   #9
drachenchen
Member
 
Registered: Feb 2006
Location: Kalamazoo, Michigan, in what used to be the USA
Distribution: (Ex-Ubuntu due to Unity), Debian Squeeze, Bodhi w/ E-17 "Stable", MacPup525, Legacy (TeenPup) Live
Posts: 43

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by i92guboj View Post
Your error here is that you are assuming that all the graphical tools do use command line tools under the hood. Some do, but most don't. Instead they use api calls to libraries of many kinds, specially those that integrate on a desktop like gnome or kde, which is all about reusability of the code.

They will eventually spit out debug info and other stuff to the console if they have one vt asociated to them, but that's not going to teach you anything about what the application is doing nor about how it does its work.

Synaptic is one of the applications that do use command line tools, there are many others, but these are very specialized applications. Most graphical applications work in a very different way.
That WAS my error, indeed. I had always assumed that the CLI was a layer sandwiched _between_ the GUI and the code! I should have realized that CLI and GUI are both end-user interfaces. Technically, I knew this, but it didn't "click". Like a zen master's stick upside my head, your words. When I get back to my own Linux box this weekend, I will try the logfile business. Thank you very much for this "AHA!" moment.
 
Old 08-21-2009, 10:19 AM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by drachenchen View Post
That WAS my error, indeed. I had always assumed that the CLI was a layer sandwiched _between_ the GUI and the code!
And sometimes it is, for example, mplayer doesn't provide a proper programming api, which means that every frontend will have to run an mplayer command line (with the apropiate switches and that stuff) and then reparent the window into its own frame to "fake" the integration.

However, when a proper api that can be used directly is present, it's usually better idea to use it that to take the approach to run system calls to fork external tools.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
square brackets in output of "ps aux" not matching output of "ps -ejH" alirezan1 Linux - Newbie 14 07-14-2010 04:17 AM
The "Log out" and "Lock screen" actions cannot be executed through keyboard shortcuts Snood Linux - Desktop 0 04-22-2009 09:30 AM
what do you think is the "fastest" linux torrent client? (CLI or GUI) tjwoosta Linux - General 7 01-19-2009 12:50 PM
vim: rich ("gui") colorschemes in a terminal emulator? prell Linux - Software 13 09-10-2008 10:07 AM
Seeking for "Synchronise" and "patients" projects/scripts of Visual Basic LAN-Dominator.nl Programming 2 07-05-2008 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration