LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to run an application from terminal mode (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-run-an-application-from-terminal-mode-671296/)

450Nappa 09-20-2008 04:54 PM

how to run an application from terminal mode
 
Hi All,

I am new to Linux and I have set Fedora 7 to run level 3, I want to how I can run applications from this mode without having to start the desktop, is it possible? if so how do I do it? Please help.

klearview 09-20-2008 05:00 PM

You can run all command-line apps in runlevel 3 just by typing their name. Apps that require a graphical user interface (i.e. Firefox, Ktorrent, Thunderbird) will not run at this level.

mjmwired 09-20-2008 05:00 PM

What is the application you are trying to run?

Just type it in the prompt and if it is designed to use text-only or console, then it will run. If it requires the graphical desktop or X-server, then it will give an error message.

450Nappa 09-20-2008 05:27 PM

Thank you both for you quick response, please forgive me for my ignorance, maybe I have fallen victim to too many movies, To make things more clear I will try to explain what it is I am trying to do, first off I am absolutely new to Linux, never used it b4, some how I made it through the install and everything was fine and it booted into the GUI desktop, I want to instead boot in to the terminal desktop, reason being is I think it would be better for me to jump in the deep end because my aim is to learn the ins and outs of Linux and I figured beginning with the command line interface would force me to swim in this wonderful world, so here I am I am in, and I recall seeing others who use the command line interface are able to open multiple windows running applications, applications that I have only ever run my self from a GUI, web browsers, email, etc .., I have googled my query and found out the thought I should set the run level to 3, I did that now I boot into a command line interface, great, now how do I open a web browser? I googled and learnt to type 'links' but that gives me a text based browser, how to I run firefox or any other grapical app?

Once again, forgive me for my ignorance, and if able please give guidance?


Thanks


450Nappa

XavierP 09-20-2008 05:30 PM

If you want to run a graphical app like Firefox you will need to have X running. You can run all command line commands from a terminal within your desktop though, just as if you had booted to a CLI.

450Nappa 09-20-2008 05:52 PM

Quote:

Originally Posted by XavierP (Post 3286767)
If you want to run a graphical app like Firefox you will need to have X running. You can run all command line commands from a terminal within your desktop though, just as if you had booted to a CLI.

Thanks XavierP, yes your right, when I first booted into the desktop, I was able to start a terminal session by going to system tools, I however, maybe because I'm a newbie, I like the idea of being in CLI and just having any app I want open in different windows, I guess what I am after is a black screen CLI and minimized windows running whatever I want, is this called X Windows? the only book I have at my disposal right now is 'Fedora 7 and Red Hat Enterprise Linux Bible' and this is the only thing I have founding relating to what I want to do, and it doesn't work for me, am I barking up the wrong tree? ..

Here is a procedure to run X applications from a Terminal window:

1.

Open a Terminal window from your desktop (look for a Terminal icon on your Panel or a Terminal selection on a menu.)
2.

Type


$ echo $DISPLAY

The result should be something similar to the following:


:0.0

This indicates that the Terminal window will, by default, direct any X application you run from this window to display 0.0 on your local system. (If you donít see a value when you type that command, type export DISPLAY=:0.0 to set the display value.)
3.

Type the following command:


$ rhythmbox &

klearview 09-20-2008 06:07 PM

You probably should start with learning the absolute basics (i.e. understanding the instructions). In essence your question in post 6 is answered by XavierP in post 5. The instructions you quote in post 6 have nothing to do with runlevel 3 - to run X apps you still need to have X server running - i.e. be in runlevel 5.

450Nappa 09-20-2008 06:29 PM

Quote:

Originally Posted by klearview (Post 3286789)
You probably should start with learning the absolute basics (i.e. understanding the instructions). In essence your question in post 6 is answered by XavierP in post 5. The instructions you quote in post 6 have nothing to do with runlevel 3 - to run X apps you still need to have X server running - i.e. be in runlevel 5.

Thank you Klearview, as you can tell from my posts and replies that I am 'clueless'. What you suggest is exactly what I would like to do, I would greatly appreciate it if yourself or any others can tell me the best way to do so, I am reading through the book 'Fedora 7 and Red Hat Enterprise Linux Bible' but to tell the truth, I am still lost. Am I biting off more than I can chew by jumping into the CLI? How would you suggest one go about learning the absolute basics?


450nappa

klearview 09-20-2008 06:37 PM

There is nothing wrong with jumping into the CLI right away but you need to make sure you understand what the book tells you. The instructions quoted by you assume you are in GUI environment and they tell you to open a terminal emulator - a normal X application (there are various terminal emulators - XTerm, Konsole, gnome-terminal etc). These run just as any other desktop application.

Start with the basics - understanding the concept of runlevels, basic commands, navigation etc. Do not complicate things right away - for example, by changing default runlevel to 3.

450Nappa 09-20-2008 07:20 PM

Quote:

Originally Posted by klearview (Post 3286805)
There is nothing wrong with jumping into the CLI right away but you need to make sure you understand what the book tells you. The instructions quoted by you assume you are in GUI environment and they tell you to open a terminal emulator - a normal X application (there are various terminal emulators - XTerm, Konsole, gnome-terminal etc). These run just as any other desktop application.

Start with the basics - understanding the concept of runlevels, basic commands, navigation etc. Do not complicate things right away - for example, by changing default runlevel to 3.

Thanks again Klearview, I really do appreciate you taking the time to converse with me. I am going to switch my default boot back to run level 5, it may be a simple process but to me i feel I have accomplished some thing by just being able to do that after making it through the install. After this reply I am going to read up on run levels. As for basic commands I know quite a few, cd, pwd, id, ls, |--less, netsta, free, and others, as for what to do with them I'm lost, its like I'm all dressed up with nowhere to go, I feel like I have a foreign language dictionary and can pronounce words but don't know how to put together sentences, hope I am not boring you with my ignorance.


450nappa

jschiwal 09-20-2008 08:59 PM

About 100 commands are supplied by a single package, coreutils. The info manual for coreutils is organized by the type of command. Your basic commands like cd, pwd, id, less, cp, mkdir, etc. are among them. It also includes a large number of useful text processing commands such as sort, cut, head, tail. Some commands like "fold" you might never use. Others are real pearls that you will find indispensable.

One thing I would highly recommend in the future is installing the source package for coreutils and running
"make && make pdf" in the source directory. This will create a print worthy manual that you could put in a 3-ring binder.

Since you really want to dig into using the console, I would highly recommend downloading the "Advanced Bash Scripting Guide", abs-guide.pdf from the http://www.tldp.org (The Linux Documentation Project) website. Don't let the "Advanced" scare you off. This book is composed of well commented examples. Open up the pdf on the top part of the screen and a console in the bottom half and try them out for yourself. Doing things yourself is the best way to learn.

Good Luck!

450Nappa 09-20-2008 10:38 PM

Quote:

Originally Posted by jschiwal (Post 3286855)
About 100 commands are supplied by a single package, coreutils. The info manual for coreutils is organized by the type of command. Your basic commands like cd, pwd, id, less, cp, mkdir, etc. are among them. It also includes a large number of useful text processing commands such as sort, cut, head, tail. Some commands like "fold" you might never use. Others are real pearls that you will find indispensable.

One thing I would highly recommend in the future is installing the source package for coreutils and running
"make && make pdf" in the source directory. This will create a print worthy manual that you could put in a 3-ring binder.

Since you really want to dig into using the console, I would highly recommend downloading the "Advanced Bash Scripting Guide", abs-guide.pdf from the http://www.tldp.org (The Linux Documentation Project) website. Don't let the "Advanced" scare you off. This book is composed of well commented examples. Open up the pdf on the top part of the screen and a console in the bottom half and try them out for yourself. Doing things yourself is the best way to learn.

Good Luck!

Thank You jschiwal,

I will get on that right now. jschiwal I have a question that I'm sure u can answer and I'm sure would assist my development. If a newbie approached you and claimed to know the basics and dared u to give the 5 questions that you feel if they claim to know the basics they ought to know, what 5 question would u give them?

Obviously, the purpose of this is for me to basically take your questions and treat them as homework and go and do investigating, if your not able to I understand, its just that exercises like this I find is the most beneficial way I learn.


450Nappa

jschiwal 09-22-2008 03:51 PM

1. What is the basic philosophy behind Unix.
2. How do you piece together small commands to perform a more useful task.
2. Use variable expansion in bash to extract the dirname and basename from a full pathname.
3. What would you do to make ssh more secure.
4. Suppose that you wanted samba to offer a globally writable share that allows "guest" access. How would you prepare
  1. What is the basic philosophy behind Unix.
  2. How do you piece together small commands to perform a more useful task.
  3. Use variable expansion in bash to extract the dirname and basename from a full pathname.
  4. What would you do to make ssh more secure.
  5. Suppose that you wanted samba to offer a globally writable share that allows "guest" access. How would you create the directory to be shared.
  6. Why do you want to mount a pendrive with the "noatime" option.
  7. If you create an entry in /etc/fstab to mount an external drive, what would you use for the device field. (hint: use udevinfo to get the info)
  8. Create a large file using "dd" and prepare a filesystem on it. Mount it and copy files to it.
  9. Modify a text file, changing all occurrences of colour to color. (hint: using cat before sed is a fail. Using grep before a sed command in lieu of /<pattern>/ is a fail.)
  10. Locate all identical jpegs. They may be in various subdirectories and have different filenames.

Here are some common newbie mistakes.
  • preceding a sed command with a cat command instead of using a file argument.
  • Writing a script that prompts for arguments instead of one that takes the arguments supplied after the command name.
  • Using the read command unnecessarily. A Linux/Unix program should use common tools like sed, tr, awk, sort and cut as filters, simply piping them together. The use of the read command shows a misunderstanding of a basic advantage using Unix/Linux. The book "Learning the Bash Shell" by O'Reilly has an explanation.
  • Looking for a compiled program to perform a simple task when a 3 line bash script will do. This shows that the User is from Windows where common tasks are performed by searching for a Freeware/Shareware program to do something simple. Some habits are hard to break.

One of the features of Linux is its ability to handle a large number of filesystems. This is beyond newbie level, but if you become familiar with using dd, and losetup you can work with filesystems and images of filesystems, including disk images. You will be able to help others who run into problems on their Linux or Windows computers.

Linux was used in the service department in Sun to migrate data from a competitor machines disk. Sun's Unix didn't have support for as many filesystems as Linux does. "Maddog" Hall recommended Linux to a person at work to find out that they had already been using it for its filesystem support.

As an extra credit project, how would you mount a partition inside a disk image. Imagine that you have a disk image of a hard drive and the user trashed the partition table. How would you locate, identify and mount the partitions in the image. How would you recreate the partition table.


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