Sunday, December 3, 2006

Unix Command
In the table below we summarize the more frequently used commands on a Unix system. In this table, as in general, for most Unix commands, file, could be an actual file name, or a list of file names, or input/output could be redirected to or from the command.Unix CommandsCommand/Syntaxawk/nawk [options] filescan for patterns in a file and process the resultscat [options] fileconcatenate (list) a filecd [directory]change directorychgrp [options] group filechange the group of the filechmod [options] file change file or directory access permissionschown [options] owner filechange the ownership of a file;
chsh (passwd -e/-s)
username login_shellchange the user's login shell (often only by the superuser)cmp [options] file1 file2compare two files and list where differences occur (text or binary files)compress [options] filecompress file and save it as file.Zcp [options] file1 file2copy file1 into file2; file2 shouldn't already exist.
This command creates or overwrites file2.cut (options) [file(s)]cut specified field(s)/character(s) from lines in file(s)date [options]report the current date and timedd [if=infile] [of=outfile]
[operand=value]copy a file, converting between ASCII and EBCDIC or
swapping byte order, as specifieddiff [options] file1 file2compare the two files and display the differences (text files only)df [options] [resource]report the summary of disk blocks and inodes free and in usedu [options]
[directory or file]report amount of disk space in useecho [text string]echo the text string to stdouted or ex [options] fileUnix line editorsemacs [options] filefull-screen editorexpr argumentsevaluate the arguments. Used to do arithmetic, etc. in the shell.file [options] fileclassify the file typefind directory [options]
[actions]find files matching a type or patternfinger [options]
user[@hostname]report information about users on local and remote machinesftp [options] hosttransfer file(s) using file transfer protocolgrep [options] 'search string' argumentegrep [options] 'search string' argumentfgrep [options] 'search string' argumentsearch the argument (in this case probably a file) for
all occurrences of the search string, and list them.gzip [options] filegunzip [options] filezcat [options] filecompress or uncompress a file. Compressed files are stored with a .gz endinghead [-number] filedisplay the first 10 (or number of) lines of a filehostnamedisplay or set (super-user only) the name of the current machinekill [options] [-SIGNAL]
[pid#] [%job]send a signal to the process with the process id number (pid#) or
job control number (%n). The default signal is to kill the process.ln [options] source_file targetlink the source_file to the targetlpq [options]lpstat [options]show the status of print jobslpr [options] filelp [options] fileprint to defined printerlprm [options]cancel [options]remove a print job from the print queuels [options] [directory or file]list directory contents or file permissionsmail [options] [user]mailx [options] [user]Mail [options] [user]simple email utility available on Unix systems.
Type a period as the first character on a new line to send message out,
question mark for help.man [options] commandshow the manual (man) page for a commandmkdir [options] directorymake a directorymore [options] fileless [options] filepg [options] filepage through a text filemv [options] file1 file2move file1 into file2od [options] fileoctal dump a binary file, in octal, ASCII, hex, decimal, or character mode.passwd [options]set or change your passwordpaste [options] filepaste field(s) onto the lines in filepr [options] filefilter the file and print it on the terminalps [options]show status of active processespwdprint working (current) directoryrcp [options] hostnameremotely copy files from this machine to another machinerlogin [options] hostnamelogin remotely to another machinerm [options] fileremove (delete) a file or directory (-r recursively deletes the directory
and its contents)(-i prompts before removing files)rmdir [options] directoryremove a directoryrsh [options] hostnameremote shell to run on another machinescript filesaves everything that appears on the screen to file until exit is executedsed [options] filestream editor for editing files from a script or from the command linesort [options] filesort the lines of the file according to the options chosensource file. fileread commands from the file and execute them
in the current shell. source: C shell, .: Bourne shell.strings [options] filereport any sequence of 4 or more printable characters ending in
or . Usually used to search binary files for ASCII strings.stty [options]set or display terminal control optionstail [options] filedisplay the last few lines (or parts) of a filetar key[options] [file(s)]tape archiver--refer to man pages for details on creating, listing,
and retrieving from archive files. Tar files can be stored on tape or disk.tee [options] filecopy stdout to one or more filestelnet [host [port]]communicate with another host using telnet protocoltouch [options] [date] filecreate an empty file, or update the access time of an existing filetr [options] string1 string2translate the characters in string1 from stdin into those in string2 in stdoutuncompress file.Zuncompress file.Z and save it as a fileuniq [options] fileremove repeated lines in a fileuudecode [file]decode a uuencoded file, recreating the original fileuuencode [file] new_nameencode binary file to 7-bit ASCII, useful when sending via email,
to be decoded as new_name at destinationvi [options] filevisual, full-screen editorwc [options] [file(s)]display word (or character or line) count for file(s)whereis [options] commandreport the binary, source, and man page locations for the command namedwhich command reports the path to the command or the shell alias in usewho or wreport who is logged in and what processes are runningzcat file.Zconcatenate (list) uncompressed file to screen, leaving file compressed on disk

Thursday, November 23, 2006

What are the Functions and Components of a Operating System?
An operating system has two functions. It acts as a resource manager on the one side and a virtual machine on the other side. The resource manager of the operating system manages allocation of memory, processing time and disk space. The virtual machine should provide a nice user interface, other than the bare hardware would provide.UNIX for instance has a resource manager, which allocates memory and processing time in a very efficient way. However the virtual machine leaves a lot to be desired on most UNIX systems. The Apple Macintosh in contrast provides a very nice virtual machine with its graphical user interface, but lacks features like protecting programs from each other and fair distribution of processor time. MS-DOS unfortunately provides neither a powerful resource manager nor a friendly virtual machine.
An operating system provides two main services: Filemanagement and Processmanagement.FilesProcessesShells
FilesFiles are used to store data and directories are a way of organising files in a hierarchical structure. What UNIX does differently from DOS and other systems is the way it organises different physical storage devices.In DOS there are individual drive names (actually letters from A to Z) denoting the different drives. In UNIX there is essentially just one virtual drive. All physical drives are sub-directories of this virtual drive or other drives.Example: In DOS the first floppy disk drive is always A: and the first hard disk is always C:. When copying a file from the floppy disk directory flop_dir to the hard disk directory hard_dir, we issue the following instruction:copy A:\flop_dir\file C:\hard_dir
ProcessesA process is basically a program in execution. It consists of a program, its data, its ownership information (UID), the current position at which the computer is in the programs execution and all the other information needed to run the program. The UNIX operating system will occasionally decide to halt a process running and run another process. This gives every process its fair share of processing time. A process is also halted if it is waiting for some I/O operation to finish, like accessing a printer.When a process is halted the operating system has to store all the information about the processes current state, so that the process can later be restarted exactly where it left off.Processes can start other processes. These child processes have exactly the same ownership and permissions as the parent processes. Parents can control their children and send them signals. The operating system can also send signals to processes. Their are a wide variety of signals, and most programs react to signals by dying. There are a number of programs though, which are mostly operating system related and take more intelligent action towards signals sent to them.
ShellsThe strict definition of an operating system limits it to only the basic program which runs the computer and provides systems calls to the users' programs. Usually the command interpreter or shell is not considered part of the operating system. But without the shell, which executes users' commands and programs, and is the primary interface between the computer and the user, a computer would be virtually impossible to use.The basic function of a shell is to allow users to execute programs. Many advanced shells though have features which allow writing of scripts, command-line completion and command-line histories.
source:www.ask.com
Posted by Anabel Española Cañete at 7:29 PM 0 comments

Assignment #2 - November 22,2006
Operating SystemThe 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.
source:www.google.com
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.
source www.ask.com

Thursday, November 16, 2006