P4S - Nov.26, 2018 -- take 1 (copy)

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Which of the following options is used in a GRUB Legacy configuration file to define the amount of time that the GRUB menu will be shown to the user? a.) hidemenu b.) splash c.) timeout d.) showmenu

c.) timeout

Which of the following commands will change all CR-LF pairs in an imported text file, userlist.txt, to Linux standard LF characters and store it as newlist.txt? a.) tr '\r\n' " <userlist.txt> newlist.txt b.) tr -c '\n\r' " <newlist.txt> userlist.txt c.) tr -d '\r' <userlist.txt> newlist.txt d.) tr '\r' '\n' userlist.txt newlist.txt e.) tr -s '^M' '^J' userlist.txt newlist.txt

c.) tr -d '\r' <userlist.txt> newlist.txt

Which of the following commands shows the definition of a given shell command? a.) where b.) stat c.) type d.) case

c.) type

Which umask value will result in the default access permissions of 600 (rw-------) for files and 700 (rwx-------) for directories? (Specify only the numerical umask value.) ______________________________________

0077 -or- 077

When in Normal mode in vi, which command character can be used to begin a reverse search of the text? A. ? B. / C. F D. r

A. ? (already know / goes "forward", the letters make no sense)

During a system boot cycle, what program is executed after the BIOS completes its tasks? A. The bootloader B. The inetd program C. The init program D. The kernel

A. The bootloader

Which type of filesystem is created by mkfs when it is executed with the block device name only and without any additional parameters? A. ext2 B. ext3 C. ext4 D. XFS E. VFAT

A. ext2

From a Bash shell, which of the following commands directly executes the instruction from the file /usr/local/ bin/runme.sh without starting a subshell? (Please select TWO answers.) A. source /usr/local/bin/runme.sh B. . /usr/local/bin/runme.sh C. /bin/bash /usr/local/bin/runme.sh D. /usr/local/bin/runme.sh E. run /usr/local/bin/runme.sh

A. source /usr/local/bin/runme.sh B. . /usr/local/bin/runme.sh

When piping the output of find to the xargs command, what option to find is useful if the filenames have spaces in them? a.) -rep-space b.) -print0 c.) -nospace d.) -ignore-space

b.) -print0 in man: -print0 True; print the full file name on the standard output, followed by a null character (instead of the newline character that -print uses). This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the -0 option of xargs

What is the maximum niceness value that a regular user can assign to a process with the nice command when executing a new process? a.) 9 b.) 19 c.) 49 d.) 99

b.) 19

Which of the following shell redirections will write standard output and standard error output to a file named filename? a.) 2>&1>filename b.) >filename 2>&1 c.) 1>&2>filename d.) >>filename e.) 1&2>filename

b.) >filename 2>&1 > standard output > into file named filename 2 standard error >&1 standard output ???? sorta ????

What does the ? symbol within regular expressions represent? a.) Match the preceding qualifier one or more times. b.) Match the preceding qualifier zero or more times. c.) Match the preceding qualifier zero or one times. d.) Match the literal ? character.

c.) Match the preceding qualifier zero or one times.

Which variable defines the directories in which a Bash shell searches for executable commands? a.) BASHEXEC b.) BASHRC c.) PATH d.) EXECPATH e.) PATHRC

c.) PATH

Which of the following settings for umask ensures that new files have the default permissions -rw-r-----? a.) 0017 b.) 0640 c.) 0038 d.) 0027

d.) 0027

How many fields are in a syntactically correct line of /etc/fstab? a.) 3 b.) 4 c.) 5 d.) 6 e.) 7

d.) 6

Which chown command will change the ownership to dave and the group to staff on a file named data.txt? a.) chown dave/staff data.txt b.) chown -u date -g staff data.txt c.) chown -user dave --group staff data.txt d.) chown dave: staff data.txt

d.) chown dave: staff data.txt chown from owner: to owner what file proper syntax uses a colon, not a forward slash

What command will generate a list of user names from /etc/passwd along with their login shell? a.) column -s: 1,7 /etc/passwd b.) chop -c 1,7 /etc passwd c.) colrm 1,7 /etc/passwd d.) cut -d: -f1,7 /etc/passwd

d.) cut -d: -f1,7 /etc/passwd take out, by delimeter, fields 1 & 7 from /file

How can the list of files that would be installed by the RPM package file apache-xml.rpm be previewed? a.) rpm --qp apache-xml.rpm b.) rpm --qv apache-xml.rpm c.) rpm --ql apache-xml.rpm d.) rpm --qpl apache-xml.rpm

d.) rpm --qpl apache-xml.rpm

Which of the following commands is used to change options and positional parameters for a running Bash? a.) history b.) set c.) bashconf d.) setsh e.) evnsetup

