You are on page 1of 22

PART-II: MCS-022

Question 1: (i) Write a shell script that prints a sorted list of files in the user directory that contain a user specified word inside them. User need to specify the file extension of files to be searched and the word need to be searched.

Solution: Command : $ find . | xargs grep 'string' –sl Examples For example search for a string called redeem reward in all text files located in /home/tom/*.txt directory, use $ grep "redeem reward" /home/tom/*.txt Task: Search all subdirectories recursively You can search for a text string all files under each directory, recursively with -roption: $ grep -r "redeem reward" /home/tom Task: Only print filenames By default, grep command prints the matching lines You can pass -H option to print the filename for each match. $ grep -H -r “redeem reward” /home/tom

Output:
... filename.txt: redeem reward ... To just print the filename use cut command as follows: $ grep -H manish /etc/* -R | cut -d: -f1 Output: ... filename.txt ... (ii) What is the output of ls-lm and ls-ml? Which option takes procedure? What is the result of ls-d? Solution: $ ls –lm ak1.php, ak2.java, ak3.sql, ak4.txt, command.txt, file1, file2.txt, file3.sql, file4.php, ls_lm.txt, ls_ml.txt, touch $ ls -ml total 20 rw-rw-r--. 1 anupam anupam 40 Aug 19 16:12 ak1.php -rw-rw-r--. 1 anupam anupam 109 Aug 19 16:15 ak2.java -rw-rw-r--. 1 anupam anupam 0 Aug 19 16:11 ak3.sql -rw-rw-r--. 1 anupam anupam 0 Aug 19 16:11 ak4.txt -rw-rw-r--. 1 anupam anupam 96 Aug 19 16:25 command.txt -rw-rw-r--. 1 anupam anupam 0 Aug 19 16:11 file1

-rw-rw-r--. 1 anupam anupam 47 Aug 19 16:13 file2.txt -rw-rw-r--. 1 anupam anupam 0 Aug 19 16:11 file3.sql -rw-rw-r--. 1 anupam anupam 0 Aug 19 16:11 file4.php -rw-rw-r--. 1 anupam anupam 0 Aug 19 16:43 ls_ml.txt -rw-rw-r--. 1 anupam anupam 12 Aug 19 16:24 touch $ ls -d ls -d merely lists the entry for the directory, or '.' Question 2: Install and Configure the DHCP Server services. Configure Windows 2000 Client to use DHCP, DNS, and WINS services.

Solution: Install and Configure the DHCP Server Service

.

.Click the “This Server” radio button and click “OK”. click the Browse button and select another server. If you have other servers in your network that you wish to configure.

click the server name and then select “Action” followed by “New Scope”. .Figure 2: Selecting the server Now that you have allocated the server which will act as the DHCP server.

.

.

.

.

.

.

.

.

.

.

.

Right-click on Local Area Connection. The following procedure steps through the Windows XP Professional TCP/IP configuration process: 1. Alternatively. and WINS services. and select Properties. click Start.Configure Windows 2000 Client to use DHCP. then right-click My Network Places. then click Properties . Choose the access method that you prefer: Click Start -> Control Panel -> Network and Dial-up Connections. DNS. There are two paths to the Windows 2000 Professional TCP/IP configuration panel.

8. The default setting is DHCP-enabled operation (i. “DHCP Server”). Local Area Connection Properties.”. Internet Protocol (TCP/IP) Properties.7.. If it is necessary to provide a fixed IP address. Figure 8. Many network administrators will want to use DHCP to configure all client TCP/IP protocol stack settings. see. Click on Internet Protocol (TCP/IP) in the Components checked are used by this connection: box. 4. then click the Properties button. Advanced Network Settings. For this example we are assuming that all network clients will be configured using DHCP. .Figure 8. click on “Use the following IP address” and enter the IP Address. 2. 3. the subnet mask. The Local Area Connection Properties is used to set TCP/IP protocol settings. (For information on how to configure the ISC DHCP server for Windows client support. “Obtain an IP address automatically”). Click the Advanced button to proceed with TCP/IP configuration. Figure 8.e.6. Refer to “Advanced Network Settings. and the default gateway address in the boxes provided.

When finished making changes. . See “DNS Configuration. Figure 8.10. WINS Configuration.9. Click the DNS tab to add DNS server settings. click OK to commit the settings. See “WINS Configuration. This step demonstrates an example system that uses manually configured WINS settings. 6.”. Click the WINS tab to add manual WINS server entries.Fixed settings may be required for DNS and WINS if these settings are not provided automatically via DHCP. click OK to commit the settings. 5. Figure 8.”. The example system uses manually configured DNS settings. When finished making changes. DNS Configuration.

The Client for Microsoft Networks Properties panel is the correct location to configure network logon settings.”. . Then click the Properties button. 3. Figure 8. See “Client for Microsoft Networks Properties Panel. Make sure that the Client for Microsoft Networks driver is installed as shown. 2. Click on the Client for Microsoft Networks entry in The following network components are installed: box. The Network Configuration Panel allows all common network settings to be changed.Domain Logon Configuration 1. See “The Network Panel. The Network Panel.20.”. Right-click on the Network Neighborhood icon.

check the Log on to Windows NT domain box. If you want to be able to assign share access permissions using domain user and group accounts. Figure 8. 4.”.Figure 8. Access Control Panel.22. Identification Panel. See “Identification Panel.” Figure 8. See “Access Control Panel. Client for Microsoft Networks Properties Panel. This is the location at which the workgroup (domain) name and the machine name (Computer name) need to be set. . Click on the Identification button.21.23. Enter the Windows NT domain name. 5. and click OK. Now click the Access Control button. it is necessary to enable User-level access control as shown in this panel.