You are on page 1of 6

ASSIGENMENT ON NETWORK OPERATING SYSTEM

SUBMITTED TO: A ash Bhardawj Sir 11008945

SUBMITTED BY: Ram Narayan Patel K2R21 (05)

Q1: List various Commands used to perform following operations a) Ma e your Home Directory your current directory. b) To display who is logged in your system. c) To change password for the current user. d) To move the directory /usr/local to /opt/pgms. e) To list various files and directories in current wor ing directory. Ans:a) Ma e your Home Directory your current directory. Use the 'cd' command without any target; that always puts you in the home direct ory which becomes by default the wor ing directory. b) To display who is logged in your system. who command is used to get the list of the usernames who are currently logged in . Output of the who command contains the following columns: user name, tty numbe r, date and time, machine address. $ who ramesh pts/0 2009-03-28 22:57 (dev-db-server) jason pts/1 2009-03-28 23:01 (dev-db-server) john pts/2 2009-03-28 23:04 (dev-db-server) To get a list of all usernames that are currently logged in, use the following: $ who | cut -d' ' -f1 | sort | uniq john jason ramesh c) To change password for the current user. Almost all Linux and Unix and variants have access to the passwd command. Enter this command at the prompt to change your password. You'll need to now the curr ent password before being able to change the password to a new password. c) To move the directory /usr/local to /opt/pgms. To move SOURCE directory to a DEST directory use the mv command as follows: mv source dest mv/usr/local /opt/pgms d) To list various files and directories in current wor ing directory. The ls command will list the files and directories within the current wor ing di rectory (the directory you are currently in). There are a few options you can use with ls, and the format, or syntax of the co mmand is.... ls [options] [file] EXAMPLE >ls -l /home/rich/www Q2: Give a brief structural overview of Linux operating system with an appropria te diagram?

Ans: Linux Operating System:-Linux is a free open-source operating system based on UNIX. Linux was originally created by Linux Thorvaldsen with the assistance o f developers from around the globe. Linux is free to download, edit and distribu te. Linux is a very powerful operating system and it is gradually becoming popul ar throughout the world.

Advantages of Linux Low cost: There is no need to spend time and huge amount money to obtain license s since Linux and much of it's software come with the GNU General Public License . There is no need to worry about any software's that you use in Linux. Stability: Linux has high stability compared with other operating systems. There is no need to reboot the Linux system to maintain performance levels. Rarely it frees up or slow down. It has continuous up-times of hundreds of days or more. Performance: Linux provides high performance on various networ s. It has the abi lity to handle large numbers of users simultaneously. Networ ing: Linux provides a strong support for networ functionality; client an d server systems can be easily set up on any computer running Linux. It can perf orm tas s li e networ bac up faster than other operating systems. Flexibility: Linux is very flexible. Linux can be used for high performance serv er applications, des top applications, and embedded systems. You can install onl y the needed components for a particular use. You can also restrict the use of s pecific computers. Compatibility: It runs all common UNIX software pac ages and can process all com mon file formats. Wider Choice: There is a large number of Linux distributions which gives you a w ider choice. Each organization develops and support different distribution. You can pic the one you li e best; the core function's are the same. Fast and easy installation: Linux distributions come with user-friendly installa tion. Better use of hard dis : Linux uses its resources well enough even when the hard dis is almost full. Multitas ing: Linux is a multitas ing operating system. It can handle many thing s at the same time. Security: Linux is one of the most secure operating systems. File ownership and permissions ma e Linux more secure. Open source: Linux is an Open source operating systems. You can easily get the s ource code for Linux and edit it to develop your personal operating system. Today, Linux is widely used for both basic home and office uses. It is the main operating system used for high performance business and in web servers. Linux ha s made a high impact in this world. Q 3: Explain various features of Linux? Ans: Linux has evolved to have the following features as an outstanding operatin g system which is strong in security and networ ing. Multitas ing: Several programs can run at the same time. Multiuser: Several users can logon to the same machine at the same time There is no need to have separate user licenses. Multiplatform: Linux runs on many different CPUs, that means it supports multipr ocessor machine. Multithreading: Linux has native ernel support for multiple independent threads of control within a single process memory space.