b.) set makes sense... you set the parameters

Which of the following commands is used to modify quota settings? (Choose two.) a.) editquota b.) setquota c.) edquota d.) quotaedit e.) quotaset

b.) setquota c.) edquota

Which of the following commands will print important system information such as the kernel version and machine hardware architecture? a.) sysinfo b.) uname c.) lspci d.) arch e.) info

b.) uname

In Bash, inserting 1>&2 after a command redirects a.) standard error to standard input. b.) standard input to standard error. c.) standard output to standard error. d.) standard error to standard output. e.) standard output to standard input.

c.) standard output to standard error.

Which command is used to start another command with a given nice level? (Specify ONLY the command without any path or parameters.) ____________________________

nice this initiates (starts another) with a specified nice level re-nice is when you are re-setting the existing nice

When given the following command line. echo "foo bar" | tee bar | cat Which of the following output is created? A. cat B. foo bar C. tee bar D. bar E. foo

B. foo bar

Which option to the tee command will cause the output to be concatenated on the end of the output file instead of overwriting the existing file contents? a.) -a b.) -c c.) -no-clobber d.) -continue

a.) -a append

Which run levels should never be declared as the default run level when using SysV init? (Choose TWO correct answers.) a.) 0 b.) 1 c.) 3 d.) 5 e.) 6

a.) 0 e.) 6

What information can the lspci command display about the system hardware? (Choose THREE correct answers.) a.) Device IRQ settings b.) PCI bus speed c.) System battery type d.) Device vendor identification e.) Ethernet MAC address

a.) Device IRQ settings b.) PCI bus speed d.) Device vendor identification

When using regular expressions, which of the following characters match the beginning of a line? a.) ^ b.) ? c.) * d.) +

a.) ^

Which command is used to query information about the available packages on a Debian system? a.) apt-cache b.) apt-get c.) apt-search d.) dpkg e.) dpkg-search

a.) apt-cache remember - apt is a query tool, and dpkg is the install tool

Which of the following commands is used to upgrade the list of available packages when using dpkg based package management? a.) apt-get update b.) apt-get upgrade c.) apt-cache update d.) apt-get refresh e.) apt-cache upgrade

a.) apt-get update

Which of the following commands can be used to create a new file that is 100 kb in size? a.) dd b.) file c.) mkfile d.) touch

a.) dd

Which of the following commands lists all currently installed packages when using RPM package management? a.) yum --query --all b.) yum --list --installed c.) rpm --query --all d.) rpm --list --installed

c.) rpm --query --all

What of the following statements are true regarding /dev/ when using udev? (Choose TWO correct answers.) a.) Entries for all possible devices get created on boot even if those devices are not connected. b.) Additional rules for udev can be created by adding them to /etc/udev/rules.d/ c.) When using udev, it is not possible to create block or character devices in /dev/ using mknod. d.) The /dev/ directory is a filesystem of type tmpfs and is mounted by udev during system startup. e.) The content of /dev/ is stored in /etc/udev/dev and is restored during system startup.

b.) Additional rules for udev can be created by adding them to /etc/udev/rules.d/ d.) The /dev/ directory is a filesystem of type tmpfs and is mounted by udev during system startup. /dev/ is the directory that stores temporary system device data (a swap file for the kernel to use when managing devices) rules.d makes sense (other .d definitions exist and can be modified)

In the vi editor, how can commands such as moving the cursor or copying lines into the buffer be issued multiple times or applied to multiple rows? a.) By using the command :repeat followed by the number and the command. b.) By specifying the number right in front of a command such as 4l or 2yj. c.) By selecting all affected lines using the shift and cursor keys before applying the command. d.) By issuing a command such as :set repetition=4 which repeats every subsequent command 4 times.

b.) By specifying the number right in front of a command such as 4l or 2yj.

Which of the following statements is correct regarding the command foo 1> bar? a.) The stdout from the command foo is appended to the file bar. b.) The stdout from the command foo overwrites the file bar. c.) The command foo receives its stdin from the file bar. d.) The command foo receives its stdin from the stdout of the command bar. e.) The stderr from the command foo is saved to the file bar.

b.) The stdout from the command foo overwrites the file bar. > this means overwrite

Which of the following commands moves and resumes in the background the last stopped shell job? a.) run b.) bg c.) fg d.) back

b.) bg

Which of the following commands changes the ownership of the file.txt to the user dan and the group staff? a.) chown dan/staff file.txt b.) chown dan:staff file.txt c.) chown -u dan -g staff file.txt d.) chown dan -g staff file.txt

b.) chown dan:staff file.txt change owner from dan : to staff 'name of file or directory'

Which of the following commands will display the inode usage of each mounted filesystem? a.) du -i b.) df -i c.) lsfs -i d.) prntfs -i

b.) df -i df = disk file system space usage (by FILE SYSTEM)(including inodes) - so disk filesystem du = estimate file space usage (by EACH FILE) disk used by file

Which of the following commands changes all occurrences of the word 'bob' in the file data to "Bob" and prints the result to standard output? a.) sed '/bob/Bob' data b.) sed 's/bob/Bob/g' data c.) sed's/bob/Bob/' data d.) sed'/bob/Bob/' data e.) sed's/bob,Bob/' data

b.) sed 's/bob/Bob/g' data stream edit by segment, original pattern/new pattern /globally' to the data file

Which of the following commands lists the dependencies of a given dpkg package? a.) apt-cache depends-on package b.) apt-cache dependencies package c.) apt-cache depends package d.) apt-cache requires package

c.) apt-cache depends package

Which of the following shell commands makes the already defined variable TEST visible to new child processes? (Choose two.) a.) visible TEST b.) declare +x TEST c.) declare -x TEST d.) export TEST e.) export -v TEST

c.) declare -x TEST (declare will create a variable (define it) and give it attributes.... -x flag will then export variable to new/next commands) - turns off + turn on d.) export TEST (will directly export defined variable to next command)

Which of the following apt-get commands will install the newest versions of all currently installed packages? a.) auto-update b.) full-upgrade c.) dist-upgrade d.) install e.) update

c.) dist-upgrade

Which of the following commands can be used to search for the executable file foo when it has been placed in a directory not included in $PATH? a.) apropos b.) which c.) find d.) query e.) whereis

c.) find search - seek and ye shall FIND

Which of the following commands prints all files and directories within the /tmp directory or its subdirectories which are also owned by the user root? (Choose TWO correct answers.) a.) find /tmp -uid root -print b.) find -path /tmp -uid root c.) find /tmp -user root -print d.) find /tmp -user root e.) find -path /tmp -user root -print

c.) find /tmp -user root -print d.) find /tmp -user root

Which of the following commands brings a system running SysV init into a state in which it is safe to perform maintenance tasks? (Choose TWO correct answers) a.) shutdown -R 1 now b.) shutdown -single now c.) init 1 d.) telinit 1 e.) runlevel 1

c.) init 1 d.) telinit 1 telinit is literally telling the system a new runlevel

Which of the following commands replaces each occurrence of 'bob' in the file "letter" with 'Bob' and writes the result to the file "newletter." a.) sed '/bob/Bob' letter > newletter b.) sed s/bob/Bob/ letter < newletter c.) sed 's/bob/Bob'letter > newletter d.) sed 's/bob/Bob/g' letter > newletter

d.) sed 's/bob/Bob/g' letter > newletter stream editor 's (match segment) /bob (replace with segment) /Bob /g (do this globally) in the file "letter" > output to new file called "newletter" The s command replaces the first text string with the second text string (pattern). It can be used to manipulate files, as well. Sed Linux command doesn't update your data. It only sends changes to STDOUT. (The file is untouched.) Extremely Powerful! To run multiple sed commands, you can use the -e option like this: $ sed -e 's/This/That/; s/test/another test/' ./myfile Sed command must be separated by a semi colon without any spaces. Also, you can use a single quotation to separate commands like this: sed -e' (you will have the same result). no end specifications, change will happen with first occurrence in each line specify g' for global (meaning will make changes to all instances contained in file) specify /2 at end, and only the 2nd occurrence on each line will be changed

Which of the following commands will reduce all consecutive spaces down to a single space? a.) tr '\s' ' ' <a.txt> b.txt b.) tr -c ' ' <a.txt> b.txt c.) tr -d ' ' <a.txt> b.txt d.) tr -r ' ' 'n' <a.txt> b.txt e.) tr -s ' ' <a.txt> b.txt

e.) tr -s ' ' <a.txt> b.txt trim (remove) space 'blank' from file specified to become new file specified ???

Which SysV init configuration file is commonly used to set the default run level? (Specify the full name of the file, including path.) _________________________________

inittab initialization table system init (boot process) table (tells what system needs to do at boot, including what the default run level needs to be)

Which command is used in a Linux environment to create a new directory? (Specify ONLY the command without any path or parameters.) ___________________________________

mkdir or /usr/bin/mkdir

Which program updates the database that is used by the locate command? __________________________

updatedb this command will create the locate db or update the existing locate db


Kaugnay na mga set ng pag-aaral

Chapter 6 - Discounted Cash Flows and Valuation

View Set

organs of the digestive system: matching

View Set

Principles of Marketing Final Exam Study Guide

View Set

Pre Calculus: Trigonometric functions

View Set