Sunteți pe pagina 1din 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. If you have other servers in your network that you wish to configure, click the Browse button and select another server.

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

Configure Windows 2000 Client to use DHCP, DNS, and WINS services.
There are two paths to the Windows 2000 Professional TCP/IP configuration panel. Choose the access method that you prefer:

Click Start -> Control Panel -> Network and Dial-up Connections.
Alternatively, click Start, then right-click My Network Places, and select Properties. The following procedure steps through the Windows XP Professional TCP/IP configuration process: 1. Right-click on Local Area Connection, then click Properties

Figure 8.6. Local Area Connection Properties. 2. The Local Area Connection Properties is used to set TCP/IP protocol settings. Click on Internet Protocol (TCP/IP) in the Components checked are used by this connection: box, then click the Properties button. 3. The default setting is DHCP-enabled operation (i.e., Obtain an IP address automatically).

Figure 8.7. Internet Protocol (TCP/IP) Properties. Many network administrators will want to use DHCP to configure all client TCP/IP protocol stack settings. (For information on how to configure the ISC DHCP server for Windows client support, see, DHCP Server). If it is necessary to provide a fixed IP address, click on Use the following IP address and enter the IP Address, the subnet mask, and the default gateway address in the boxes provided. For this example we are assuming that all network clients will be configured using DHCP. 4. Click the Advanced button to proceed with TCP/IP configuration. Refer to Advanced Network Settings.. Figure 8.8. Advanced Network Settings.

Fixed settings may be required for DNS and WINS if these settings are not provided automatically via DHCP. 5. Click the DNS tab to add DNS server settings. The example system uses manually configured DNS settings. When finished making changes, click OK to commit the settings. See DNS Configuration.. Figure 8.9. DNS Configuration.

6. Click the WINS tab to add manual WINS server entries. This step demonstrates an example system that uses manually configured WINS settings. When finished making changes, click OK to commit the settings. See WINS Configuration.. Figure 8.10. WINS Configuration.

Domain Logon Configuration


1. Right-click on the Network Neighborhood icon. 2. The Network Configuration Panel allows all common network settings to be changed. See The Network Panel.. Figure 8.20. The Network Panel.

Make sure that the Client for Microsoft Networks driver is installed as shown. Click on the Client for Microsoft Networks entry in The following network components are installed: box. Then click the Properties button.

3. The Client for Microsoft Networks Properties panel is the correct location to configure network logon settings. See Client for Microsoft Networks Properties Panel..

Figure 8.21. Client for Microsoft Networks Properties Panel.

Enter the Windows NT domain name, check the Log on to Windows NT domain box, and click OK. 4. Click on the Identification button. This is the location at which the workgroup (domain) name and the machine name (Computer name) need to be set. See Identification Panel. Figure 8.22. Identification Panel.

5. Now click the Access Control button. If you want to be able to assign share access permissions using domain user and group accounts, it is necessary to enable User-level access control as shown in this panel. See Access Control Panel.. Figure 8.23. Access Control Panel.

S-ar putea să vă placă și