Week 4 Homework Linux

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which of the following entries would you use on the first line of a script you are creating in Linux?

#!/bin/sh

Complete the following command to redirect both standard output and standard error from the bigprog program to the file out.txt:

&>

Which optional parameter would you use with the Linux sort command to ignore case sensitivity?

-f

What is the filename extension for the bzip2 compression program?

.bz2

Which of the following extensions would you use at the end of the script name?

.sh

Using the image below, which keyboard character best represents the top of the Linux directory structure?

/

Which Linux directory usually holds the system configuration files?

/etc

Which of the following files would you search in order to obtain information about a user in a Linux OS?

/etc/passwd

What is another name for a bash shell script that you might see?

?

Which command would you use to display prompts for a user in a shell script?

?

_____ are collections of programming functions that can be useful to many programs.

?

Which type of file is nano LEAST likely to be useful for examining or editing?

A LibreOffice word processing document

If you were to type the following in a Linux command line terminal, what type of results might you receive?

A list of the users on that Linux computer.

Which optional parameter would you use with the Linux tar command to extract files from an archive? A. -x B. -d C. -A D. -c

A. -x

Which single keyboard character represents any single character except in a new line in a regular expression in Linux? A. . B ! C. $ D. #

A. .

Which of the following directories stores package database information? A./var/lib B./usr/lib C./etc/lib D./tmp/lib

A. /var/lib

What are two forms of regular expressions used in Linux? A.Basic B.Hexadecimal C.Extended D.Alphanumeric

A. Basic C. Extended

How would you remove two lines of text from a file using the Vi text editor? A.In command mode, position the cursor on the first line and type 2dd. B.In command mode, position the cursor on the last line and type 2yy. C.In insert mode, position the cursor at the start of the first line, hold down the Shift key while pressing the Down arrow key twice, and press the Delete key on the keyboard. D.In insert mode, position the cursor at the start of the first line and press Ctrl+K twice. E.Select the text with the mouse and then select File » Delete from the menu.

A. In command mode, position the cursor on the first line and type 2dd

Which of the following are the two major Linux package management systems? A. RPM B. BASH C. DPKG D. TAR

A. RPM C. DPKG

Which of the following actions does the find command perform? A. Searching a file in a directory B. Changing text in a file C. Listing all hidden files and directories D. Matching a pattern in a file

A. Searching a file in a directory

What are the two types of FHS files found in the Filesystem Hierarchy Standard? A.Standard B.Variable C.Synchronous D.Asynchronous

A. Standard B. Variable

True or false: The find command enables you to locate files based on their sizes. A. True B. False

A. True

True or false: You can set a directory's time stamps with the touch command. A True B.False

A. True

To have a script send an email automatically, which command would you use to do this? A. mail B. sed C .awk D. email

A. mail

If you were a Linux system's administrator and wanted to see who is currently logged into the computer and what programs they are currently running, you can type the ____ command. A. w B. whoami C. uid D. u

A. w

Which two keyboard characters can denote an account with no password?

B. * D. !

True or false: You can easily damage your Linux installation by mistyping an rm command when you log into your regular account. A. True B. False

B. False

What are the two types of outputs that can result using basic redirection operators in Linux?

B. Standard output D. Standard error

If you are in the Vi text editor command mode, which keystroke would you type to undo a change? A. b B. u C. d D. a

B. u

You've written a simple shell script that does nothing but launch programs. In order to ensure that the script works with most user shells, what should its first line read? A. ?!/bin/sh B. #!/bin/ls C.#!/bin/sh D.#!/bin/sh/root

C. #!/bin/sh

Which compression file format can be used across multiple operating systems (Linux, Windows, Mac OS) A. tar file B. xz file C. zip file D. pdf file

C. zip file

Which of the following actions is performed when a file is uncompressed? A.Execute B.Remove C.Extract D.Archive

C.Extract

Using the image below, what does the yellow dot best represent? A.Subdirectories B.Root C.Files D.Libraries

C.Files

Which wildcard character can be matched for any one symbol in a filename? A. * B. / C. + D. ?

D. ?

If you were to type the following in a Linux command line terminal, what type of results might you receive?cat /etc/passwd A.An encrypted list of all users passwords for that Linux computer. B.An un-encrypted list of all user passwords for that Linux computer. C.A list of all user ID numbers for that Linux computer. D. A list of the users on that Linux computer.

D. A list of the users on that Linux computer.

Which file hierarchy structure was created to give a standardization to the Linux filesystem structure? A. SMB B. SMS C. NTFS D. FHS

D. FHS

