iT-222 OpeRaTinG SySteM

Friday, December 01, 2006

Unix commands reference card

Environment Control

Command Description

cd d Change to directory d

mkdir d Create new directory d

rmdir d Remove directory d

mv f1 [f2...] d Move file f to directory d

mv d1 d2 Rename directory d1 as d2

passwd Change password

alias name1 name2 Create command alias (csh/tcsh)

alias name1="name2" Create command alias (ksh/bash)

unalias name1[na2...] Remove command alias na

ssh nd Login securely to remote node

exit End terminal session

setenv name v Set env var to value v (csh/tcsh)

export name="v" set environment variable to value v (ksh/bash)



Output, Communication, & Help

Command Description

lpr -P printer f
or
lp -d printer f Output file f to line printer

script [f] Save terminal session to f

exit Stop saving terminal session

mailx username Send mail to user

man name Unix manual entry for name


Process Control

Command Description

CTRL/c * Interrupt processes

CTRL/s * Stop screen scrolling

CTRL/q * Resume screen output

sleep n Sleep for n seconds

jobs Print list of jobs

kill % Kill job n

ps Print process status stats

kill -9 n Remove process n

CTRL/z * Suspend current process

stop %n Suspend background job n

cmmd& Run cmmd in background

bg [%n] Resume background job n

fg [%n] Resume foreground job n

exit Exit from shell

Environment Status

Command Description

ls [d] [f...] List files in directory

ls -1 [f...] List files in detail

alias [name] Display command aliases

printenv [name] Print environment values

quota Display disk quota

date Print date & time

who List logged in users

whoami Display current user

finger [username] Output user information

chfn Change finger information

pwd Print working directory

history Display recent commands

! n Submit recent command n

File Manipulation

Command Description

vi [f] Vi fullscreen editor

emacs [f] Emacs fullscreen editor

ed [f] Text editor

wc f Line, word, & char count

cat f List contents of file

more f List file contents by screen

cat f1 f2 >f3 Concatenates f1 & f2 into f3

chmod mode f Change protection mode of f

cmp f1 f2 Compare two files

cp f1 f2 Copy file f1 into f2

sort f Alphabetically sort f

split [-n] f Split f into n-line pieces

mv f1 f2 Rename file f1 as f2

rm f Delete (remove) file f

grep 'ptn' f Outputs lines that match ptn

diff f1 f2 Lists file differences

head f Output beginning of f

tail f Output end of f

Compiler

Command Description

cc [-o f1] f2 C compiler

lint f Check C code for errors

f77 [-o f1] f2 Fortran77 compiler

pc [-o f1] f2 Pascal compiler

Working with NFS files

Files saved on the UITS central Unix computers Steel, the Parallel PC cluster, Solar/Lunar, and the Research SP are stored on the Network File Server (NFS). That means that your files are really on one disk, in directories named for the central Unix hosts on which you have accounts.

No matter which of these computers you are logged into, you can get to your files on any of the others. Here are the commands to use to get to any system directory from any other system:

cd /N/u/username/PPPC/
cd /N/u/username/Cobalt/
cd /N/u/username/Solar/
cd /N/u/username/Steel/
cd /n/u/username/SP/

Be sure you use the capitalization just as you see above, and substitute your own username for "username".

For example, if Jessica Rabbit is logged into her account on Steel, and wants to get a file on her SP account, she would enter:

cd /N/u/jrabbit/SP/

Now when she lists her files, she'll see her SP files, even though she's actually logged into Steel.

You can use the ordinary Unix commands to move files, copy files, or make symbolic links between files. For example, if Jessica Rabbit wanted to move "file1" from her Steel directory to her SP directory, she would enter:

mv -i /N/u/jrabbit/Steel/file1 /N/u/jrabbit/SP/

This shared file system means that you can access, for example, your SP files even when you are logged into Steel, and vice versa. However, if you are logged into the SP, you can only use the software installed on SP -- only users' directories are linked together, not system directories.

Abbreviations used in this document

CTRL/x hold down control key and press x

d directory

env environment

f filename

n number

nd computer node

prtr printer

ptn pattern

var variable

[y/n] yes or no

[] optional arg

... list

Wednesday, November 22, 2006

What is operating System?

The most important program that runs on a computer. Every general-purpose computer must have an operating system to run other programs. Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, and controlling peripheral devices such as disk drives and printers.

For large systems, the operating system has even greater responsibilities and powers. It is like a traffic cop -- it makes sure that different programs and users running at the same time do not interfere with each other. The operating system is also responsible for security, ensuring that unauthorized users do not access the system.

Operating systems can be classified as follows:
  • multi-user :
Allows two or more users to run programs at the same time. Some
operating systems permit hundreds or even thousands of concurrent users.
  • multiprocessing :
Supports running a program on more than one CPU.
  • multitasking :
Allows more than one program to run concurrently.
  • multithreading :
Allows different parts of a single program to run concurrently.
  • real time:
Responds to input instantly. General-purpose operating systems, such as DOS and UNIX, are not real-time.

Operating systems provide a software platform on top of which other programs, called application programs, can run. The application programs must be written to run on top of a particular operating system. Your choice of operating system, therefore, determines to a great extent the applications you can run. For PCs, the most popular operating systems are DOS, OS/2, and Windows, but others are available, such as Linux.

As a user, you normally interact with the operating system through a set of commands. For example, the DOS operating system contains commands such as COPY and RENAME for copying files and changing the names of files, respectively. The commands are accepted and executed by a part of the operating system called the command processor or command line interpreter. Graphical user interfaces allow you to enter commands by pointing and clicking at objects that appear on the screen.



operating system


What are the various components of an Operating System?

In this section we look at that part of the operating system that is responsible for running programs, called the real-time executive or kernel.

An operating system for a large-scale computer that is used by many people at once is a very complex system. It contains many millions of lines of instructions (commands that the computer executes) written by programmers. To make operating systems easier to write, they are constructed as a series of modules (programs), each module responsible for one function.

Kernel (also known as the executive)

The central module of an operating system. It is the part of the operating system that loads first, and it remains in main memory. Because it stays in memory, it is important for the kernel to be as small as possible while still providing all the essential services required by other parts of the operating system and applications. Typically, the kernel is responsible for memory management, process and task management, and disk management.

What the Process Manager is and what you can do with it:

  • you can easily see what's happening behind the desktop
  • which processes are running on your computer
  • you can see all modules which are loaded, or only those used by a particular process
  • you're the master: Process Manager lets you close normally or kill any running process
  • register and unregister modules
  • complete information about process and modules
  • see Windows error codes
  • consult environment variables
  • search for modules on the disk
  • export the information for further use in Excel

So, with one quick look you can see that Process Manager is the tool you're looking for a long time, it shows you the backstage of your computer, and more, it lets you control things.

Scheduler

computer hardware that arranges jobs to be done by the computer in an appropriate order. In general-purpose operating systems, the goal of the scheduler is to balance processor loads, and prevent any one process from either monopolizing the processor or being starved for resources. In real-time environments, such as devices for automatic control in industry (for example robotics), the scheduler also must ensure that processes can meet deadlines; this is crucial for keeping the system stable.

File Manager

A
software tool that provides a user interface to work with computer files. The most common operations on files are Create, Open, Edit, View, Print, Play, Rename, Move, Copy, Delete, Attributes, Properties, Search/Find. Typically files are displayed in a hierarchy. File managers may contain features inherited from Web browsers, including forward and back navigational buttons.


Sources:
http://www.webopedia.com/TERM/k/kernel.html
http://www.efsoftware.com/pm/e.htm
http://www.webopedia.com/TERM/o/operating_system.html