Crash proof: Linux has memory protection between processes, so that one program c an't bring the whole system down. Demand loads executables: Linux only reads from those parts of a program that are actually used on the dis . Shared copy-on-write pages among executables: This means that multiple processes can use the same memory to run in. When one tries to write to that memory, that page (with 4KB piece of memory) is copied somewhere else. Copy-on-write has two benefits: increasing speed and decreasing memory use. Virtual memory uses paging (not swapping whole processes) to dis to a separate partition or a file in the file system, or both, with the possibility of adding more swapping areas during runtime (yes, they're still called swapping areas). A total of 16 of these 128 MB (2GB in recent ernels) swapping areas can be used at the same time, for a theoretical total of 2 GB of usable swap space. It is si mple to increase this if necessary, by changing a few lines of source code. Linux has a unified memory pool for user programs and dis cache, so that all fre e memory can be used for caching, and the cache can be reduced when running larg e programs. Linux does core dumps for post-mortem analysis, allowing the use of a debugger o n a program not only while it is running but also after it has crashed. Linux is mostly compatible with POSIX, System V, and BSD at the source level. Through an iBCS2-compliant emulation module, Linux is mostly compatible with SCO , SVR3, and SVR4 at the binary level. Free and Open source code for all: All source code of Linux is available, includ ing the whole ernel and all drivers, the development tools and all user program s; also, all of it is freely distributable. Plenty of commercial programs are be ing provided for Linux without source, but everything that has been free, includ ing the entire base operating system, is still free. Linux supports pseudoterminals (pty's) and multiple virtual consoles: By several independent login sessions through the console, you can switch between by press ing a hot- ey combination (not dependent on video hardware). These are dynamical ly allocated; you can use up to 64. Linux supports several common file systems, including minix, Xenix, and all the common system V file systems, and has an advanced file system of its own, which offers file systems of up to 4 TB, and names up to 255 characters long. Linux has a transparent access to MS-DOS partitions (or OS/2 FAT partitions) via a special file system:.You don't need any special commands to use the MS-DOS pa rtition, it loo s just li e a normal Unix file system (except for funny restrict ions on file names, permissions, and so on). MS-DOS 6 compressed partitions do n ot wor at this time without a patch (dmsdosfs). Also VFAT (WNT, Windows 95) sup port and FAT-32 is available in Linux 2.0 Linux has CD-ROM file system which reads all standard formats of CD-ROMs. Linux performs well with TCP/IP networ ing, including ftp, telnet, NFS, etc. Linux is userfriendly as Netware client and server

Linux also runs as Lan Manager/Windows Native (SMB) client and server It integrates many networ ing protocols: The base protocols available in the lat est development ernels include TCP, IPv4, IPv6, AX.25, X.25, IPX, DDP (Appletal ), Netrom, and others. Stable networ protocols included in the stable ernels currently include TCP, IPv4, IPX, DDP, and AX.25. Q4: Write a short note on a) Chmod b) Shell Ans: Chmod:- chmod stands for change mode, which changes the file or directory m ode bits. To put it simply, use chmod command to change the file or directory pe rmissions. Following is a sample of ls -l command output. In this, the 9 characters from 2n d to 10th position represents the permissions for the 3 types of users. -rw-r--r-- 1 john john 272 Mar 17 08:22 test.txt In the above example: User (john) has read and write permission Group has read permission Others have read permission Three file permissions: read: permitted to read the contents of file. write: permitted to write to the file. execute: permitted to execute the file as a program/script. Three directory permissions: read: permitted to read the contents of directory ( view files and sub-directori es in that directory ). write: permitted to write in to the directory. ( create files and sub-directorie s in that directory ) execute: permitted to enter into that directory. Numeric values for the read, write and execute permissions: read 4 write 2 execute 1 To have combination of permissions, add required numbers. For example, for read and write permission, it is 4+2 = 6. Shell :- The Linux shell refers to a special program that allows you to interact with it by entering certain commands from the eyboard; the shell will execute the commands and display its output on the monitor. The environment of interacti on is text-based (unli e the GUI-based interaction we have been using in the pre vious chapters) and since it is command-oriented this type of interface is terme d Command Line interface or CLI. Before the advent of GUI-based computing enviro nments, the CLI was the only way that one can interact and access a computer sys tem. Several shell available with Linux including: Shell Name Developed by Where Remar BASH ( Bourne-Again SHell ) Brian Fox and Chet Ramey Free Software Fo undation Most common shell in Linux. It's Freeware shell. CSH (C SHell) Bill Joy University of California (For BSD) The C sh ell's syntax and usage are very similar to the C programming language. KSH (Korn SHell) David Korn AT & T Bell Labs -TCSH See the man page. Type $ man tcsh -TCSH is an enhanced but completely compatible version of the Ber eley UNIX C shell (CSH).