Which character that represents the start of a line in a regular expression? A.| B.% C.& D.^

D. ^

Which of the following redirection operators appends a program's standard output to an existing file, without overwriting that file's original contents? A.| B.2> C.&> D.> E.>>

E.>>

Which keystrokes invoke the pico or nano search function? (choose two)

F6 Ctrl + W

True or false: A user types myscript laser.txt to run a script called myscript. Within myscript, the $0 variable holds the value laser.txt .

False

True or false: GUI text editors for ASCII are superior to text-mode ASCII text editors because the GUI editors support underlining, italics, and multiple fonts.

False

True or false: Linux stores information on groups in the /etc/groups file.

False

True or false: The following script launches three simultaneous instances of the terminal program. #!/bin/bash terminal terminal terminal

False

True or false: To compress files archived with the zip command, you must use an external compression program such as gzip or bzip2 in a pipeline with zip.

False

True or false: Unicode is useful for encoding most European languages but not Asian languages.

False

What is the effect of the following short script, cp1, if it's called as cp1 big.c.big.cc? #!/bin/bash cp $2 $1

It copies the contents of big.cc to big.c, eliminating the old big.c.

If you were in a Linux command line terminal and saw a system account with the UID of 0, what would that indicate?

It's the system administrator (root) account.

You want to copy a directory, MyFiles, to a USB flash drive that uses the FAT filesystem. The contents of MyFiles are as follows: The USB flash drive is mounted at /media/usb, and so you type cp -a MyFiles/ /media/usb. What problem will occur when you attempt to copy these files? $ Is -I MyFiles/ total 276

One file will be missing on the USB flash drive.

Which of the following is NOT considered a Debian based Linux distribution?

OpenSUSE

Which of the following would you use the yum command to install or upgrade applications? (choose all that apply)

Red Hat Fedora CentOS

Which of the following are considered RPM-based Linux distributions? (choose all that apply)

Red Hat Fedora CentOS SUSE Enterprise

_____ files are those that control how the computer operates.

System

Which of the following type of user information might you find in the /etc/passwd file? (choose three)

The UID The user's account home directory The path to the user's default text-mode shell

What is the purpose of conditional expressions in shell scripts?

They enable the script to take different actions in response to variable data

True or False? You've typed rmdir junk to delete the junk directory, but this command has failed because junk contains word processing files. To do the job, you type rm -r junk.

True

True or false: Many (not all) configuration files use a hash mark (#) to identify comment lines?

True

True or false: The regular expression Linu[&c.circ;x].*lds matches the string, Linux Torvalds.

True

True or false: Valid looping statements in Bash include for, while, and until.

True

True or false: You can create a symbolic link from one low-level filesystem to another.

True

Which of the following statements would you need to include in a case statement to denote the end of the case statement?

easc

Once a shell script has been written, it must be made _____ in order to run it.

executable

Which of the following Linux 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 Linux command line tool is used to extract a compressed file?

gunzip (not verified)

The gzip, bzip2, and xz programs all perform _____ compression, in which the decompressed data exactly matches the original pre-compression data.

lossless

Which of the following commands would you type to rename a file called newfile.txt to afile.txt?

mv newfile.txt afile.txt

Which of the following consists of supporting files for an application that are installed on a Linux computer?

package

What could you type in a Linux command line terminal shell to see a list of all process IDs (PID) on your computer?

ps

To uninstall an application using the apt-get command, you would type apt-get _____.

remove

Using the image below, which Linux command line tool would give you this list in an alphabetic order?

sort

Which of the following Linux command line tools supports both gzip and bzip2 compression?

tar

Which of the following command line tools would be the best to use when compressing more than two files inside a Linux system?

tar

Which of the following syntaxes will you use to extract a file using the tar command?

tar -zxvf {.tgz-file}

If you are a Linux system's administrator and wanted to locate any programs that are consuming large amounts of the CPU or memory, what command line tool would help assist you with this?

top

Which command would you type if you wanted to display your username from a Linux command line terminal shell?

whoami

Which of the following commands will install the GIMP software application on an RPM-based Linux OS?

yum install gimp

If you were doing a regular expression inside a Linux command line, which special character on the keyboard would give you two possible matches using the example below: car ____ truck

|


Ensembles d'études connexes

Series 65 part 3 continued study

View Set

Powerplant Electrical - Magnetos

View Set

Chem Unit 1 Practice Problems- AP CLASSROOM

View Set

Chapter 2 Quiz - Policy Provisions and Contract Law

View Set

Ch.6, Lesson1: The Revolution Begins

View Set

Witness Questions Eugene V. Debs

View Set