Linux and Unix Final
Insert mode, which lets you enter text, is accessed by typing the letter ____ after the vi editor is started.
"i"
To execute a program in your current directory, what would you type in front of the program name?
./
Suppose you have extracted the files from software archive and are in the directory into which the files have been extracted. To create a Makefile with all the default values you would type___________
./configure
The ____ directory contains executables, which are the programs needed to start the system and perform other essential system tasks.
/bin
The ____ directory contains the kernel (operating system) images.
/boot
houses kernel modules, security information, and the shared library images
/lib
is a relatively new recommendation of the FHS
/media
mount points for temporary mounts by the system administrator reside in this directory
/mnt
this directory occupies no space on the disk
/proc
home directory for the system administrator
/root
programs that start the system, programs needed for file system repair, and essential network programs are stored in this directory
/sbin
The ____ directory holds files that are created temporarily, such as files used for printing documents (spool files)
/tmp
temporary place to store data during processing cycle
/tmp
houses software offered to users
/usr
holds subdirectories that often change in size
/var
1. combines the convenience and familiarity of the personal computer with the ability to share files and other computer resources 2. provides multiuser access to network resources 3. large computer that has historically offered extensive processing, mass storage, and client access for industrial-strength computing4. another name for server 5. device that has a monitor and keyboard, but no CPU 6. interface between the user and the operating system 7. base operating system 8. name that identifies a grouping of computer resources on a network 9. account that has complete access to a UNIX/Linux system
1. network 2. server 3. mainframe 4.host 5. terminal 6. shell 7. kernel 8. domain 9. root
Using the octal permission format, chmod ____________________ data, assigns read,write, and execute to owner; execute to group; and execute to other.
711
To append output to an existing file, you use ____.
>>
To increment the integer variable N by 1 you would type
N=$[$N+1] or N=$((N+1))
The ____________________ variable provides a list of directory locations where UNIX or Linux looks to find executable scripts or programs.
PATH
To add the directory "/home/bin" to your PATH, you would type
PATH="$PATH:/home/bin"
A(n) ____ path begins at the root level and lists all subdirectories to the destination file.
absolute
Linux uses the freeware ____ shell as its default command interpreter.
bash
You can use the ____ command to show the system calendar.
cal
The ____ statement simplifies the selection of a match when you have a list of choices.
case
The command to view the contents of a small file is
cat
To display the contents of the "if.sh" file with line numbers, you would type
cat -n if.sh
To navigate the UNIX/Linux directory structure, you use the ____ command.
cd
to change directory from your current directory to your parent directory you would type
cd ..
You can change the pattern of permission settings by using the ____ command.
chmod
to modify file permissions, use the _____________ command
chmod
____ gives the owner read, write, and execute permissions.
chmod 755
To determine whether two files are different use the _____________ command
cmp
You can access vi's ex mode by pressing Esc, and then typing a(n) ____ to enter extended commands at the bottom of the screen.
colon (:)
The vi editor works in three modes: insert mode, ____ mode, and extended mode.
command
The command to copy a file is
cp
To log out of UNIX/Linux (Bourne, Korn, or Bash shells) you can type "exit" on the command line or press ____.
ctrl+d
To reference a variable, you use a dollar sign ($) in front of it or enclose it in ____.
curly brackets ({ })
To see how two text files differ, use the __________ command:
diff
for COLORS in red blue green echo $COLORS
do done
UNIX/Linux systems interpret ____ to mean the parent directory.
dot dot (..)
If you plan to have multiple users accessing your system, you should consider having a /var partition in which to store some or all of the nonkernel operating system programs that are accessed by users.
false
In vi, a tilde (~) precedes all line-oriented commands.
false
UNIX/Linux commands are not case sensitive.
false
You use the chexec command to indicate that a (shell script) file can be executed.
false
The command to determine what type of contents a file contains is
file
You use the ____________________ command to loop through a range of values.
for
The root of a file system is denoted by the ____.
forward slash (/)
How do you stage files for a commit?
git add
What's the git command that downloads your repository from GitHub to your computer?
git clone
How do you supply a commit message to a commit?
git commit -m "I'm coding"
What's the git command that downloads the latest version of your repository from GitHub to an existing repository on your computer?
git fetch
What's the git command that lets you combine any changes you made on another computer with the version of your repository on your current computer?
git merge
What's the opposite of git clone, that instead of downloading your code from GitHub, uploads your changes and code back to GitHub?
git push
To uncompress the compressed archive "software.tar.gz" you would type
gunzip software.tar.gz
to display the first 10 lines of a file, use the _____________ command
head
You can use the -a option with the ls command to list ____________________ files.
hidden
To see a list of the commands you have typed, use the_____________ command
history
To pause the display while displaying the contents of large files, you can use the _________ command
less
To list all the files in your current directory, including the hidden files, but without the file permissions, use the __________ command
ls -a
To list all the files in your current directory, including the hidden files and the file permissions, use the __________ command
ls -al
To list the files in your current directory including the permissions on the files use the _____________ commmand
ls -l
Once the Makefile has been created, you can build the software by using the ________ command.
make
To verify that there were no errors when building software from a Makefile, you can use the command
make check
The ____ command is used to create a new directory.
mkdir
The command to create a directory is
mkdir
UNIX and Linux are ____ systems, which allow one user to execute more than one program at a time.
multitasking
UNIX/Linux are ____ systems, which let many people simultaneously access and share the resources of a server computer.
multiuser
to change the name of file1 to file2 you would type
mv file1 file2
To move the file hello.sh from your current directory into a subdirectory named bin you would type
mv hello.sh bin
After you install Git and prior to issuing the first commit, which two configuration properties does git expect to be configured?
name and email address
You can change your password, if necessary, by using the ____ command, but you must know your current password to change it.
passwd
In shell scripts, comment lines begin with a(n) ____.
pound ( # ) symbol
If you have configured your prompt so that it does not show your working directory, you can use the ____ command to verify in what directory you are located, along with the directory path.
pwd
The command to display the name of your current directory is
pwd
the command to remove a directory that contains files and/or subdirectories is
rm -rf
To remove a file named "data" from your current directory you would type
rm data
The command to remove an empty directory is
rmdir
With no options, ____ displays the current listing of Bash environment and shell script variables.
set
____________________ are text files that contain sequences of UNIX/Linux commands.
shell scripts
The system administrator is also called the ____________________, because the system administrator has unlimited permission to alter the system.
superuser
The username of the system administrator is ________
superuser
To extract the individual files from the archive "software.tar" you would type
tar -xvf software.tar
The head and tail commands, allow you to view the first few or last few lines of a file (____ lines by default).
ten
Computer files containing nothing but printable characters are called ____ files.
text
The ____ is shorthand for the home directory, which typically has the same name as the user's account name.
tilde (~)
A ____ is used to refer to the user's home directory.
tilde(~)
A directory is a special kind of file that can contain other files and directories.
true
Most shells keep a list of your recently used commands and allow you to recall a command without retyping it.
true
The clear command has no options or arguments.
true
The command cd source uses relative path addressing.
true
The rm -r command can be used to delete a directory that is not empty.
true
UNIX/Linux systems interpret a single dot character to mean the current working directory.
true
A user with email address [email protected] would configure her email address in git by typing git config --global __________ [email protected]
user.email
A user named Jane Doe would configure git with her name by typing : git config --global __________ "Jane Doe"
user.name
To use vi to create a new file named "if.sh" you would type
vi if.sh
To display statistical information about a file, including the number of lines, words, and characters in the file, use the _____________ command:
wc
The command to download a software archive from an Internet URL is ________
wget
The ____ statement continues to loop and execute commands or statements as long as a given condition or set of conditions is true.
while
To determine information about who is logged in, you can use the ____ command.
who