Q5: Explain different types of Users existing for Linux Operating System? Ans: - Every file on your Linux system, including directories, is owned by a spe cific user and group. Therefore, file permissions are defined separately for use rs, groups, and others. User: The username of the person who owns the file. By default, the user who cre ates the file will become its owner. Group: The user group that owns the file. All users who belong into the group th at owns the file will have the same access permissions to the file. This is usef ul if, for example, you have a project that requires a bunch of different users to be able to access certain files, while others can't. In that case, you'll add all the users into the same group, ma e sure the required files are owned by th at group, and set the file's group permissions accordingly. Other: A user who isn't the owner of the file and doesn't belong in the same gro up the file does. In other words, if you set permission for the "other" category , it will affect everyone else by default. For this reason, people often tal ab out setting the "world" permission bit when they mean setting the permissions fo r "other." Q6: Elaborate File and Directory Permissions available in Linux OS? Ans: - There are three types of access permissions on Linux: read, write, and ex ecute. These permissions are defined separately for the file's owner, group and all other users. Read permission. On a regular file, the read permission bit means the file can b e opened and read. On a directory, the read permission means you can list the co ntents of the directory. Write permission. On a regular file, this means you can modify the file, a a wri te new data to the file. In the case of a directory, the write permission means you can add, remove, and rename files in the directory. This means that if a fil e has the write permission bit, you are allowed to modify the file's contents, b ut you're allowed to rename or delete the file only if the permissions of the fi le's directory allow you to do so. Execute permission. In the case of a regular file, this means you can execute th e file as a program or a shell script. On a directory, the execute permission (a lso called the "search bit") allows you to access files in the directory and ent er it, with the cd command, for example. However, note that although the execute bit lets you enter the directory; you're not allowed to list its contents, unle ss you also have the read permissions to that directory. < How to view file permissions > You can view the access permissions of a file by doing the long directory listin g with the ls -l command. This is what a long directory listing might loo li e: me@puter: /home/writers$ ls -l total 17 drwxr-xr-x 3 nana writers 80 2005-09-20 21:37 dir -rw-r----- 1 nana writers 8187 2005-09-19 13:35 file -rwxr-xr-x 1 nana writers 10348 2005-07-17 20:31 otherfile What does the output of ls -l mean? The very first column, the one that loo s li e a bunch of mumbo jumbo, shows the file type and permissions. The second colum n shows the number of lin s (directory entries that refer to the file), the thir d one shows the owner of the file, and the fourth one shows the group the file b elongs to. The other columns show the file's size in bytes, date and time of las t modification, and the filename. The first column, the one that shows the file's permissions and loo s li e mumbo jumbo, is organized into four separate groups, although it certainly doesn't lo o very organized. The first group consists of only one character, and it shows the file's type. Fo r example, d means a directory and - means a normal file, so if you ta e a loo at our example output, you'll notice dir is a directory, while file and other fi le are regular files. The first character can be any of these:

d = directory - = regular file l = symbolic lin s = Unix domain soc et p = named pipe c = character device file b = bloc device file The next nine characters show the file's permissions, divided into three groups, each consisting of three characters. The first group of three characters shows the read, write, and execute permissions for user, the owner of the file. The ne xt group shows the read, write, and execute permissions for the group of the fil e. Similarly, the last group of three characters shows the permissions for other , everyone else. In each group, the first character means the read permission, t he second one write permission, and the third one executes permission. The characters are pretty easy to remember. r = read permission w = write permission x = execute permission - = no permission

You might also like