UNIX

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

Which prompt does the root user receive when logged in to the system?

#

Which prompt do regular users receive when logged in to the system?

$

In the bash shell, the total number of command line arguments is stored in variable:

$#

Inside a bash shell script, you can access the PID of the script using which of the following environment variables:

$$

Which special built-in shell variable returns all positional parameter values?

$*

The first argument on the command line when executing a bash shell script is stored in the variable:

$1

Which of the following lines can be used to perform command substitution with a shell script? (Choose all that apply.)

'command', $(command)

What special character represents 0 or more characters on the Bash shell command line?

*

Nice values are used to affect process priorities using a range betwen ________________________.

-20 and 19

The command: chmod 317 file1 would produce which of the following lines from the ls command.

-wx- -xrwx 1 user1 root 0 Apr 29 15:40 file1

Which command searches the working buffer in a file opened in the vim editor?

/ or ?

What directory contains all the files needed by the system for initial startup?

/boot

Which of the following files is always executed immediately after any user logs in to a Linux system and receives a BASH shell?

/etc/profile

Which of the following is an absolute pathname?

/home/resume

Referring to the shell script below, what is the value of $# when the loop terminates?

0

Which of the following kernels are not developmental kernels?

4.0.0 (developmental kernels have an odd minor number)

What kill level signal cannot be trapped?

9

While in vim command mode, what command will exit without saving the file?

:q!

What vim command searches the current line in the buffer for "big" and replaces it with "large"?

:s/big/large/

What command causes vim to display line numbers next to the text being edited?

:set number

What is a soft link?

A new file containing the path name to another file.

A hard link is:

A pointer to the inode of an existing file.

Which of the following best describes what an editor buffer is?

A temporary storage area for text you are editing

PATA (Parallel Advanced Technology Attachment) hard disks are also referred to as:

ATA and IDE

You noticed a file in your home directory that has a + symbol appended to the mode. What does this indicate?

Additional entries exist within the ACL of the file that can be viewed using the getfacl command.

Which of the following can be used to install a virtual Linux system with another operating system?

All of the Above

A file with the following permissions: -rwxr-xr-x

All of the above

A permission value of 764 for the sample file means that:

All of the above

What is the difference between a shell function and a shell script?

All of the above

Which of the following are characteristics of Open Source Software?

All of the above

Which of the following are common methods for gaining support for Linux?

All of the above

Which of the following is the Linux equivalent of vi?

All of the above

With the exception of the file owner, after the chmod 600 sample command has been executed (where sample is a directory):

All of the above

If properly configured a computer can be booted from which of the following?

Any of the first devices in answers A, B, and C will work. A fixed (hard) drive, USB Flash drive, Netword Connection, or DVD/CD can be used to boot a computer..

You can display names and current values of all bash shell environment variables with the following command:

Both A and C are correct. (printenv, env)

What creates a process under Linux?

Both Answers A and B are correct.

