You have made a program secure.c to display which ports are open and what types of services are running on these ports. You want to write the program's output to standard output and simultaneously copy it into a specified file. Which of the following commands will you use to accomplish the task?
You will use the tee command to write its content to standard output and simultaneously copy it into the specified file. The tee command is used to split the output of a program so that it can be seen on the display and also be saved in a file. It can also be used to capture intermediate output before the data is altered by another command or program. The tee command reads standard input, then writes its content to standard output, and simultaneously copies it into the specified file(s) or variables. The syntax of the tee command is as follows: tee [-a] [-i] [File] where, the -a option appends the output to the end of File instead of writing over it and the -i option is used to ignore interrupts. Answer: A is incorrect. The concatenate (cat) command is used to display or print the contents of a file. Syntax: cat filename For example, the following command will display the contents of the /var/log/dmesg file: cat /var/log/dmesg Note: The more command is used in conjunction with the cat command to prevent scrolling of the screen while displaying the contents of a file. Answer: C is incorrect. The less command is used to view (but not change) the contents of a text file, one screen at a time. It is similar to the more command. However, it has the extended capability of allowing both forwarB, Dackward navigation through the file. Unlike most Unix text editors/viewers, less does not need to read the entire file before starting; therefore, it has faster load times with large files. The command syntax of the less command is as follows: less [options] file_name Where,
C:\Documents and Settings\user-nwz\Desktop\1.JPG
Answer: B is incorrect. The more command is used to view (but not modify) the contents of a text file on the terminal screen at a time. The syntax of the more command is as follows: more [options] file_name Where,
C:\Documents and Settings\user-nwz\Desktop\1.JPG
Question 2
Which of the following are HTML tags, used to create a table?
Options:
A.
B.
C.
D.
E.
F.
Answer:
A, B, F
Explanation:
Explanation:
In Hypertext Markup Language (HTML), a table is created using the
,
, and
tags. The
tag designs the table layout, the
tag is used to create a row, and the
tag is used to create a column. For example, the following code generates a table with two rows and two columns:
Cell 1
Cell 2
Cell 3
Cell 4
Answer: C, E, and D are incorrect. There are no HTML tags such as
, , and .
Question 3
You work as a Network Administrator for Tech Perfect Inc. You need to configure the company firewall so that only Simple Network Management Protocol (SNMP) and Secure HTTP (HTTPS) traffic is allowed into the intranet of the company. No other traffic should be allowed into the intranet. Which of the following rule sets should you use on your firewall to accomplish the task? (Assume left to right equals top to bottom.)
Options:
A.
Output chain: allow port 443, allow 25, deny all
B.
Input chain: deny all, allow port 25, allow 443
C.
Input chain: allow port 25, allow 443, deny all
D.
Output chain: allow port 25, allow 443, deny all
Answer:
C
Explanation:
Explanation:
In the given rule set, 'Input chain' defines that the rule is for the incoming traffic, i.e., traffic coming from the intranet to the Internet. Port 25 is being allowed for SNMP traffic and port 443 for the HTTPS traffic. Deny all is being used after allowing port 25 and 443; hence, all the other traffic will be denied. Answer: B is incorrect. Deny all is executed first; hence, all the traffic will be denied including port 25 and 443. Answer: A, D are incorrect. These rule sets are used for outgoing traffic, i.e., traffic going from the intranet to the Internet as the 'Output chain' rule is being used.