Linux

Ace your homework & exams now with Quizwiz!

You are looking for a specific fivecharacter string in the ~/customquote file with the grep command. The string should begin with the letter g, end with an y, and be the last string on the line Which regular expression should you use with grep?

"g...y$"

You want to mount a number of file systems each time the system is brought up. Which configuration file should hold the configuration information for the file systems to be mounted?

* /etc/fstab

Which directory is the home directory for the root user account?

* /root

You have opened the /root/myscript file in vi. While looking at the file, your soda spilled, and you hit several keys on the keyboard trying to pick it back up. There are extra characters everywhere in the file, and you know you can't fix it. How do you exit vi without saving the changes? :q :x :q! :wq

* :q!

You are editing the /etc/default/grub file. Which option should you use to set the default operating system?

* GRUB_DEFAULT=

You have installed a package called mathpac with aptget. After a system upgrade, the package is not working correctly. Which command is the most correct option to get the package to work?

* aptget upgrade mathpac

You are using awk to print a sorted list of the user names in /etc/passwd. Which command will accomplish the sorted output?

* awk F: '{print $1}' /etc/passwd | sort

You want to view partition information for your sda device. Which commands could you use to view the partitions defined on sda? (Select two.) fdisk /dev/sda, then press p fdisk l cat /etc/part cat /proc/part

* fdisk /dev/sda, then press p * fdisk l

You are accessing the /home/shants/depsmark text file through a terminal connection. The file has long lines of text, yet your terminal only shows 75 characters per line. What command should you use to limit the lines in the file to the limits on the terminal?

* fmt /home/shants/depsmark

You need to create an ext4 file system on the first partition on the second hard disk drive. What command should you enter at the command prompt?

* mkfs.ext4 /dev/sdb1

After using the locate command, you discover some of your files are not being listed in the search results. What would you enter at the command prompt to update the /var/log/locatedb file?

* updatedb

Under the Filesystem Hierarchy Standard (FHS), what is the full path to the directory that contains the device files for a Linux system?

/dev

Type the full device file name for the second partition on the hard drive with the lowest ID number?

/dev/sda2

What is the correct order for the boot phases of a Linux computer?

1ST --> BIOS 2ND --> Boot Loader 3RD --> OS Kernel 4TH --> Init

You are called into the office of a newly hired manager. He has copied a file from his old place of work onto his new workstation, but is now receiving an error message that access is denied each time he tries to access the file. He is not the owner of the file, and not a member of the group the file is associated with. Which of the following represents the least set of file permissions needed for him to be able to read and write to the file?

666

Which of the following options is the standard shell for most Linux computers?

Bourneagain shell (bash)

Which daemon allows processes to communicate which each other and relay information about hotplug devices?

D-Bus

Which environment variable affects the number of past commands used in the current shell session?

HISTSIZE

Drag the permission string on the left to the category on the right. (Tip: Some permission strings will not be used.)

Hard link --> rwxrxrx Symbolic link --> lrwxrwxrwx

You need to manage a process in the foreground by pressing Ctrl+C on the keyboard. What signal code is sent to the process?

SIGINT

Which of the following presents the greatest security risk?

The PATH statement includes . (period).

Which file system is a FAT32 file system for Linux?

VFAT

You have a gedit process with a job ID of 6. Which command would you enter at the command prompt to send the process to the background?

bg 6

Which of the following commands sorts the contents of wordlist1 and wordlist2 and sends the result to standard output?

cat /usr/wordlist1 /usr/wordlist2 | sort

Which of the following commands displays the contents of wordlist1 and wordlist2 then sorts the combined contents, then sends the results to the monitor and a file named sortedwordlist?

cat /usr/wordlist1 /usr/wordlist2 | sort | tee sortedwordlist

Which command reconfigures an already installed package?

dpkgreconfigure

Which command can you enter at the command prompt to list all files and directories in the badams home directory along with a file size and a total amount of space taken up by the directory?

du ac /home/badams

You are searching the standard input for any line containing JAMESTOWN at the end of a line. Which egrep constructor should you enter at the command prompt?

egrep JAMESTOWN$

Which of the following commands finds files with the .txt extension in the /home/gshant directory?

find /home/gshant name '*.txt'

You need to find all files in the /home/gshant directory that are larger than 300K. You change directories to /home/gshant. What would you enter at the command prompt to find these files?

find size +300k

After updating the settings in the /etc/default/grub file, you need make sure the changes are written to the grub.cfg file to take effect. What would you enter at the command prompt to write the changes to the grub.cfg file?

grub2mkconfig o /boot/grub2/grub.cfg

You just installed a new CDROM drive in your computer. After boot, you can't find the CDROM drive anywhere. What commands could you enter to start troubleshooting? (Select two.)

journalctl dmesg

Which of the following commands displays all of the shared library information for the /bin/bash executable?

ldd v /bin/bash

A user is trying to access a file system mounted at /mnt/sdb1 but receives an error No such file or directory. Which commands can you use to see the current mount points? (Choose two.)

mount df

You want to view all currentlyrunning processes that include getty in the process name. Which command would you use?

ps A | grep getty

You are preparing to use a logical volume with LVM. Which of the following commands initializes a physical volume?

pvcreate

What would you enter at the command prompt to make rpm perform an MD5 checksum on the myapp5.4.rpm package?

rpm V myapp5.4.rpm

Which sed flag or option allows you to exchange one string of characters for another string of characters in a file?

s

You want to issue a simple command to replace all the occurrences of the string foo with the string bar in the file myfile.txt. You have decided to use sed. Which line will work?

sed e 's/foo/bar/g' myfile.txt

Which command will display each line in a text file based on the alphabetic characters?

sort

You are on a systemd system and you want to change from the currently running target unit, without rebooting the system, to a target that supports networking, multiple users, and displays a graphical interface. What command should you enter?

systemctl isolate graphical.target

You are troubleshooting a problem with your email server. You want to monitor the messages from your mail server as you send test messages to it. Which command will work best?

tail n5 f /var/log/maillog

A user calls the help desk. Each time he creates a new text file, permissions of 640 are applied to the file and he must use chmod to set them to 644. What command should you enter in the user's profile to set the default permission for newly created files to 644?

umask 0022


Related study sets

Types of fires and extinguishers

View Set

World Science Fiction Terminology

View Set

International Marketing Chapter 8

View Set

Chapter 28: Disorders of Cardiac Conduction and Rhythm Patho Prep U

View Set

Chapter 3: Transfer of Real Property

View Set

Introduction to Probability Unit Test Review and Test 100%

View Set

CCNA 1 v7.0 Final Exam Answers Full - Introduction to Networks

View Set

Chapter 24- Toward a Modern America: The 1920s

View Set