Given the following bash shell statement: if [[ $# -eq 0 || $# -gt 1 ]] then echo "Usage: $0 ordinary file" exit 1 #(returns an exit value to the shell and is commonly interpreted as a script failure)fi what condition will cause the echo command to be executed?

Both B and C.- if no argument is listed on the command line. - if more than one argument is listed on the command line.

Which of the following is NOT a computer port used to connect external devices such as printers and keyboards?

CD/DVD-x

Which of the following is NOT commonly used virtualization software?

Comanche VM server

Under Bash Shell, the command: city=Los Angeles

Creates a user-defined variables city and initializes it to Los, and tries to execute Angeles as a command.

Which of the following are commonly used text editors available for Linux?

EMACS, nano, gedit

Which character in vim allows you to go from Insert Mode to Command Mode?

Escape Key

A symbolic link is also known as a soft link and is depicted by an @ symbol appearing at the beginning of the filename when viewed using the ls -l command. True or False?

False

Because stderr and stdout represent the results of a command and stdin represents the input required for a command, only stderr and stdout can be redirected to/from a file.

False

Hard links need not be on the same file system as the target file.

False

In Linux, each partition or drive is referred to by a letter such as C:, D:, E:, F:, etc just as it is in Windows.

False

In Linux, since there can be multiple file systems, each has a root (/) directory.

False

Linux commands entered via the command line are not case sensitive?

False

Only the root user can modify a file that has the immutable attribute set.

False

The Linux Operating System requires a different CPU (processor) than that required for Windows.

False

The command tail names will allow you to display the last 20 lines in the file "names"

False

There is no real difference between the "S" and "s" special permissions when displayed using the ls -l command. One just means it is on a file, and the other that it is on a directory. True or False?

False

To kill a process running in the background, you must place a % character before its process ID?.

False

vim is an abbreviation for an updated vi editor - vi Modified

False

Which of the following is not a piece of information that the Fedora installation program prompts you for?

Firewall settings

To which license does Linux adhere?

GNU General Public License

Which common GUI environments are available in most Linux distributions? (Choose all that apply.)

Gnome, KDE

The ls -l ~ displays the long listing of all the files in your

Home directory

What equivalent to the man command generally provides an easier-to-read description of the queried command and contains links to other related information?

Info

In which vim mode do you actually type-in the text?

Insert Mode

A runaway process that is faulty and consuming mass amount of system resources _________________.

Is a rogue process

After typing the ls -a command, you notice a file whose filename begins with a dot ( . ). What does this mean?

It is a hidden file

After typing the ls -F command, you notice a file whose filename ends with an asterisk ( * ). What does this mean?

It is an executable file

Which command can be used to see processes running in the background?

Jobs

Which of the following Linux distributions is likely to be used by a CyberSecurity worker?

Kali

Which two people are credited with creating the UNIX operating system? (Choose two answers)

Ken Thompson, Dennis Ritchie

Linux was developed by __________ to resemble the _________ operating system.

Linus Torvalds, MINIX

What is the difference in output between these two command: echo The working directory is `pwd` echo The working directory is $(pwd)

No difference

What is the symbol that creates a pipe between commands?

None of the above

Many types of software are available today. Which type of software does Linux represent?

Open source

The mode section of the inode stores permissions and is divided into sections that include _________________.

Owner, group, other

What shell environmental variable is set equal to the path of the current working directory?

PWD

Every process has a process ID and a __________.

Parent process ID

Which of the following (choose one or more) are considered system services?

Printing, network access, memory management, and program scheduling

What is a PID?

Process identification number

Which of the following are commonly used Linux software package managers? (Choose all that apply.)

RPM (Red hat), DPM (Debian), Zypper (openSuse)

Which of the following commands will most likely increase the chance of a process receiving more time slices?

Renice -12

What does the vim command: :1,$s/ten/10/g do?

Replaces every occurrence of the string ten with with the string 10.

Given the following block of code in a bash shell script: #EXAMPLE C option = $1 case "$option" d|D) date ;; l|L) ls ;;w|W) who ;;q|Q) exit 0 ;;esacWhat value of $option will cause the date to be displayed?

Response A or B will work. "d" or "D"

Who formed the Free Software Foundation to promote open development?

Richard Stallman

Which of the following can be used on Linux to provide file and print services?

Samba

The at command is used to ________.

Schedule processes to run at a single instance in the future

Under the bash shell, the command set $(date) is used to:

Set the positional parameters to the output of the date command

After you log in terminal, you receive a user interface called a ______

Shell

The command: chmod 600 sample :

Takes away all privileges from the group users

Referring to the shell script below, what is the purpose of the exit commands?

Terminates the shell script. Provide a numeric exit status value

Under Bash shell, the command: export CDPATH=$HOME:$HOME/MyFiles causes:

The cd command will search the HOME directory, the MyFiles directory, then the working directory

In the shell script below, what occurs if no command line argument is entered after the script name?

The correct usage message"Usage: addall number-list"is displayed.The script stops without doing any calculations.There are no numbers to add. (all of the above)

Assume the following statement occurs first in a bash shell script: if [ $# = 0 ] then directory="~" fi What happens if the shell script is run without an argument?

The user's home directory is used.

A relative pathname is a pathname of a file or diretory starting from:

The users current working directory

When you run the ps command, how are daemons process recognized?

There is a question mark in the TTY column

A Linux process is a program that is running in memory and the CPU.

True

A directory is a type of file.

True

As daemon processes are not associated with terminals, you must use an options such as -e with the ps command to view them.

True

Each device driver tells the operating system how to use that specific device.

True

If you boot your computer from Linux live media, you will be able to use a Linux system prior to installing Linux on permanent storage?

True

If you boot your computer system using live media such as Fedora, you will be allowed to start your system from a live media version of the software?

True

In addition to any upper or lower case letter and numeric digits, the use of the underscore, the dash, and the period are permitted in file names

True

The grep command is used to find lines in a text file which match a common regular expression.

True

The operating system software is necessary for a computer to function?

True

The vi editior supports the use of regular expessions.

True

What bash command will create variable username and assign it the value of "George W. Bush"?

Username= "George W. Bush"

What is the result of the following Shell command? name = John Doe II

Variable name is created with value of John

Given the following code segment in a bash shell script, while [ "$secretcode" != "$yourguess" ] doecho "Good guess but try again!" read -p "Enter your guess: " done What will cause the loop to continue?

When $yourguess is not equal to $secretcode.

Which command displays the users who are currently logged in to the Linux system?

Who

How can you bypass the wait function and send a user process to the background?

You can use the Ctrl+z key combination and the bg command.

If you want to set all three special access bits (SUID, SGID, and sticky) for the sample file and set the rest of its access bits to 754 with one command:

You need to execute the chmod 7754 sample command

If your search path does not include the path to a particular shell file, and you try to run that shell file by typing its name on the command line, what happens?

You will get an error message of "command not found"..

Under Bash shell, the environment variable HOME contains the absolute pathname of:

Your home directory

Using wildcard metacharacters, how can you indicate a character that is not an a or b or c or d?

[!a-d]

Which keystroke command in vim allows you to append text AFTER the character the cursor is on?

a

When interpreting your commands, the shell assumes the first word you type on the command line is

a valid Linux command name

Which of the following statements is true? (Choose all that apply)

a.) If /etc/at.allow exists, only users listed in it can use the at command.b.) If /etc/cron.allow exists, only users listed in it can use the cron command.c.) If /etc/cron.deny exists and /etc/cron.allow does not exist, any user not listed in /etc/cron.deny can use the cron command.

