You work as a Network Administrator for McNeil Inc. The company has a Linux-based network. A printer is configured on the network. You want to remove a file from a print queue. Which of the following commands will you use to accomplish this?
Answer : C
Explanation:
The LPRM command is used to remove a file from a print queue.
Answer option D is incorrect. The LPQ command reports the status of a print queue.
Answer option A is incorrect. The LPR command is used to submit a file for printing.
Answer option B is incorrect. There is no command such as LPQDEL in Linux.
You are a newly appointed Red Hat Technician for company Inc. The company has a
Linux-based network. You want to install a package named httpd on your Linux system.
Before installing the package, you want to get the list of those packages that httpd depends on. Which of the following commands will you use to accomplish the task?
Answer : B
Explanation:
If the package is not yet installed, the yum deplist httpd command is used to get the list of packages that httpd depends on.Answer option C is incorrect. The yum list httpd command can be used to list various information about available packages. For example, it lists all available and installed packages and all packages with updates available in the yum repositories.
Answer option D is incorrect. If the package is already installed, the rpm -qR httpd command is used to get the list of packages that this package depends on.
Answer option A is incorrect. This command is incorrect. The deplist option is not used with the rpm command.
You work as the Network Administrator for McNeil Inc. The company has a Linux-based network.
You are working as a root user on Red Hat operating system. You are currently running a program named My_program. You are getting some error messages while executing the program. You want to redirect these error messages to a file named file2 rather than being displayed on the screen.
Which of the following tools should you use to accomplish the task?
Answer : B
Explanation:
This command will execute a program named My_program and whatever errors are generated while executing that program will all be added to a file named file2 rather than being displayed on the screen.
What is redirection of STDIN, STDOUT, STDERR in Linux?
Redirection means diverting data from their normal destination to another. Whenever a program is executed on terminal some output is displayed at the shell prompt. In case a user does not want that output to appear in the shell window, the user can redirect it elsewhere. The user can redirect the output into a file, printer, etc.
Not only the output of programs is redirected, but also input of a program and error messages are redirected to a file.
Common Redirection operators are as follows:
Answer option D is incorrect. This command will direct the standard output of My_program to file2.
Answer option A is incorrect. This command will append the standard output of
My_program to file2.
Answer option C is incorrect. This command cannot be applied in this scenario.
Which of the following key-combinations is used to redo a change undone by a u command in vim?
Answer : C
Explanation:
The Ctrl-r key-combination is used to redo a change undone by a u command in vim. You can go back in time with the undo command. You can then go forward again with the redo command. If you make a new change after the undo command, the redo will not be possible anymore.
Answer options B and D are incorrect. The Ctrl-w, s and Ctrl-w, v key-combinations are used to view a file in two windows in a single vim screen. Ctrl-w, s splits the screen horizontally and Ctrl-w, v splits the screen vertically.
Answer option A is incorrect. The Ctrl-w key-combination with an arrow key is used to jump from one window to another. This will move you to the next window in whichever direction the arrow would normally move your cursor.
You work as the Network Administrator for Perfect solutions Inc. The company has a Linux- based Network. You are working as a root user. You want to know what the day will be on
20 July 2010.
Which of the following commands should you use to accomplish this task?
Answer : C
Explanation:
The cal 7 2010 command will display the calendar of July 2010.
What is the cal command?
The cal command prints an ASCII calendar of the current month.
Syntax: cal [month] [year]
Given a month and year as arguments, cal displays the calendar for that particular month of the given year.
When a single numeric argument (such as 2005) is given, cal will display a calendar for the given year. Always use a fourdigit year. For example, the command cal 05 will display the calendar for the year 05, not the year
2005.
Answer option B is incorrect. The cal 20 July command will display only the month and year, and not the date.
Answer option A is incorrect. The cal command will display the calendar of the current month.
Answer option D is incorrect. The date command will display the current date and time of the system.