LinuxQuestions.org
Register a domain and help support LQ
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 05-15-2002, 09:44 PM   #1
chosmer
Member
 
Registered: Feb 2002
Location: Vermont
Distribution: Fedora Cores
Posts: 39

Rep: Reputation: 15
Question 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?
 
Old 05-15-2002, 10:31 PM   #2
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
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
 
Old 05-15-2002, 10:35 PM   #3
sewer_monkey
Member
 
Registered: May 2002
Location: Toronto, ON, Canada
Distribution: Ubuntu, Debian, RedHat/CentOS
Posts: 624

Rep: Reputation: 31
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
 
Old 05-15-2002, 10:52 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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
 
Old 05-15-2002, 11:25 PM   #5
ravenarts
LQ Newbie
 
Registered: May 2002
Location: canada
Distribution: Redhat Linux 7.2
Posts: 6

Rep: Reputation: 0
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? -
 
Old 05-16-2002, 02:18 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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.
 
Old 05-16-2002, 08:20 AM   #7
fatgod
Member
 
Registered: Mar 2002
Location: Edinburgh, Scotland
Distribution: Suse 7.2, Gentoo 1.4, Solaris 9
Posts: 661

Rep: Reputation: 30
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.
 
  


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
Difference between normal shell and login shell Manish Linux - General 7 11-14-2012 09:30 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 03:14 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 10:20 AM
shell interface vs shell scripting? I'm confused jcchenz Linux - Software 1 10-26-2005 04:32 PM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 04:00 PM


All times are GMT -5. The time now is 10: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