Linux Part 1 - Exploring Linux Command-Line Tools (Quiz 1)

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Which of the following symbols is used to redirect all output including errors to a file?

&>

Which of the following symbols is expanded when a pattern is matched?

*

Which of the following symbols is used to redirect errors to a file?

2>

Which of the following characters is used to direct the contents of a file to a command?

<

Which of the following symbols is used to redirect a file as an input to a command?

<

Which of the following characters is used to direct the output of a command to a file?

>

Which of the following symbols redirects output to append an existing file in a Linux computer?

>>

Which of the following symbols matches any single character?

?

How many commands can you pipe together at once?

An arbitrary number

You type a command into bash and pass a long filename to it, but after you enter the command, you receive a File not found error message because of a typo in the filename. How might you proceed?

Any of these.

What does the pwd command accomplish?

It prints the name of the working directory.

You type echo $PROC, and the computer replies Go away. What does this mean?

One of your configuration files, or a program you've run, has set the $PROC environment variable to Go away.

What is the effect of the following command? $ myprog &> input.txt

Standard output and standard error from myprog are written to input.txt.

How do the > and >> redirection operators differ?

The > operator creates a new file or overwrites an existing one; the >> operator creates a new file or appends to an existing one.

What is the effect of the following command? $ pr report.txt | lpr

The file report.txt is formatted for printing and sent to the lpr program.

Which of the following conditions is necessary for using the join command?

The files should be sorted.

How does man display information by default on most Linux systems?

Using the less pager

Which of the following regular expressions will match the strings dog, dug, and various other strings but not dig?

d[o-u]g

Which of the following commands is used to convert tabs in a given file into spaces?

expand

Which of the following commands is used to set an environmental variable?

export

Which of the following commands is used to reformat a paragraph?

fmt

You've received an ASCII text file (longlines.txt) that uses no carriage returns within paragraphs but two carriage returns between paragraphs. The result is that your preferred text editor displays each paragraph as a very long line. How can you reformat this file so that you can more easily edit it (or a copy)?

fmt longlines.txt > longlines2.txt

You want to run an interactive script, gabby, which produces a lot of output in response to the user's inputs. To facilitate future study of this script, you want to copy its output to a file. How might you do this?

gabby | tee gabby-out.txt

Which of the following commands will print lines from the file world.txt that contain matches to changes and changed?

grep change[ds] world.txt

Which of the following commands shows first ten lines of a file if no arguments are passed?

head

You want to store the standard output of the ifconfig command in a text file (file.txt) for future reference, and you want to wipe out any existing data in the file. You do not want to store standard error in this file. How can you accomplish these goals?

ifconfig > file.txt

Which of the following commands will number the lines in aleph.txt? (Select three.)

nl aleph.txt cat -b aleph.txt cat -n aleph.txt

Which of the following commands is used to convert text files for printing?

pr

Which of the following options is used with the nl command to number the non-empty lines only?

t

Which of the following commands is used to concatenate and print lines of text files to standard output in reverse order?

tac

Which of the following commands is used to view the output on a screen as well as to save it in a file?

tee

Which of the following commands is used to count the number of characters in a file?

wc -m

Which of the following metacharacters is used to send the output of one command as the standard input of the next command?

|

Which of the following symbols is used to connect the output of one command to the input of another command?

|

Which of the following symbols is used to redirect the output of one command as the input to another command?

|


संबंधित स्टडी सेट्स

Leadership Final True Leadershi[

View Set

Interior/Exterior Angles of Polygons

View Set

Vector Multiplication Using Matrices (Assignment + Quiz)

View Set

NSG307 Pituitary Chapter 30 NCLEX

View Set

MGA 202 Chapter 6 Variable Costing

View Set