CentOS Linux Server Guide

Centos Linux Command Line Operation

What is a shell?

 

A shell is an interpreter within human and kernel. It is a layer of programming language that understand and executes commands from the a file or a standard input device, for example keyboard. Please take note that shell is not part of the Linux kernel system.  A shell usually implies an interface with a command syntax (think of the DOS operating system and its "C:>" prompts. For CentOS and other linux distros, it look like this

[
[root@srv1 ~]#

 

or

 
[jane@srv1 ~]$

 

 

So? Why must we need a shell? Can we communicate with kernel directly? The answer is NO. This because both human and machines (system) are 'talking' in different language (still remember the movie- The Matrix, where the green codes running  at the background?). Thus  we need a medium to understand those binaries  and then understand, translate and execute the code for us.

 

 

There are few available shell for command Linux distros.

  • BASH ( Bourne-Again SHell )

  • CSH (C SHell)

  • KSH (Korn SHell)

Unless, you specify which shell to be used for your system. BASH is the default is the default shell for CentOS Linux (and most of the distro).

 

To see what shell that you are currently using use "echo $SHELL" command
echo $SHELL
/bin/bash

 

 

To check on the ALL users that the shell you are using, login as root, the show the contents of /etc/passwd
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
hsqldb:x:96:96::/var/lib/hsqldb:/sbin/nologin
avahi-autoipd:x:100:101:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
jane:x:500:501:Jane doe:/home/jane:/bin/bash

 

 

Back to Command Line Operation



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy