0% found this document useful (0 votes)
142 views

Linux Test 2 Q and A

The document provides information about kernel mode vs user mode in Linux operating systems. It discusses: 1) The kernel is the core software that allows sharing of computer resources and interacts with hardware. It runs in kernel mode, also called system mode. 2) User programs run in non-privileged user mode. To access system resources, a user mode process must temporarily switch to kernel mode. 3) Device drivers and other privileged software must run in kernel mode to directly control hardware. However, this makes the kernel more vulnerable to crashes from bugs or errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
142 views

Linux Test 2 Q and A

The document provides information about kernel mode vs user mode in Linux operating systems. It discusses: 1) The kernel is the core software that allows sharing of computer resources and interacts with hardware. It runs in kernel mode, also called system mode. 2) User programs run in non-privileged user mode. To access system resources, a user mode process must temporarily switch to kernel mode. 3) Device drivers and other privileged software must run in kernel mode to directly control hardware. However, this makes the kernel more vulnerable to crashes from bugs or errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 17

Class 1 Part 1

Kernel mode vs User Mode


Q. What is a kernel.
A. A kernel is the core of any computer system. It is software that allows users to
share computer resources The kernel is the main software of the OS. The kernel
interacts with the hardware and is software dependent. It is the first program to get
loaded and runs until the session is terminated.
Q. Where is the kernel located on linux
A. On hard disk is REPRESENTED by the file /boot/vmlinuz - not a spelling error
Q. What command do you have to enter for elevated access and what does it stand
for
A. Sudo, it stands for Super User Do
Q. What are the two different kernel types
A. Monolithic and Micro
Q. What makes a kernel Monolithic. What is the advantage of this?
A. All OS Codes are in a single module, Available as a single file.
Q. What makes a Kernel Micro. What is the advantage of this?
A. OS components Run in their own address space, Device Drivers, Programs and
system service run outside of the kernel memory space. The advantage of this is it
supports modularity and is lesser in size.
Q. What is Kernel Mode Also Referred to as?
A. System Mode
Q. What two distinct mode can the CPU of Linux operate in.
A. Kernel Mode and User Mode
Q. What is user mode for.
A. Non privileged mode for user programs.
Q. What is kernel mode used for
A. Mainly for restriction and protection from unauthorized user application
programs.
Q. What mode is the CPU in when it assumes it executing trusted software.
A. Kernel Mode

Q. Why must things like device drivers be run in privileged mode.


A. They have to run in privileged mode because it needs to tell the kernel exactly
how to interact with pieces of hardware.
Q. Why is running things in kernel mode more vulnerable.
A. Because the kernel runs all programs as trusted in kernel mode it is a lot more
vulnerable to causing crashes.

System Call
Q. What is a system Call
A. A system call is a request to the kernel in a UNIX operating system by an active
process performed by the kernel
Q. What is a process
A. A process is an executing instance of a program.
Q. What is an active process.
A. An active process is one that is currently advancing in the cpu
Q. What is Input/Output (I/O)
A. Input/Output is any program operation or device that transfers data from the cpu
to or from peripheral devices like keyboards and mice.

User Mode
Q. What type of mode is user mode.
A. User mode is a non-privileged mode
Q. What are processes running in non-privileged mode not able to access.
A. Processes in non-privileged mode are not able to access portion of ram (memory)
that has been allocated to the kernel.
Q. What must a user mode process do if it wants to access the services provided by
the kernel (system resources)
A. It must temporarily switch into kernel mode which has administrative privileges.
Q. What does the kernel do when is satisfies a request from a user mode process.
A. It restores the process to user mode.

Q. What is the standard procedure to switch from user mode to kernel mode called
A. 0x80 software interrupt.
Q. Which mode is the normal mode for operating for programs like web browser,
calculators etc.
A. User Mode
Q. How does code running in user mode access hardware or memory
A. They delegate to systems APIs (application program interface) and the kernel
takes care of the rest.
Q. What protection does running programs in user mode offer you. (related to
crashes)
A. Crashes are always recoverable.
Q. How many privilege levels does a UNIX OS require
A. At least 2 levels.

Overview
Q. What is a system Call
A. System Calls a special function that manage OS routines in the Kernel Mode
Q. What is the shell used for.
A. It is a program that interacts between the kernel and the user. It is a command
interpreter where a user can type commands and the command is conveyed to the
kernel to be executed.
Q. Name the 5 different types of shells
A. Sh (Simple Shell), BASH (Bourne Again Shell), KSH (Korne Shell), CSH (C Shell)
and SSH (Secure Shell)

Class 2 Instillation
Planning the Instillation
64 Bit Linux is the better option when it comes to Linux, 64 bit is significantly better
in almost any way. The only issue is some third party applications may not run on 64
bit.
Q. What are the two main types of installation interfaces available.
A. Textual (TUI/CLI) and Graphical (GUI)
Q. what is the difference between Textual and Graphical interfaces.
A. Textual is text only but is faster, while Graphical shows your desktop more like
windows does but is more resource intensive.
Q. What are the three main Linux distros what are the major differences.
A. Fedora, RHEL and Cent OS. Fedora is cutting edge and releases every 6 months
with only 13 months of support. RHEL is more stable proving 10 years of update,
this is sold through an annual subscription for support. CentOS has long term
stability as well and is compatible with RHEL but is not supported.
Q. What are the 3 standard install editions of Fedora, and what are there major
features.
A. Desktop Live Media, DVD/CD/USB/Image and Network Install. Desktop live media
does not need to install and runs from a live image, can be upgraded to a full install
if you have the internet. DVD/CD uses a media device to do a full install. A network
installer is similar to a DVD/CD install but downloads the software from a public
repository.
Q. Where must you save files on a Desktop Live Media version of fedora if you want
it to remain for the next boot?
A. It must be installed on the USB or a network drive.
Q. What are alternate installers on Fedora Called and what do they install.
A. The alternate installs are called spins and they install different UIs
Q. What is the name of the default partition in Linux
A. /root
Q. Where is the kernel stored in Linux
A. /boot
Q. What is the /swap partition used for

A. The /swap partition is used for virtual memory much like a page file. This space
can be used for system hibernation and for if physical memory is full.
Q. What is the users main drive called
A. /home

Chapter 3
Anaconda
Q. What is Anaconda
A. It is an OS installer
Q. What installation Model Does Anaconda Use
A. Hub-And Spoke
Q. How do you install Fedora from a live session (two answers)
A. Select Install to hard drive from either the activities list from the Welcome to
Fedora Window
Q. How do you install from an install image.
A. You boot the system with the install medium set as the boot drive.
Q. What do you do to modify parameters when installing.
A. Press the space bar and press tab on selected items to change the parameters
Q. What are some troubleshooting options for Fedora/RHEL
A. Install with basic graphics, Rescue the system (starts with a single user mode),
Run a memtest, boot from the local drive.
Q. What language is Anaconda Written in.
A. It is written in C and python
Q. What 3 options for disc configuration do you have with Anaconda Installer
A. You can allow Fedora to automatically configure the disks, You can configure the
disk partitions yourself or you can get help from the installer choosing partitions
based on your needs.
Q. What 4 partitions are created by default
A. /home /swap /boot and / (root)
Q. What command updates the system
A. $ Sudo Yum Update

Chapter 4
Q. What user has Super User privileges by default
A. Logging is a root gets you super user privilege.
Q. How can root, users that are members of the wheel and regular users gain Super
User access.
A. Root users are SU by default, Members of the wheel can gain SU by using their
own password. Regular user must know the root password to gain access to the SU
command.
Q. How do you access users that are not available in the login page but are on the
system.
A. You click on not listed ?
Q. Where do you choose what desktop session you wish to use.
A. You choose one after selecting the user you wish to log on as, it is in a drop down
menu.
Q. What is the standard desktop mode in Fedora.
A. Gnome 3 is the standard desktop in fedora.
Q. What keys allow you change the focus
A. Alt + Tab and Alt + Shift + Tab
Q. What command allows you to install the classical Desktop on Gnome 3 assuming
youre not root.
A. $ su -c yum install gnome-classic-session
Q. Define the following terms, Workspace, Active Workspace, Desktop, Panel and
Object
A. Workspace holds one or more applications in each window. An active workspace
is holds a workspace and is the current one. Desktop is the collection of all of the
workspaces, Panel hold the object, and object is a specific word icon or menu that
you can select.
Q. How do you copy and paste objects into the terminal.
A. You have to press Shift before ctrl+c or ctrl+v

Chapter 5 - Shell
Special Characters
Q. How can you generate white space in the shell
A. The return, space or tab key all generate white space
Q. There are special characters that the Shell interprets, how do you use them as
regular characters.
A. You have to put them inside of quotes.
Q. If you are going to put more than two special characters together what do you
have to precede with.
A. You have to use a \ (backslash)
Q. Define Ordinary and Directory Files
A. Ordinary files hold documents pictures programs etc. Directory Files contain
information about other files and directories.
Q. What is the working directory.
A. The working directory is the directory where a command that does not specify a
directory will look for a file other than an executable file.
Q. What is the default working directory when you login.
A. The working directory is set to /home when you login.
Q. What do the commands PWD- and CD- do?
A. PWD- shows the current working directory, CD- changes the working directory.
Q. Where are individual users working directory stored.
A. /home/<username>
Q. What is contained in the /home/<username> folder

