Linux Commands
Linux Commands
LINUX COMMANDS
Linux Commands
UNIX Commands
A command is a program which interacts with the
kernel to provide the environment and perform the
functions called for by the user.
UNIX Shell
The shell sits between you and the operating
system, acting as a command interpreter.
UNIX Shell
The original shell was the Bourne shell, sh.
Every Unix platform will either have the Bourne shell,
or a Bourne compatible shell available.
The default prompt for the Bourne shell is $ (or #, for
the root user).
Another popular shell is C Shell. The default prompt
for the C shell is %.
Linux Commands
UNIX Shell
Numerous other shells are available from the network.
Almost all of them are based on either sh or csh with
extensions to provide job control to sh, allow in-line
editing of commands, page through previously executed
commands, provide command name completion and
custom prompt, etc.
Some of the more well known of these may be on your
favorite Unix system: the Korn shell, ksh, by David Korn
and the Bourne Again SHell, bash, from the Free Software
Foundations GNU project, both based on sh, the T-C shell,
tcsh, and the extended C shell, cshe, both based on csh.
Linux Commands
Shell Programming
You can write shell programs by creating scripts
containing a series of shell commands.
Shell Programming
The first line is followed by commands
Within the scripts # indicates a comment from that point
until the end of the line, with #! being a special case if
found as the first characters of the file.
#!/bin/bash
cd /tmp
mkdir t
You also need to specify that the script is executable by
setting the proper bits on the file with chmod, e.g.:
$ chmod +x shell_script
Linux Commands
LINUX COMMANDS
File Management and Viewing
Filesystem Mangement
Help, Job and Process Management
Network Management
System Management
User Management
Printing and Programming
Document Preparation
Miscellaneous
Linux Commands
Command Structure
Command <Options> <Arguments>
Multiple commands separated by ; can be executed
one after the other
Linux Commands
Pipes
An important early development in Unix was the
invention of "pipes," a way to pass the output of one
tool to the input of another.
eg. $ who | wc −l
By combining these two tools, giving the wc
command the output of who, you can build a new
command to list the number of users currently on the
system
Linux Commands