LPI Question Set Flashcards
(152 cards)
What can be used to link together multiple programs so that the output of one program becomes the input of another?
Pipes enable you to link together multiple programs. At the command line, the pipe character is a vertical bar
What command will show you the path of the directory you’re currently working in?
The pwd command will show you the path of the directory you’re currently in.
You type ps ax | grep xterm. What is the purpose of the grep xterm portion of this command?
It searches the output for the string xterm. The grep command searches for patterns in input files (the output of the ps ax command, given the pipe in the original command).
How can you display all the environment variables that are currently set in your login shell?
Type env
How do man pages and info pages differ?
man pages are “flat” documents—that is, single files. By contrast, info pages use hypertext (similar to Web pages) to help organize documents.
What does the uniq command do?
By default, it outputs a file without any duplicate lines from the input file.
What does the fmt command do?
It reformats the paragraphs within a file
You type the command testprog < somefile.txt. What is the effect of the less-than (<) character in this command?
This is an input redirection operator; it causes the contents of somefile.txt to be sent to testprog as if the contents of somefile.txt were typed at the console.
How would you read a Linux manual page?
Type man topic, where topic is the name of the command, configuration file, or other topic you want to investigate.
What is the function of the tail command?
It displays the last few lines (10 by default) of a file.
What is the difference between grep and egrep?
The grep program uses basic regular expressions by default, but egrep uses extended regular expressions by default.
What command would you use to combine two text files, each of which contains tab-delimited data with at least one field in common between the two files?
The join command performs this task.
How do the exit and logout commands differ?
The logout command works with login shells only, whereas exit is intended for use with non-login shells (such as xterm windows), but in practice works with both login and non-login shells.
A text file contains tabs that are expanding into the wrong number of spaces in your chosen text editor. What command can you use to process the text file to substitute multiple spaces for each tab?
The expand command does this job.
As root, you type tail -f /var/log/messages. What will be the result of this command?
The command displays the last few lines of /var/log/messages and then continues to monitor the file and display new lines as they’re added to it.
As root, you type renice 19 2548. What is the effect of this command?
The priority of the process with a process ID (PID) number 2548, if it’s present, is changed to 19—that is, the process’s priority is set to the lowest possible value.
What is the purpose of the nice command?
It allows you to run a program with a specified priority.
What does the output of the uptime utility show?
The output of the uptime utility shows the time the system has been running, as well as three load averages (for the past minute, the past 5 minutes, and the past 15 minutes).
What are the advantages of shared (aka dynamic) libraries over static libraries?
Shared libraries save disk space and memory, at least when they’re used by multiple programs.
What can you learn from the uname utility?
You can learn the kernel name, the network hostname, the kernel release, the kernel version number, the machine name, the processor type, the hardware platform, and the OS name.
What are some common solutions to the problem of an unsatisfied dependency when installing a program package?
You can force the installation, install/upgrade the required package, install a different version of the target package, or rebuild the target package from source code.
How can you identify processes that consume an inordinate amount of CPU time?
You can use either the top utility or the ps utility with appropriate switches.
Sally types rpm -e badprogram as root. What is the effect of this command, if the system uses RPM?
The badprogram package, if it’s installed and not depended on by other programs, is uninstalled from the system.
What is the function of the top program?
top displays an ordered process list, updating it frequently. By default, top orders processes by CPU use, but you can give it commands to order processes by other criteria.