What command will create an alias name dir which will execute the "ls -al" command?

alias dir='ls -al'

The pkill command terminates ____________.

all instances of a process with the same name matched by a regular expression

The command: grep -i "Unix OS I" Orientation will display all lines in the Orientation file which

all of the above

The root user has the authority to:

all of the above

Under Bash shell, the following command creates a user-defined shell variable, called name, and initializes it to John Doe:

all of the above

Under the Bash Shell the command: cat myaliases > ronsaka 2> errors will

all of the above

The purpose of the following line in a bash shell script: #!/bin/bash is to:

all of the above - cause the script to be executed as a bash shell script only.- allow the script to be run as a bash shell script from a tech shell. - assures that the bash shell is the one used to interpret the script.

What does the following command in .bash_profile (or .profile) do? if [ -f ~/.bashrc ] then . ~/.bashrc fi

all of the above- tests whether .bashrc exists in your home directory.- if .bashrc is not present in the startup (home) directory, the remaining commands in .bash_profile (.profile) are executed. - if .bashrc exists when the login shell runs, the commands in it are executed.

The output of the command: ls -l produces information about each file in the working directory including:

all of the above.

A regular expression will _________________

allow you to specify a certain pattern of text with a text document

What command is equivalent to the man -k keyboard command

apropos keyboard

Which of the following are directories defined by the Filesystem Hierarchy Standard?

bin, etc, mnt, dev

Assuming that execute permission for a shell script named: "testscript" has not been set (turned on), then the script:

can be executed with the command: /bin/bash testscript

Which of the following will display the file "names" with line numbers at the beginning of each line?

cat -n names

BASH is an acronym for:

cat myfile names |& tr "[a-z]" "[A-Z]"

A user typed in the command pwd and saw the output: /home/jim/sales/pending. How could that user navigate to the /home/jim directory?

cd ../.. or cd /home/Jim

What command will change the working directory to /home/rbass/sourcefiles?

cd /home/rbass/sourcefiles

Which of the following commands will change the user ownership and group ownership of file1 to user1 and root, respectively?

chown user1:root file1

Which command blanks the terminal screen, erasing previously displayed output?

clear

The vi editor can function in which of the following modes? (Choose all that apply.)

command, insert

What are the vim modes of operation?

command, last line, and insert

Referring to the following shell script, what would happen if a user typed the following command line? command line: addall 1 4 9 16 25 36 49

count is equal to 7

If you have any empty directory called ~/backups, you can copy directory ~/courses into it by using the following command:

cp -r ~/courses ~/backups

What must a user do to run cp or mv interactively and be asked whether to overwrite an existing file?

cp and mv are interactive by default

A keyboard interrupt is:

created by typing CONTROL-C

What command is used to view and modify user jobs scheduled to run with cron?

crontab

What is the result of the following command line? echo Number of days in 60 years: $((60*365))

displays: Number of days in 60 years: 21900

How do double quotation marks (") differ from single quotation marks (') affect expansion on the command line?

double quotations permit variable and parameter expansion while single quotations suppress all expansions.

What is the vim command to delete the text from the cursor to the end of the current line?

d}

Which command can be used to display the value of a specific variable?

echo

The vim yank command (y) is identical to the delete command (d)

except that it does not delete text from the work buffer..

Before a user-defined variable can be used by processes that run in subshells, that variable must be ____________.

exported

What will the following wildcard regular expression return: file[a-c] ?

filea, fileb, filec

