Linux Chapter 7

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

Which of the following characters can be entered at the beginning of a line in a shell script to ensure that line is recognized as a comment rather than try to execute it?

#

Which of the following is the common escape sequence to display a horizontal tab using the echo command?

/t

Which of the following represents stderr at the command line when used for redirection?

2

Which of the following commands can be used to create a BASH variable named CREATOR with the value of Torvalds?

CREATOR="Torvalds"

Levi wants to run 5 commands sequentially, but does not want to create a shell script. He knows that each command is going to take approximately 20 minutes to run individually. However, he would like to go to lunch 15 minutes from now. He knows that he can type all of the commands on the same line and separate them with a certain character to run them sequentially. Which character can he type after each command to have them run one after the next without requiring further input from him?

a semicolon

Which command can be used to create a new command that will monitor the contents of auth.log as they get added to the file?

alias showauth='tail -f /var/log/auth.log'

Which of the following results would be created by the command sequence: echo 'apple banana carrot dog elephant' | while read a b c; do echo result: $c $b $a; done

carrot dog elephant banana apple

hich of the following commands will send the output of the cat command to the grep command to be filtered?

cat /etc/passwd | grep jsmith

Which of the following commands will display the exit status of the last command used in the BASH shell?

echo $?

Which of the following commands should you use to specify that you want to use Git for version tracking on them?

git add

Which command can be used to download an updated copy of the master branch from the original Git repository?

git pull origin master

Which of the following commands will display the output of a file while also displaying a line number at the left side of each line for the /etc/passwd file?

nl /etc/passwd

Which of the following can be included in a shell script to ask the user to type in a password and then store it in the variable named $password?

read -s -p "Please enter the password: " password

Which of the following commands will count down from 10 to 1?

seq 10 -1 1

Which of the following commands will display the contents of the /etc/passwd file in alphanumerical order?

sort etc/passwd

Which of the following is a valid method of running a script named myscript.sh?

source myscript.sh ./myscript.sh

An alias has previously been created named showauth. Which of the following commands can be used to get rid of that alias?

unalias showauth

How many times will the following loop execute as part of a script: #!/bin/bash COUNTER=0 while [ $COUNTER -lt 7 ] do echo "hello world"

until ctrl-c is used to terminate it

Which of the following commands will count the number of lines in a file named data.csv?

wc -l data.csv


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

UNIT 3 STUDY GUIDE (Creating Graphics & Images Bit by Bit)

View Set

PSY MODULE 42 MAJOR DEPRESSIVE DISORDER AND BIPOLAR DISORDERS

View Set

Part 2 managment chpt 6 and part of 7 W

View Set