LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is a Shell? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-a-shell-21065/)

chosmer 05-15-2002 08:44 PM

What is a Shell?
 
Comming from the MSFT world, Im used to being able to run executables from the command line if I am in the directory where the app is located....or if my path is setup correctly.

I recently discovered situations where I cant run apps in linux even when I am cd..'d into the same relative path or location.

I am told that the "shell" is different than dos. I already know that, but would like a clear rundown on how linux/unix treats paths for root, or users...or users with the su - applied. Is there a howto about this? Does is matter what kind of shell Im in? What properties do different shells have?

dorward 05-15-2002 09:31 PM

A shell is a program that takes user input and passes it to the system.

As far as I know ALL shells use the $PATH environment variable to determine where to look for programs.

You can find your $PATH with the following syntax (I'll assume bash for all examples):

Code:

echo $PATH
On my system this gives me:

Code:

david@cyberman:~/> echo $PATH                                                                                                                                                                                                        [3:29]
/home/david/garnome/bin:/home/david/bin:/opt/wine/bin:/bin:/usr/bin:/usr/X11R6/bin:/opt/mplayer/bin:/usr/local/bin
david@cyberman:~/>

The shell will look only in those directories for programs, you can set it to look for programs with whatever the current working directory is by adding "." to the $PATH. However I wouldn't bother, the programs you run regulary should be in the bin directories, when you want to run a program that isn't in your $PATH you can provide a path to it.

For example, to run "foo" in the currect directory:

Code:

./foo

sewer_monkey 05-15-2002 09:35 PM

The most popular shell nowadays is bash, and it's also the default in many Linux distributions. For more info on bash, see the following:

http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html

trickykid 05-15-2002 09:52 PM

I actually have submitted this as a term in our LQ glossary under shell in the S section of course, take a look here: http://www.linuxquestions.org/questions/glossary.php

ravenarts 05-15-2002 10:25 PM

I gotta say - thanks for this forum, ive been fumbling around for a month now, and one day here has helped me hugely!

about bin/bash and bin/sh when i created a user today it defaulted to bin/sh this user has a virtual server and will only be given ftp access to a restricted directory - (via chroot next question) should I alter their shell to bin/bash? -

trickykid 05-16-2002 01:18 AM

Quote:

Originally posted by ravenarts
I gotta say - thanks for this forum, ive been fumbling around for a month now, and one day here has helped me hugely!

about bin/bash and bin/sh when i created a user today it defaulted to bin/sh this user has a virtual server and will only be given ftp access to a restricted directory - (via chroot next question) should I alter their shell to bin/bash? -

it depends on what the user may really prefer. either will work, but bash is usually the default and plus it has more features/functions which in most cases makes it easier to work with.

fatgod 05-16-2002 07:20 AM

users who are for ftp access _only_ should not have a shell at all.

users without a shell will be able to access services on the box but will not be able to login through ssh or telnet.


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