A. It contains the users personalized configuration files and may also contain
documents, programs and mail folders.
Q. What needs to be done for arguments that have a hyphen.
A. It needs to be quoted.
Q. How does the Shell execute a command.
A. It looks for the command, checks the permissions and supplys the options and
arguments to the command. The results are printed to the screen.

Q. What happens if the command is not built into the shell.


A. The shell launches a child process to run the command. The shell waits (sleeps)
until the child process completes.
Q. What are stdin, stdout and stderr.
A. stdin is a logical reference the the keyboard, stdout is a logical reference to the
screen (used for normal output) and stderr is for error output to the screen.
Q. What command can you put into the shell so you dont overwrite files in the
command
A. $set -o noclobber
Q. How many jobs can you have running in the foreground.
A. Only 1
Q. Where do jobs run in the background appear
A. They run independently of the shell, they do not have access to the keyboard or
screen.
Q. What is the command for starting jobs in the background
A. sleep <number> &
Q. How can you move a job from the foreground to the background once its already
running.
A. Press Ctrl+Z then type bg <enter>
Q. How can you move a background job to the front ?
A. Move the current job to the background, get the job id using the command jobs -I
then using the command fg <job-_id> to move that job to the forground.
Q. What is the command to kill a background job?
A. kill [-9] <job_id>

Chapter 6 Hierarchical File Systems and shit yo


Q. What is a file system.
A. A file system is a set of data structures that usually resides on a part of a disk
that holds directories of files.
Q. What is a filename
A. A character string that uniquely identifies a file in a directory.
Q. Normally up to 255 characters long, but depends upon a file system type. Short
file names are easier to type.
Q. Does linux care about file extension types.
A. No it does not care about file extension types, although some programs need
extensions to function properly
Q. What is the function of extensions since they are not necessary in linux.
A. Extensions are useful for humans to understand what type of file they are using.
Q. How are hidden directories denoted.
A. Hidden directories are denoted with the . or ..
Q. How do you see hidden directories.
A. Add -a to show the files and directory listings.
Q. What are startup files.
A. Files used during the user login process, they are user configurable files that are
in each users home directory.
Q. What is an absolute path name
A. It is the fully qualified path name, it always starts from the root (/)
Q. What is the ~ for when in reference to pathnames
A. The ~ is symbol to represent the users current home directory (~ = /home/user)
Q. What is a relative pathname
A. A relative pathname is given in relation to the current working directory.
Q. What do . and .. mean in relative pathnames
A. . means the current directory .. means the parent directory.
Q. What does mkdir, cd , rmdir, rm, mv and cp achieve in regards to directories

A. mkdir Creates a directory, cd changes to another directory, rmdir deletes an


empty directory, rm removes a file, mv will move a directory or file to another
location or rename it and cp will copy files -r copies the entire directory.
Q. What is an ACL and what does it do?
A. ACL stands for access control list. It is used to provide fine grained permissions,
be carful using them to liberally as they can decrease performance.
Q. What is the command to see ACL permissions
A. getfacl

TEST 2
Chapter 6 Hierarchical File System
Q, What is a hierarchical file system?
A. It is a set of data structures that reside on port of a disk and hold directories and
files.
Q. What are some directories that are no longer included
A. /Bin /sbin /lib instead they are symbolic links they are all in the /usr directory.
Q. What do 64 bit systems also have?
A. /lib64 usr/lib64
Q. What should you now use in your filenames.
A. Do not use spaces, many programs have issues with it.
Q. Is linux case sensetive?
A. Yes it is.
Q. Does linux OS care about file name extensions
A. No it does not
Q. Some programs however do require specific extensions list some
A. gcc needs .c .C .cpp .h .hpp
Q. Why are extensions generally used
A. Extensions are used to help useres identify file types.
Q. What denotes hidden directories
A. ( . ) as the first character denote hidden file directories.
Q. What are startup files and where are they located.

A. These are files used during the user login process. They are in each users home
directory.
Q. Absolute path names are what, and where are they located.
A. Absolute path name is the fully qualified name, always starts with the root (/)
Q. What is the ~ tilde used for
A.This symbol reprsesnts the users current home directory (/home/user). Generates
an absolute path name when expanded.
Q. What are relative pathnames
A. Relative pathnames are file or directory locations with respect to the current
working directory.
Q. What do you use to show relative directories and files.
A. You use . And .. yo show current directory and parent directory.
Examples curerent directory /home/zach
.mail = mail = /home/zach/mail
../his/notes = /home/his/notes
../../etc/profile = /etc/profile
Q. What does mkdir do?
A. Makes a directory
Q. What does cd do
A. Changes directory
Q. What does rmdir do
A. Deletes an empty directory, not available on all distrobutions
Q. what does rm do?
A. It removes a file us -R to recursivley delete a directory and any contents.
Q. What does mv do
A. mv moves a directory to another loaction or renames it.
Q. What does cp do?
A. CP copys files, use -r to copy a directory and its contents
Q. What is in var files
A. Files that change as the system is running. Examples are log files and mail
queues.

Q. What does Chown do


A. Changes file ownership
Q. what does chgrp do?
A. It changes file group association
Q. What does setuid and setgid do ?
A. Setid sets owner rights on a program while running it, setgid sets group rights
instead of owner.
Q. What does sticky bit do
A. Sticky bit allows control over who can rename and delte within a directory

Q. What are ACL's


A. ACL's are access control lists, they provide fine grained control over traditional
linux permissions.
Q. Why should you be carful enabling ACL's
A. They can reduce performance.
Q. What does getfacl and setfacl do?
A. They get the ACL and set the ACL permissions.

CHAPTER 7

Q. What does cat (catenate do)


A. It joins and displays files
Q. What arguments are available for cat
A. The hyphen < > are avaialable.
Q. Name some options avaialble and what they do
A. -n shows linenumbers infront of each line, -T shows tab characters as ^l
Q. What are some releated utilities
A. Tac- Reverse the order of inport lines, rec reverse the order of the characters on
a line.
Q. What does Date do
A. displays the system time and date,
Q. what are some options available for date and what do they do
A. -d will show the date as a string -u will show the date in GMT
Q. What are some related utilites to date and what do they do
A. timedtectl displays more infromation about the clock, cal shows the calander.
Q. What does the less command allow you to do in comparison to more
A. Less allows you to scroll up or down more only down, less has text search
capabilities and less is much faster as it does not have to read the whole file before
display.

Q. What are some options of the less command


A. c will allow you to clear the screen when the spacebar is presssed. -e will start
EOF -s will truncate long lines and -x will not clear the screen on start.
Q. What is a new command that is more capable the less and is fedora only.
A. Most
Q. What does ls do
A. ls displays information about files
Q. What are some options available
A. All -a, Directory -d, Humand readable -h, long -l, recursive -R, reverse -r, Size -s,
Sort -S or -T

Q. What does rm do and what are some arguments of it


A. rm deletes a link. -r is a dangerous command, -f forces deletion with consent, -i is
interactive -v is verbose means it will show you the result of the command.
Q. What are some related utilities of the rm command and what do they do
A. shred which overwrite and optionally deletes files, testdisk scans repairs and
sometimes recovers disk partitions and undeletes files.
Q. What does CP do and what are some arguments for it and there purposes
A. CP copies files, -i is interactive, -b is backup, -p is perserver the ACL permissions
when you copy to a different loacation, -a is Archive and perserve the owner and
group permissions.
Q. What does diff do
A. diff displays the difference between the two text files.
Q. What does file do
A. File displays the classification of a file.
Q. What does the find command do
A. it finds files based on specific criteria
Q. What does .mtime (x) and .atime (x) arguments achi ve
A. It shows the modified, or access time with x represeting the numbers of days, 0
means I nthe last 24 hrs.
Q. What does the grep command do
A. grep searches for a pattern in files.

Q. What are some options available for grep.


A. -c allows you to count how many times something appears in a file, -i allwos you
to ignore a specific case and -q allows the it to be quite, updates the shell with a
exit status.
Q. What does the head and tail commands do
A. Head shows the beginning of a file, tail shows the end.
Q. What are the -c and -n options used for on the head or tail command.
A. -c changes how many bytes of information to show -n changes how many lines of
information to show.
Q- What does the lpr command do
A. The lpr command ques one or more files for printing

Q. What are some options for the lpr command


A. -h has no header for a multiuser environment, -p the printer name or defaults
printer if not mentioned with this option -l means lpr should not pre process the file
for being printed. File is already formatted for the printer..
Q. What is the MV command used for?
A. The mv command is used for renaming or moving a file.
Q. What does the tail command do?
A. It shows the last 10 lines of the file.
Q. What does the wc command do
A. It displays the number of lines, words and bytes in a file
Q. What does dtrx stand for
A. Do the right extraction
Q. What are Xz, bzip2 and gzip
A. They compress files.
Q. What are the differences between Xz, Bzip2 and gzip.
A. XZ is the newest and most effective, bzip2 is block based and cpu intensive, gzip
is stream based and does not compress as well as the others.
Q. What does the time command do?
A. Time tells you how much time it has taken to compress the files
Q. What is the who am I command the same as

A. who -m
Q. What does whoami display
A. It shows the current users username.
Q. What do the commands which and where is do?
A. Whci hproduces a list of all programs with a specified name in the path directory,
where is searches for files in the path directory as well as some other standard
locations.
Q. What does locate do?
A. It looks for specifed files in the local system using an index, use $update
periodically to keep the index updated.

You might also like