You are on page 1of 13

ASSIGENMENT ON NETWORK OPERATING SYSTEM

SUBMITTED TO: Akash Bhardawj Sir

SUBMITTED BY: Ram Narayan Patel 11008945 K2R21 (05)

Q1: List various Commands used to perform following operations a) Make 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 working directory. Ans:a) Make your Home Directory your current directory. Use the 'cd' command without any target; that always puts you in the home directory which becomes by default the working 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 number, date and time, machine address. $ who ramesh pts/0 jason pts/1 john pts/2 2009-03-28 22:57 (dev-db-server) 2009-03-28 23:01 (dev-db-server) 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 know the current 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 working directory. The ls command will list the files and directories within the current working directory (the directory you are currently in). There are a few options you can use with ls, and the format, or syntax of the command is.... ls [options] [file] EXAMPLE >ls -l /home/rich/www Q2: Give a brief structural overview of Linux operating system with an appropriate 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 of developers from around the globe. Linux is free to

download, edit and distribute. Linux is a very powerful operating system and it is gradually becoming popular throughout the world.

Advantages of Linux Low cost: There is no need to spend time and huge amount money to obtain licenses 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 networks. It has the ability to handle large numbers of users simultaneously.

Networking: Linux provides a strong support for network functionality; client and server systems can be easily set up on any computer running Linux. It can perform tasks like network backup faster than other operating systems. Flexibility: Linux is very flexible. Linux can be used for high performance server applications, desktop applications, and embedded systems. You can install only the needed components for a particular use. You can also restrict the use of specific computers. Compatibility: It runs all common UNIX software packages and can process all common file formats. Wider Choice: There is a large number of Linux distributions which gives you a wider choice. Each organization develops and support different distribution. You can pick the one you like best; the core function's are the same. Fast and easy installation: Linux distributions come with user-friendly installation. Better use of hard disk: Linux uses its resources well enough even when the hard disk is almost full. Multitasking: Linux is a multitasking operating system. It can handle many things at the same time. Security: Linux is one of the most secure operating systems. File ownership and permissions make Linux more secure. Open source: Linux is an Open source operating systems. You can easily get the source 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 has 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 operating system which is strong in security and networking. Multitasking: 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 multiprocessor machine. Multithreading: Linux has native kernel 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 can't bring the whole system down. Demand loads executables: Linux only reads from those parts of a program that are actually used on the disk.

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 disk 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 kernels) swapping areas can be used at the same time, for a theoretical total of 2 GB of usable swap space. It is simple to increase this if necessary, by changing a few lines of source code. Linux has a unified memory pool for user programs and disk cache, so that all free memory can be used for caching, and the cache can be reduced when running large programs. Linux does core dumps for post-mortem analysis, allowing the use of a debugger on 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, including the whole kernel and all drivers, the development tools and all user programs; also, all of it is freely distributable. Plenty of commercial programs are being provided for Linux without source, but everything that has been free, including 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 pressing a hot-key combination (not dependent on video hardware). These are dynamically 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 partition, it looks just like a normal Unix file system (except for funny restrictions on file names, permissions, and so on). MSDOS 6 compressed partitions do not work at this time without a patch (dmsdosfs). Also VFAT (WNT, Windows 95) support and FAT-32 is available in Linux 2.0 Linux has CD-ROM file system which reads all standard formats of CDROMs. Linux performs well with TCP/IP networking, 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 networking protocols: The base protocols available in the latest development kernels include TCP, IPv4, IPv6, AX.25, X.25, IPX, DDP (Appletalk), Netrom, and others. Stable network protocols included in the stable kernels 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 mode bits. To put it simply, use chmod command to change the file or directory permissions. Following is a sample of ls -l command output. In this, the 9 characters from 2nd 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 subdirectories in that directory ). write: permitted to write in to the directory. ( create files and subdirectories 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 keyboard; the shell will execute the commands and display its output on the monitor. The environment of interaction is text-based (unlike the GUI-based interaction we have been using in the previous chapters) and since it is commandoriented this type of interface is termed Command Line interface or CLI. Before the advent of GUI-based computing environments, the CLI was the only way that one can interact and access a computer system.
Several shell available with Linux including: Shell Name Developed by Where BASH ( Bourne-Again Brian Fox and Chet Free Software SHell ) Ramey Foundation CSH (C SHell) Remark Most common shell in Linux. It's Freeware shell. Bill Joy University of The C shell's syntax California (For BSD) and usage are very similar to the C programming language. David Korn AT & T Bell Labs -See the man page. -TCSH is an Type $ man tcsh enhanced but completely compatible version of the Berkeley UNIX C shell (CSH).

KSH (Korn SHell) TCSH

Q5: Explain different types of Users existing for Linux Operating System?

Ans: - Every file on your Linux system, including directories, is owned by a specific user and group. Therefore, file permissions are defined separately for users, groups, and others. User: The username of the person who owns the file. By default, the user who creates the file will become its owner. Group: The user group that owns the file. All users who belong into the group that owns the file will have the same access permissions to the file. This is useful 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, make sure the required files are owned by that 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 group 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 talk about setting the "world" permission bit when they mean setting the permissions for "other."

Q6: Elaborate File and Directory Permissions available in Linux OS? Ans: - There are three types of access permissions on Linux: read, write, and execute. 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 be opened and read. On a directory, the read permission means you can list the contents of the directory. Write permission. On a regular file, this means you can modify the file, aka write 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 file has the write permission bit, you are allowed to modify the file's contents, but you're allowed to rename or delete the file only if the permissions of the file's directory allow you to do so.

Execute permission. In the case of a regular file, this means you can execute the file as a program or a shell script. On a directory, the execute permission (also called the "search bit") allows you to access files in the directory and enter 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, unless 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 listing with the ls -l command. This is what a long directory listing might look like: 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 looks like a bunch of mumbo jumbo, shows the file type and permissions. The second column shows the number of links (directory entries that refer to the file), the third one shows the owner of the file, and the fourth one shows the group the file belongs to. The other columns show the file's size in bytes, date and time of last modification, and the filename. The first column, the one that shows the file's permissions and looks like mumbo jumbo, is organized into four separate groups, although it certainly doesn't look very organized. The first group consists of only one character, and it shows the file's type. For example, d means a directory and - means a normal file, so if you take a look at our example output, you'll notice dir is a directory, while file and other file are regular files. The first character can be any of these:

d = directory - = regular file l = symbolic link s = Unix domain socket p = named pipe c = character device file b = block 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 next group shows the read, write, and execute permissions for the group of the file. Similarly, the last group of three characters shows the permissions for other, everyone else. In each group, the first character means the read permission, the 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