Sunday, July 20, 2014

Working with linux/unix

Accessing unix systems

Basic commands

date - gives current date and time
who am i - gives the current logged in user

and so many to come...

Keyboard control signals

There are many keyboard signals in unix.
Keyboard shortcut Signal
^C Interrupt command
^Z Suspend command
^D end of file
^H delete last character
^W delete last word
^U delete a line
^S suspend output (rarely used)
^Q continue output (rarely used)

File system commands

Its about moving around file system and viewing files.
cd - change directory
pwd - present working directory

Process commands

In linux, some commands are invoked as new process and some are not.

more - more is invoked as a new process while cd and pwd are internal commands and do not give rise to new process

Online manual

A comprehensive online help is available for all the unix commands. Use man command to get all the information about the command.

man ls

Command format

The shell

Login shell is invoked as the user logs in .

There is a family of shells available on linux/unix:
Shell Symbol Prompt Description
bourne sh $ Original Unix shell written by Steve Bourne of Bell Labs. Available on all UNIX systems. Does not have the interactive facilites provided by modern shells such as the C shell and Korn shell. The Bourne shell does provide an easy to use language with which you can write shell scripts.
korn ksh $ Written by David Korn of bell labs. It is now provided as the standard shell on Unix systems. Provides all the features of the C and TC shells together with a shell programming language similar to that of the original Bourne shell.
c shell csh % Written at the University of California, Berkley. As it name indicates, it provides a C like language with which to write shell scripts.
bourne again bash $ Public domain shell written by the Free Software Foundation under their GNU initiative. Ultimately it is intended to be a full implementation of the IEEE Posix Shell and Tools specification. Widely used within the academic commnity. Provides all the interactive features of the C shell (csh) and the Korn shell (ksh). Its programming language is compatible with the Bourne shell (sh).

Shell wildcards

Wildcards can be used to generate file numbers
* - any number of characters
? - any single character
[ab] - a or b or specified range

I/O redirection

Logging out

You can log out by:
  • Pressing ^D - end of input stream
  • Shome shells require logout or exit. This is configured by shell variable set -c ignoreeof


Post a Comment