LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 06-18-2004, 12:45 PM   #1
Error1312
Member
 
Registered: Feb 2004
Location: Belgium
Distribution: Ubuntu 10.04 Lucid Lynx
Posts: 140

Rep: Reputation: 15
Problem starting programs from commandline


Hi everybody.

I'm having a problem with starting applications from the commandline
(= terminal on KDE). For example: I enter 'Konqueror' but it says 'command not found'. The same with commands like 'KFloppy' and 'Mozilla'.
I really need to start them from the command line, otherwise, if I want to run them as root, I have to log out, than log in again as root and than run the program.

I thought that maybe the path is set up in a wrong way, however I don't know how to change it (if that is the problem, of course).

Does somebody know how to fix this problem?

Thanks in advance.
 
Old 06-18-2004, 12:59 PM   #2
aaa
Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
They are all uncapitalized. If it still doesn't work, then they might not be in your PATH (compare the output of 'echo $PATH' in regular user and root). You can just type the full path to the program in that case (try looking in /opt/kde/bin, /usr/bin, /usr/local/bin (they should be in the PATH)).
Also, if you get 'cannot connect to screen :0.0', try running 'xhost +local:' as regular user first.

Last edited by aaa; 06-18-2004 at 01:00 PM.
 
Old 06-18-2004, 01:13 PM   #3
Error1312
Member
 
Registered: Feb 2004
Location: Belgium
Distribution: Ubuntu 10.04 Lucid Lynx
Posts: 140

Original Poster
Rep: Reputation: 15
Thanks for your help aaa. I managed to start konqueror by typing:
/opt/kde/bin/konqueror from the command line.

Now I was wondering if there is a way to store the full path in a file (so it can be found by PATH), so I don't have to type the full path before the command.

Is there any way to do this?
 
Old 06-18-2004, 01:20 PM   #4
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 45
konqueror should start without typing the full path. Did you try just
konqueror

To add a path to a directory to your PATH environment variable. Put this in the file ~/.bashrc
export PATH=$PATH:/path_to_directory

Or you could put an alias in ~/.bashrc
alias konqueror='opt/kde/bin/konqueror'
 
Old 06-18-2004, 01:37 PM   #5
AxelFendersson
Member
 
Registered: Mar 2004
Location: Darkest Oxfordshire
Distribution: Arch, Slackware
Posts: 184

Rep: Reputation: 30
If you're feeling lazy, you could just make your terminals open a new login shell. For a GNOME terminal, click on Edit -> Current Profile -> Title and Command -> Run command as a login shell. I'm not sure about Konsole or xterm, but I imagine it's something similar. This way, /etc/profile gets run each time a new terminal is opened, so you should get the correct path, prompt etc without having to mess about with .bashrc . This is arguably not the 'proper' way to do it, but it is a lot easier than trying to write a .bashrc with everything you need in it, and it's never caused me any problems.

Last edited by AxelFendersson; 06-18-2004 at 01:40 PM.
 
Old 06-18-2004, 01:38 PM   #6
Error1312
Member
 
Registered: Feb 2004
Location: Belgium
Distribution: Ubuntu 10.04 Lucid Lynx
Posts: 140

Original Poster
Rep: Reputation: 15
Where can you find the file /.bashrc? I found a file called 'bash' in the
/bin directory, but gedit says it can't open it because there are some strange characters in it.
 
Old 06-18-2004, 01:58 PM   #7
AxelFendersson
Member
 
Registered: Mar 2004
Location: Darkest Oxfordshire
Distribution: Arch, Slackware
Posts: 184

Rep: Reputation: 30
Quote:
Quoth Error1312
Where can you find the file /.bashrc?
It's ~/.bashrc you're looking for, not /.bashrc, and it doesn't exist yet. By default, Slackware doesn't create a .bashrc for new users. Do NOT try to modify /bin/bash - that's the shell program that interprets your commands. Break that and your system is seriously screwed (unless you're using an alternative shell, but let's not go into that).

Essentially there are two startup scripts for new shells, .bashrc and .bash_profile . When you start a new shell, then bash will run the .bashrc script in your home folder. If that doesn't exist, it will look for a global alternative at /etc/bashrc . A new login shell, however will try to run .bash_profile (again from your home folder) instead, and if that doesn't exist, it will look for /etc/profile . By default in Slackware, the only one of these four files that exists is /etc/profile . What this means is that login shells will all use /etc/profile , and will have a sensible prompt, path and so on, but regular shells will use the default prompt for bash, and have nothing in the path. You can try to create your own .bashrc , maybe using /etc/profile as a guide to what to put in it (this is the 'right' way of doing it), or you can just make sure that all new shells are login shells (which is significantly easier).

Last edited by AxelFendersson; 06-18-2004 at 02:03 PM.
 
Old 06-18-2004, 02:04 PM   #8
aaa
Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
'~' == your home directory
 
Old 06-18-2004, 02:36 PM   #9
AxelFendersson
Member
 
Registered: Mar 2004
Location: Darkest Oxfordshire
Distribution: Arch, Slackware
Posts: 184

Rep: Reputation: 30
Quote:
Quoth aaa
'~' == your home directory
Sorry, I should have made that clearer.

BTW, in Konsole (KDE terminal emulator) you can make sure you always get a login shell by clicking on Settings -> Configure Konsole... -> Session

Then select 'Shell' from the list, and enter "bash -l" in the Execute field near the top.

Click Ok, then Save.

Also, I notice that your profile says you're running Mandrake and Fedora. I think that Mandrake automatically creates a .bashrc , and Fedora probably does, too. If so, you could copy it over to your home folder on any other distro and it would would probably work fine, so you wouldn't have to mess around with login prompts. Give it a try and see.

Last edited by AxelFendersson; 06-18-2004 at 02:41 PM.
 
Old 06-19-2004, 01:42 AM   #10
Error1312
Member
 
Registered: Feb 2004
Location: Belgium
Distribution: Ubuntu 10.04 Lucid Lynx
Posts: 140

Original Poster
Rep: Reputation: 15
Thanks for your help guys. I haven't found the time to try it all yet, but I try to check it out before the end of the day.

By the way, AlexFendersson, I apologize for my wrong profile. It dates back a few weeks ago. Now I'm running Slackware, and it runs smoother than anything else before.
 
Old 06-20-2004, 09:16 AM   #11
Error1312
Member
 
Registered: Feb 2004
Location: Belgium
Distribution: Ubuntu 10.04 Lucid Lynx
Posts: 140

Original Poster
Rep: Reputation: 15
Thanks guys, it worked. I have to take a 'Linux Console' instead of a normal shell.

Thanks for all your help.
 
  


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
Linking Programs to the commandline BorgKiller Linux - Software 2 04-05-2005 09:10 PM
Quick Question, Starting GUI from Commandline DemonicCrusader Linux - Newbie 5 04-03-2005 02:07 PM
creating graphical front ends to commandline programs seidren Programming 5 02-05-2004 02:21 PM
ndiswrapper commandline problem lnxusr Linux - Software 2 01-10-2004 08:47 PM
Frozen-Bubble: starting from commandline? tigerflag Linux - Software 4 07-07-2003 11:28 PM


All times are GMT -5. The time now is 06:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration