E.g [root@ford /root] # cat /etc/passwd
10. more:- This command works in much the same way the DOS version of the program does. It takes an input file and displays it one screen at a time.
E.g [root@ford /root] # more /stc/passwd
11. which:- This command searches your entire path to find the name of the file specified on the command line. If the file not found then command output includes the actual path of the file.
E.g [root@ford /root] # which ls
12. whereis: - This tool searches your path and displays the name of the program and its absolute directory, the source file, and the man page for the command. To find the particular location of the program, source and manual page for the command grep is
E.g [root@ford /root] # whereis grep
13. who: - Print all usernames currently logged in
SYNTAX
E.g [root@ford /root] # who [options] [file] [am i]
14. df:- The df program displays the amount of free space, partition by partitions. Some parameters for df are listed below:-
-h generates free space amount in human-readable numbers rather than
free block.
-l lists only the local mounted file system.
E.g [root@formd /root] # df –h /tmp
15. ps:- Ps command lists all the processes in a system, their size, name, owner, cpu time, wall clock time, and much more.
16. su:- when you want to know who is logged in
E.g [root@formd /root] # who
17. dd: - To make a diskette under Linux (or any other Linux-like operating system), you must have permission to write to the device representing a 3.5-inch diskette drive (known as /dev/fd0 under Linux). Insert this floppy into the diskette drive. After mounting the Red Hat Linux CD-ROM, change to the directory containing the desired image file, and use the following command.
# dd if=boot.img of=/dev/fd0 bs=1440k
To make another diskette, label that diskette, and run dd again, specifying the appropriate image file.
18. sync: - To maintain disk cache and to improve disk efficiency the sync command is used. So to schedule the disk cache to be written out to disk we will use sync command. If the sync detect that writing the cache out to disk has already been scheduled, the kernel is instructed immediately flushed the cache. This command does not take any command line parameters.
The syntax for this command is as follows.
[root@ptu /root] # sync ; sync
19. kill :- Kill command is used to kill the running processes. When kill is invoked it requires at least one parameter i.e. the PID number which can be derived from the ps command.
[root@ptu /root] # kill 2059
Where as 2059 is the process id.
20. du : - This command allow u to determine the disk utilization on a directory by directory basis.
21. Chown :- Change owner, change the user and/or group ownership of each given file to a new owner. Chown can also change the ownership of a file to match the user/group of an existing reference file.
SYNTAX
[root@ptu /root] # chown [Options]... NewOwner File...
22. passwd : - Modify a user password.
SYNTAX
[root@ptu /root] # passwd [options...]
23. quota : - Display disk usage and limits, by default only the user quotas are printed.
SYNTAX
quota [ -guv | q ]
quota [ -uv | q ] user
quota [ -gv | q ] group
OPTIONS
-g Print group quotas for the group of which the user is a member.
-u Print user quotas (this is the default)
-v Verbose, will display quotas on filesystems where no storage is allocated.
-q Print a more terse message, containing only information on file systems
where usage is over quota.
24. grep: - The grep (global regular expression and print) command can be used as a filter to search for strings in files. The pattern may be either a fixed character string or a regular expression.
[root@ptu /root] # grep “string” filename(s)
25. gzip: - gzip consistently achieves better compression ratios than compress does. Another bonus: Recent changes have allowed gzip to uncompress files that were compressed using the compress command.
Option for gzip Description
–c Write compressed file to the stdout (thereby allowing the output to be piped to another program)
–d Decompress
–r Recursively find all files that should be compressed
–9 Best compression
–1 Fastest compression
To compress a file and then decompress it, use this command:
[rootl@GP /root# gzip myfile
[rootl@GP /root# gzip -d myfile.gz
26. tar: - The tar program combines multiple files into a single large file. It is separate from the compression tool, so it allows you to select which compression tool to use or whether you even want compression. Additionally, tar is able to read and write to devices in much the same way dd can, thus making tar a good tool for backing up to tape devices.
Option for tar Description
–c Create a new archive.
–t View the contents of an archive.
–x Extract the contents of an archive.
–f Specify the name of the file (or device) in which the archive is located.
–v Be verbose during operations.
–z Use gzip to compress or decompress the file.
Q12. What information is stored in the /etc/shadow file?
Ans. The speed of home computer begins making dictionary attacks against password lists, which is easier for hacker to accomplish. This led to the separation of the encrypted passwords from the/etc/passwd file. The etc/passwd file would remain readable by all users, but the passwords kept in the /etc/shadow file would be readable only by those programs with root privileges, such as the login program. In addition to the encrypted password field, the /etc/shadow file contains information about password expiration and whether the account is disabled. The format of each line in the /etc/shadow file
contains the following:
Login name
Encrypted password
Day since January 1 , 1970, that the password has been changed
Days before the password may be changed
Days after which the password must be changed
Days before the password is about to expire that the user is warned.
Days after the password is expired that the account is disabled.
Days since January 1, 1970, that the account has been disabled
Reserve field.
Q13. Describe the Active Directory and Domains.
Ans. Active Directory: - Active Directory is the directory service used by Windows 2000. It is a core new feature of the Windows 2000 operating system. The Active directory data store is the database in Active Directory that contains information about various types of network objects, including printer, shared folders, user accounts, groups and computers. In Windows 2000 domain, a read/write copy of the Active Directory data store is physically located on each domain controller in the domain. The Active Directory data store is also called the directory.
Domains: - A domain is a logical grouping of networked computers in which one or more of the computers has one or more shared resources, such as a shared folder or a shared printer, and in which all of the computers share a common central domain directory database that contains user account security information. In windows 2000, the entire computer in a domain shares a common Active Directory data store that contains user Account, resource, security and other information. Domains are the fundamental units that make up the Active Directory.
Q14. Describe Single Users, Multiusers and Network Users.
Ans. Single Users: Windows 2000 Professional was designed according to the “one computer, one desk, one user” vision of Microsoft’s confounder Bill Gates. We call this mode as the single use mode. In the arrangement, two programs cannot work in parallel running. For example, Microsoft word on the same machine at the same time.
Multiusers: - Linux borrows its philosophy from UNIX, When UNIX was originally developed at Bell Labs in the early 1970s, it existed on PDP-7 computer that needed to be shared by an entire department. It is required a design that allowed for multiple users to log in to the central machine at the same time. Various people could be editing documents, compiling program and doing other work at exact by same time. The operating system on the central machine took care of the “sharing” details, so that each user seemed to have an individual system. This multi-user tradition continued through today, on other versions of UNIX as well.
Network Users:- Both Linux and Windows 2000 are indeed capable of providing service such as database over the network. We can call users of this arrangement has network users; since they are never actually logged into the results back to the user via the network. The catch in this case is that an application must be specially written to perform such server/client duties. Under Linux, a user can run any program allowed by the system administrator on the server without having redesigned that program. Most users find the ability to run arbitrary program on other machines to be of significant benefit.
Q15. What is the use of Piping and Redirection?
Ans. One of the nice features of Unix is its ability to combine the functions of different tools to accomplish a task. Piping pick up the output of one program or command into another program or command. A similar concept is redirection, which allows you to take the output of a command and store it in a file, or to use a file as the input for a command. Following Table summarizes piping and redirection features
Piping and Redirection Commands
Q16. Write down the steps to Configure Internet in LINUX.
Ans. To start the Internet Configuration wizard, click GNOME menu, Internet Configuration wizard. In the Internet Configuration wizard click on the modem connection option to indicate that you connect to your Internet service provider using a modem. Then be sure that your modem is powered on and click the forward button to cause the Internet configuration wizard to search for your modem. When your modem is found then setting for your modem as directed by Internet Configuration Wizard are displayed, if
Linux displays a message that no modem can be found then check your modem to ensure that it is powered on and connected properly to your computer, then click on the forward button and a dialog that allows you to enter details related to your Internet service provider. Enter your Dial up service provider’s detail name, login and password into the relevant entry boxes. When you done then click the forward button to display the configuration summary. When you confirm that all the details listed correct, click apply button to save your changes. The network configuration dialog is displayed to connect to your ISP, click your modem’s entry in the device list, and then activate button. The modem attempts to dial your ISP and connect your red hat computer to the internet. While you are connected to your network status is active and then you can browse the www using the internet services. When you are ready to disconnect, click deactivate button.
Q17. What is Quota Management in Linux?
Ans. Linux has the facility of allocating user and group quotas. Linux supports both disk use and file number limits. The administrator cannot only limit how much disk space a user can use, but also the number of files she can create. The edquota command helps the admin to edit these limits. Similarly, Linux also allows setting up of grace periods. There are two sorts of quota limits - a soft quota limit and a hard quota limit. After the soft quota limit is over ridded, the user receives an email saying that the quota has
been overridden and the user has some 'grace period' to backup or delete files.
If the user fails to do that during the grace period, the she is not allowed to create any more files on that file system. On the other hand, if during the grace period the user continues to save data and overrides the hard quota as well, then the creation of any more files is disabled. Setting up quotas, is a very essential part of user management. It can help the administrator to architect very usable system policies.
Q18. How User and Group are created?
Ans. Users and Groups
Control of users and groups is a core element of Red Hat Linux system administration. Users can be either people, meaning accounts tied to physical users, or accounts, which exist for specific applications to use.
Groups are logical expressions of organization, tying users together for a common purpose. Users within the same group can read, write, or execute files owned by the group. Each user and group have a unique numerical identification number called a userid (UID) and a groupid (GID) respectively. When a file is created it is assigned a user and group owner. It is also assigned separate read, write, and execute permissions for the owner, the group, and everyone else. The user and the group to which a file belongs, as well as the access permissions on the file, can be changed by the root user or, in most cases, by the creator of the file. Proper management of users and groups, and effective management of file permissions are among the most important tasks a system administrator undertakes. Managing users and groups can be a tedious task, but Red Hat Linux provides tools and conventions to make their management easier. The easiest way to manage users and groups is through the graphical application, User Manager (redhat-config-users). For more information on User Manager, refer to the chapter titled User and Group Configuration in the Red Hat Linux Customization Guide.
The following command line tools can also be used to manage users and groups:
useradd, usermod, and userdel — Industry-standard methods of adding, deleting and modifying user accounts.
groupadd, groupmod, and groupdel — Industry-standard methods of adding, deleting, and modifying user groups.
Q19. Write down a short note on vi(m) editor?
Ans. Vim stands for "Vi IMproved". It used to be "Vi IMitation", but there are so many improvements that a name change was appropriate. Vim is a text editor, which includes almost all the commands from the UNIX, program vi and a lot of new ones. Commands in the vi editor are entered using only the keyboard, which has the advantage that you can keep your fingers on the keyboard and your eyes on the screen, rather than moving your arm repeatedly to the mouse. For those who want it, mouse support and a GUI version with scrollbars and menus can be activated. Apart from the vim command, the vIm packages may also provide gvim, the Gnome version of vim. Beginner users might find this easier to use, because menus offer help when you forgot or don't know how to perform a particular editing task using the standard vim commands.
Basic commands Moving through the text is usually possible with the arrow keys. If not, then follow the following command;
h to move the cursor to the left ·
l to move it to the right ·
k to move up ·
j to move down ·
SHIFT-G will put the prompt at the end of the document.
These are some popular vi commands:
n dd will delete n lines starting from the current cursor position. ·
n dw will delete n words at the right side of the cursor. ·
x will delete the character on which the cursor is positioned ·
:n moves to line n of the file. ·
:w will save (write) the file ·
:q will exit the editor. ·
:q! Forces the exit when you want to quit a file containing unsaved changes.
:wq will save and exit ·
:w new file will save the text to new file. ·
:wq! Overrides read-only permission (if you have the permission to override permissions, for instance when you are using the root account.
· /astring Will search the string in the file and position of the cursor on the first match
Below its position.
Q20. Define cron with suitable examples?
Ans. Cron daemon to execute scheduled commands
Syntax
#cron
How to run the cron daemon: - Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'.
What cron does: - Cron searches /var/spool/cron for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the /etc/cron.d/ directory, which are in a different format. Cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute
Q21. Explain silent features of Linux in detail.
Ans. Linux features are;
1. No rebooting to install: -Uptime is valued as a matter of pride (remember, Linux and other UNIX systems are most often used as servers, which are expected to stay up 24x7). After the original installation, you can install or remove most software without having to reboot your computer.
2. Start/stop services without interrupting others: - We can start and stop individual services (such as Web, file, and e-mail services) without rebooting or even interrupting the work of any other users or features of the computer.
3. Portable software: - We can usually change to another Linux, UNIX, or BSD system and still use the exact same software! Most open source software projects were created to run on any UNIX-like system, and many also run on Windows systems, if you need them to.
4. Downloadable applications: - If the applications you want are not delivered with your version of Linux, you can often download and install them with a single command, using tools such as apt and yum.
5. Mature desktop: - The X Window System (providing the framework for your Linux desktop) has been around longer than Microsoft Windows. The KDE and GNOME desktop environments provide graphical interfaces (windows, menus, icons, and so forth) that rival those on Microsoft systems. Ease-of-use problems with Linux systems are rapidly evaporating.
5. Freedom: - Linux, in its most basic form, has no corporate agenda or bottom line to meet. You are free to choose the Linux distribution that suits you, look at the code that runs the system, add and remove any software you like, and make your computer do what you want it to do.
Q22. Define all runlevel available in init process.
Ans. There are seven run levels - numbered from 0 to 6 - and they are described below:
1. Run level 0 :- signifies the halted state of a machine. While changing run levels, if you set the new run level to be 0, it effectively halts the machine.
2. Run level 1: - stands for the single user mode. This brings the machine to a super user mode and disallows external users from using the machine. All networking functions are disabled at this level.
This level is also called the system maintenance mode because it is generally used to recover from serious system problems. An important thing to note is that at this level, the root prompt is displayed without any attempt to check the corresponding password. This is necessary to allow for the various maintenance functions that need to be done without the hindrance of an authentication system; however, it also leaves the system open to any malicious users physically present at the computer. Therefore, this run level should be used only when absolutely necessary.
3. Run level 2: - allows multiple users to log in to the machine through virtual terminals and other login devices, but still doesn't activate any networking functions.
4. Run level 3: - finally allows networking processes to be started, and allows the complete resources of the system to be used effectively. However, until this level the interface to the desktop is through a CLI interface. Since the GUI interface uses the computer resources (such as CPU, memory, and hard disk) intensively, this run level is mainly used by server class workstations where precious computer resources are used to deliver networking and other application services more effectively.
5. Run level 4: - is unused. It can be used to define your own custom run level.
6. Run level 5 finally allows the X-server process to be started and the accompanying desktop to be loaded to allow users to use the system with a GUI. The desktop that you have been using until now has been working at run level 5.
7. Run level 6: - signifies the rebooting state of a machine and is used to restart the machine.
Section – B 2Marks Questions
Q1. How a file is copied?
Ans. With the help of cp command we can copy files. It has number of option includes which cn be viewed by man command. Following are the most common option for cp.
Option for cp description
-f force copy, do not ask for verification
-i Interactive copy; before each file copied varify with user
[root@ptu /root] cp abc.txt vmc.txt
Q2. What is GUI?
Ans. GUI stand for graphical user interface.
Q3. What is command line interpreter?
Ans. In Linux, a command interpreter normally executes programs and commands. A command interpreter is a user process like any other process and that process is known as shell. There are many shells in Linux, some of the most popular are sh, bash and tcsh.
Q4. How X window is started?
Ans. When setting up the X window System, we may have had a choice of starting the system straight into X. We need to do is log in and we’re there- we’re using KDE and the X Windows System. If that option was not selected, we will have a text-based login prompt. To invoke the X window provide the following command on the command interpreter.
[root@ptu /root] startx
Q5. What is the use of Password File?
Ans. The etc/Password file stores the user’s login encrypted password entry, UID, default GID, name, home directory and login shell. The file keeps one user per line, and a colon delimits each entry for the user.
Q6. What is the user interface of Linux?
Ans. There are two interface that are available with Linux operating system are GNOME and KDE.
KDE: - (K Desktop Environment) is a Desktop environment. It is a slightly different from typical window managers that we have. Instead of just describing how the interface should look. KDE also provides a set of libraries that allow an application to take advantage of some of the special features the window manager has to offer.
Gnome: - GNU Network object model environment) offers a complete desktop environment and application framework to make development as well as usage easier. unlike KDE Gnome is not a window manager.
Q7. What is a CRON Program?
Ans. The CRON program allows any user in the system to schedule a program to run on any date at any time or on a particular day of the week. Down to minute: using CRON is an extremely efficient way to automate your system, generate reports on a regular basis and perform other periodic chores.
Share with your friends: |