What system calls are made when you run a program from the command line?

fork() and exec()

A process spawning or initiating another process is referred to as________.

forking

What command can you use to safely shutdown the Linux system immediately?

halt

What command displays commands from the history list?

history

What is the name of the root process under Linux?

init

Which process has a PID of 1 and a PPID of 0?

init

The shell expands the characters: ~/ (a tilde followed by a slash) at the start of a pathname

into the pathname of your home directory.

An inode in Linux

is the control structure for a file.

After executing the following command: ls /etc/hosts /etc/h 2>badoutput What will be the contents of badoutput?

it will contain error messages generated by the command since 2> redirects the stderr to a file

What is the most common and preferred method of sharing files among selected Linux/UNIX users?

links

Which command creates a link?

ln

What command will create a soft link named: "mypass" to /etc/passwd?

ln -s /etc/passwd mypass

Which of the following Linux commands will display a list of files in the current working directory?

ls, dir

What command will create a new directory called sourcefiles?

mkdir sourcefiles

Linux is a _________________ and __________________ operating system.

multiuser, multitasking

What command can be used to rename files and directories?

mv

To insert a blank line below the line the cursor is on in the vim work buffer, the command is:

o

In Vim, text that has been deleted or yanked to the general-purpose buffer can be inserted after the position of the cursor with the command

p

How can you prevent a metacharacter (such as the $ character) from being interpreted by the shell?

precede it with a \ backslash

What command shows a list of the current processes Linux is executing?

ps

Which command entered without arguments is used to display a list of processes running in the current shell?

ps

Which command would a user type on the command line to find out the current directory in the directory tree?

pwd

What will typing q! at the : prompt in command mode do when using the vi editor?

quit without saving changes

Which construct can be used in a shell script to read stdin and place it in a variable?

read

For a directory, users granted read and execute permissions are allowed to:

read the directory's contents

If myprograms is a directory, what does the command: rm -r ~/myprograms do?

recursively deletes files including any subdirectories in my programs, and then deletes the directory my programs

The vim period (.) command:

repeats the last command

A special device file is used to _________?

represent hardware devices such as hard disk drives and ports

If "resume" is the name of a file in the home directory off the root of the filesystem and your present working directory is home, what is the relative name for the file named resume?

resume

What command will allow you to remove a link to a file?

rm

What command will remove directory source files

rmdir sourcefiles

What command will remove directory sourcefiles

rmdir sourcefiles

What types of files are candidates for having the execution access permissions set for users?

script files

When a user is given execute permission for a directory, he/she may:

search it

The which command ________________

searches for a file only in directories that are in the PATH variable

Which command could you use to see a list of all environment and user-defined shell variables as well as their current values.

set

What is the result of the following command? chmod 700 myfile

sets access privileges for myfile to read, write, and execute for the owner

User entered commands are first processed by the ______________________

shell

The * ? and [ ] symbols are considered to be what type of metacharacters?

shell wildcards

Which type of link can be used to create a directory entry to a file in another file system?

soft link

Every computer consists of physical components and non-physical components. The non-physical components of a computer that understand how to work with the physical components are referred to as:

software

What does the /var diretory contain?

spools and log files

For each command that can be manipulated by the BASH shell, which of the following are valid file descriptors?

stdin, stderr, stdout

Which command searches for and displays any text contents of a binary file?

strings

Which of the following commands increments the value of a bash shell variable, sum, by one:

sum=$(($sum+1))

The set-user-ID bit (SUID) allows an executable file to:

take on the privileges of the owner of the file when it executes.

When you change the data in a file that is hard-linked to three others, _______________

the data in the file you modified as well as the data in all hard-linked files are modified, because they share the same data and all have the same inode and file size

Which culture embraced the term "GNU" (GNU's Not UNIX) and laid the free software groundwork for Linux?

the hacker culture

The list of directories stored in the PATH variable is known as

the search path

To dereference a symbolic link means:

to follow the link to the target file.

Which command is used to gain real-time information about processes running on the system with the most processor-intensive processes listed at the beginning of the list?

top

What vim command restores text that you just deleted?

u

Which one of the following statement is not true?

vi stands for virtual editor

The current value for the HOME variable is displayed by which of the following commands?

when you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead

Which vim command is used to delete the character where the cursor is located?

x


Kaugnay na mga set ng pag-aaral

NBCOT Exam: Hand and UE Disorders and Injuries

View Set

Yak - Chapter 13 Distribution and Deployment of Field Forces

View Set

Transitions Exam 1: Nursing Licensure and Certification/ Nursing Research and Evidence-Based Practice

View Set

lesson 9.4 Animal feeds and feeding AG

View Set