June 02, 2008

Get Used to the Command Line in Linux, Part 3

Notice: This is the third part of the series Get Used to the Command Line in Linux. You can find the first two parts here (basic concepts) and here (basic system maintenance).

Part 3: Shell built-ins

Shell built-ins are commands included in the Bash program. Simple commands you give to the shell like cd, echo or pwd are all shell built-ins.

To see if a command is a stand-alone program or a shell built-in, use the type command:

$ type cd
cd is a shell built-in
$ type bash
bash is hashed (/bin/bash)

If the specified command is an alias, the output will be something like:

$ type ls
ls is aliased to `ls --color=auto'

You can use the help built-in to see a list of Bash commands, and help to see detailed help about each command.

The following describes several shell built-ins:

cd change current/working directory
help display helpful information about built-in commands
echo output the arguments given to it
pwd print the current working directory
bg place each job specified as argument in the background
fg place the job specified as argument in the foreground and make it the current task


Updated: June 09, 2008 (Created: June 01, 2008)

No comments: