Basic Commands Flashcards
What command parses the /proc/meminfo file for easier analysis of memory usage statistics?
free
Which command displays system usage reports based on data collected from system activity includes type of data and time data was collected?
sar
Which command exposes the local clock, the universal time, and the hardware clock?
timedatectl
which command is used by root to set or reset a password for any user. A user can use this command to reset their own password. what does the option -S do?
passwd -S --status displays 7 fields login name locked password date of last change minimum age maximum age warning period inactivity period ...ages are expressed in days
which command is an interface to the system reference manuals? what do the options -k, -K, -f, -t do?
man
- k searches for keywords and displays matches
- K search for text in all manual pages
- f =whatis displays a short description from the manual pages
- t formats in printable format
which command displays the amount of disk space available on the file system? Options -h, -i,
df -h human readable, -i lists inode information instead of block size
Which command estimates file space usage? Options -h, -c, -a
du -h human readable, -c produce a grand total, -a write counts for all files not just directories
Which command reports central processing unit statistics and input/output statistics for devices and partitions
iostat
what is the file extension for kernel module files…often found in /usr/lib/modules/
.ko
What is the configuration directory/file for modprobe?
/etc/modprobe.d = directory /etc/modprobe.conf = file
Which command is used to add and remove modules from the Linux Kernel? Options -a, -r
modprobe -a = to add modules -r to remove modules
Which command configures kernel parameters at runtime? Options -a, -w, -p, -e, -r
sysctl
- a = display all values currently available -w = when all arguments prescribe a key to be set
- p = –load - load in sysctl settings from a file specified
- e ignore errors
- r only apply settings that match a pattern.
Which command shows the status on modules in the linux kernel and their details?
lsmod
Which command displays information about a particular Linux Kernel module?
modinfo
Which command is a simple program to insert a module into the Linux Kernel?
insmod
Which command is a simple program to remove a module from the Linux Kernel?
rmmod
Which command generates module.dep and maps files? Creates a list of module dependencies by reading each module under /lib/modules/version.
depmod
Which two commands show a listing of last logged in users? Which one of these shows by default a log of the /var/log/btmp file, which contains all the bad login attempts?
last, lastb lastb shows the bad login attempts
Which log file in the /var/log/ directory will give you a complete picture of users logins at which terminals, logouts, system events and current status of the system, system boot time, etc.?
/var/log/utmp
Which log file in the directory /var/log/… give historical data of utmp?
/var/log/wtmp
Which log file in /var/log/… records only failed login attempts?
/var/log/btmp
What does sda1 mean?
sd = SCSI/SATA, a = first whole drive, 1 = first partition on drive
What are the common file attributes a, A, e, i
a = file can only be opened in append mode A = file can be opened without changing its atime (last opened time) e = file is using extents for mapping blocks on disk i = immutable cannot be deleted or renamed
which command repeats input back to user?
echo
Which command lists contents of directory?
ls
Which command displays the current working directory?
pwd
which command changes the current working directory?
cd
which command updates timestamp of file or creates file?
touch
which command copies a file or directory?
cp
which command creates a new directory?
mkdir or newdir
which command shows contents of a file on screen?
cat
which command breaks output into pages?
less
Name three popular text editors?
vim, nano, gedit
What are the differences between shutdown -h now, shutdown -h -t 90, and shutdown -r now?
- h now = shutdown now
- h -t 90 = shutdown in 90 seconds
- r now = reboots with no delay
Which command switches user?
su
Which command outputs a list of recently entered commands?
history
What is a feature in which a command-line shell fills in the name of a command you’ve partially typed?
tab completion
Which command clears the screen?
clear or ctrl + l
Which command searches the NAME section of man pages based on keyword? Helps to find the correct command to use for a certain task.
apropos
Which command displays a brief description of a given command? Helps to figure out what the command does.
whatis
Which command displays the info page of a command? Similar to man pages with some improvements, but is not as widely adopted as man pages.
info
Which command displays a quick summary of command usage and arguments?
–help
What is the directory of documentation for software packages? includes author, licensing, installation, README, etc.
/usr/share/doc/
What are some examples of interactive online sources of help?
Usenet newsgroups, mailing lists, Q&A websites, Forums and social media
What is an object that represents a person’s identity to the operating system and is used to perform certain tasks?
user account
What are the three types of user accounts?
Root user, Standard user, Service user
What is the term for the local administrative account on a Linux system, typically named root?
superuser
What is a best practice that states that users should have as much access as is required to do their job, but no more that that?
Principle of Least Privilege
Which command is used to edit the /etc/sudoers file and cverifies syntax before committing changes and can help correct mistakes before they occur, as mistakes in the sudoers file may render server inoperable.
visudo
Some distros disable root altogether and enable admin privileges by membership to what group? visudo command is used to edit this group’s privileges similar to editing the sudoers file.
The wheel group
Which command creates a user account and configures user settings?
useradd
useradd command will do what?
create account in /etc/passwd file, references /etc/login.defs, creates user’s home directory in /home/account/, and populates home directory from files in /etc/skel
What are the functions of the useradd options -c, -e, -s, -D?
-c = sets comment field, -e = sets account expiration date, -s = sets user’s default shell, -D = view default config for new users
/etc/passwd contains what 7 fields separated by colons?
User name: Password: UserID: GoupID: Comment: Home directory: Login shell
What filed contains hashed version of passwords, and who can access it?
/etc/shadow root
Which command controls password expiration, warnings, inactive days, etc.?
chage
what are functions of the chage command options -E, -l, -M, -m, -W?
-E sets account expiration, -l lists password aging info, -M sets max days password is valid, -m sets minimum days until password can be changed, -W sets number of days before expiration user will be warned
What is the significance of #chage -M 90 user1
sets the maximum days user1’s password is valid to 90 days, performed by root
Which command modifies settings for regular users?
usermod
What are the functions of the usermod options -c, -e, -aG, -l
-c sets comment field, -e sets account expiration date, -aG adds user to group and keeps them in existing groups, -l chages user’s login name
What are two basic ways of locking a user account?
passwd -l , usermod -L
What are two basic ways to unlock a user account?
passwd -u , usermod -U
Which command deletes a user account? However, it does not delete home directory unless you use what option?
userdel -r
What is an access control object that contains multiple users with similar security requirements?
Group Account
What file is the storage location for groups, is commonly referenced for group info, contains four fields separated by colons, and should not be edited manually but rather by group commands?
/etc/group
What are the four fields in the /etc/group file?
Group name: password requirement: group ID: group list
Which command creates groups? By default groups have no members or password.
groupadd
What are the functions of groupadd options -g, -f, -o?
-g assign a group ID, -f exit with success if group already exists, -o allow group creation with non-unique ID
Which command changes a group’s attributes and edits the /etc/group file?
groupmod
What are the functions of the groupmod command options -g, -n?
-g change group ID, -n rename group
Which command deletes groups from /etc/group file, doesn’t delete users?
groupdel
Which command displays the user name you are currently logged in as?
whoami
Which command determines details of users currently logged in?
who
what are three items that the who command will tell you?
user name, system the user is connected to, date/time connected since
Which command displays details of logged in users and transactions?
w
Which command displays UID/GID? Without options it displays info about logged in user, but you can specify user name to display info about that user.
id
Which file enables customization of user’s environment, is stored in home directory, and is unique to each user? examples include use of aliases, environment variables, and customize command prompt.
.bashrc
Which file provides shell configuration for the initial login, but is only read with first login. The default for this file can be provided through /etc/skel/ directory.
.bash_profile
Which directory’s contents are automatically copied to the home directory of new users? the useradd command copies contents from this directory.
/etc/skel/
This file provides system-wide environmental variables, it is configured if settings need to apply to all users, it is checked first during login process for shell configs, then user customizations are pulled from .profile in their home directory. Admins can use this file to define global settings, but still allow user-specific customization.
/etc/profile
Which directory is the storage location for scripts used to set system-wide variables?
/etc/profile.d/ it is recommended to set variables in scripts here rather than edit /etc/profile
This file provides system-wide Bash settings? It is different than /etc/profile which is used for variables.
/etc/bashrc
What is GPT and what specification is it part of?
GUID Partition Table UEFI
What is MBR and what size is it?
Master Boot Record 512 byte-sector in the first sector on the disk
What is mdadm?
mdadm is a Linux utility used to manage and monitor software RAID devices
What is LVM?
Logical Volume Management. It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem
What is Multipath?
Linux multipath provides a way of organizing the I/O paths logically, by creating a single multipath device on top of the underlying devices
Why is multipathing important?
Linux multipathing provides connection fault tolerance and can provide load balancing across the active connections. When multipathing is configured and running, it automatically isolates and identifies device connection failures, and reroutes I/O to alternate connections.
What is the command localectl ?
Control the system locale and keyboard layout settings
fdisk
is a dialog-driven program for creation and manipulation of partition tables. It understands GPT, MBR, Sun, SGI and BSD partition tables.
what are the three permission attributes for directories and files?
r = read, w = write, x = execute
What are the three Permission Contexts?
u = Owner, g = Group, o = other
Which command enables you to modify permissions on files/directories? Can only be done by owner or object or sysadmin.
chmod
chmod -c
enables modification of permissions on files/directories, -c report changes made to permissions
chmod -f
enables modification of permissions on files/directories, -f hide most error messages
chmod -v
enables modification of permissions on files/directories, -v = display diagnostic entry for every object processed
chmod -R
enables modification of permissions on files/directories, -R modify permissions recursively
Which mode of chmod sets permissions using components and operators such as +, -, =?
Symbolic Mode + grants permissions, - denies permissions, = assigns permissions exactly as provided
What does chmod go+rw file1
changes permissions for group and others adding read and write permission for file1
In what mode does chmod use octal numbers and shows compete permission as three digit number?
Absolute Mode
In Absolute Mode, what do the chmod octal numbers 4, 2, 1 represent?
4 = read, 2 = write, 1 = execute
In the Absolute Mode of chmod, what does 764 represent?
owner permissions = 7 (4 read + 2 write + 1 execute), group permissions read +write, other permissions read only
What is the result of chmod 640 file1
permissions for file1 are set to owner 6=rw, group = r, others = none (-)
What are the default permissions for riles created by ROOT user? and for directories?
644 for files, 755 for directories
What are the default permissions for files created by REGULAR users? and for directories?
664 for files, 775 for directories
What command alters default permissions on newly created files/directories, can be useful for automating custom permissions for new objects, can be set for session or per-user (in .bashrc), specifies permissions to remove.
umask
system wide umask is set in what two files? Where is the default umask for for a specific user?
/etc/basrc /etc/profile for a user = ~/.bashrc
the property by which a user can apply and modify the permissions of a file or directory
ownership
Who can modify permissions for a file or directory?
owner & root
Which command changes the owner, group or both for a file or directory?
chown
If you want bob22 to manage a file or directory, but sally1 created the object, which command would allow you allow bob22 to manage permissions for the object?
chown ex: chown bob22 file1
You want to change the owner of file1 to jimmy5 and the group to engineers. what command and what would your syntax look like.
chown jimmy5:engineers file1
Which command allows you to schedule a command to execute by setting a command-line parameter?
at
the cron daemon is control by what command?
crontab
crontab files for system are located in what directory?
/etc/cron.d/
crontab files for users are located in what directory?
/var/spool/cron/
A distributed version control system primarily used by developers who are collaborating on projects.
git
the managing and provisioning of infrastructure through code instead of through manual processes
IaC Infrastructure as Code
Ansible, Puppet, Chef, Kubernetes, and OpenStack are all examples of what kind of tools?
Orchestration Tools
Ansible uses what kind of configuration files, text does NOT contain curly brackets but has (-)s to help identify it.
YAML YAML is a data serialization language that is often used for writing configuration files
What remote desktop software is a free and open source utility that constructs a Remote Desktop Protocol (RDP)-like server for the non-Windows system?
xrdp
location includes configuration files for many components, including components that interface with devices.
/etc/
location contains device driver files that enable the system and users to access devices themselves
/dev/
location contains various files that represent system information reported by the kernel.
/proc/ In particular, the /proc/devices file contains a list of all device drivers that the kernel is currently running, separated by character and block storage devices.
location is a virtual file system similar to /proc/ but that focuses more on creating a hierarchical view of device information.
/sys/ In particular, the /sys/devices/ subdirectory includes files that expose details about specific devices.
is a computer bus interface standard for attaching storage devices to traditional computers
Serial AT Attachment (SATA)
What are the differences between ss and netstat
ss (socket statistics) is a newer, faster, more human readable tool than the deprecated netstat.
ss and its options can display information about how your Linux machine is communicating with other machines, networks, and services; details about network connections, networking protocol statistics, and Linux socket connections.
command displays various information about a system’s hardware as reported by the kernel.
lsdev
command is used to display information about devices that are connected to the system’s PCI buses
lspci
command is used to display information about devices that are connected to the system’s USB buses. This command scans the /dev/bus/usb/ directory for information.
lsusb
command shows the status of the printer queue. By default, it will report each print job’s rank in the queue, who owns the job, the job number, the files in the job, and the size of the job.
lpq
command dumps the system’s Desktop Management Interface (DMI) table and presents it in a human-readable format. You can use this command to verify connected devices and whether or not they support certain features
dmidecode
command parses the /proc/meminfo file for easier analysis of memory usage statistics
free
command displays various statistics amount virtual memory, as well as process, CPU, and I/O statistics
vmstat
command lists each detected hardware component on the system and provides details about each device. The command pulls information from many different files in multiple device file locations like /proc/ and outputs in a hierarchical format.
lshw
device acts as a control point for communications between network segments. Administrators can configure the device to permit or deny certain kinds of traffic, as well as pass traffic from one network segment to another.
router
Network media or cables like __________ are commonly available as _____________ (STP) or _____________ (UTP). It is inexpensive and relatively easy to work with
ethernet, shielded twisted pair, unshielded twisted pair
is a human-readable name given to a node that helps people better understand what device they are working with
hostname
device acts as a concentrator, centralizing all network connections for a segment to a single device. These devices can be used to manage traffic for performance and security concerns.
switches
tool is the most fundamental of the NetworkManager interfaces. It contains many subcommands that enable you to view and configure network information.
nmcli network manager command line interface
command can be used to test connectivity and send data across network connections. Systems may be identified by IP address or by hostname.
The command may be spelled out as “netcat” or abbreviated as “nc” depending on the distribution
is used to view the routing table. The command is also used to manipulate the routing table, enabling the administrator to configure desired routes.
route
is used to store information that is easy for most programming languages to interpret and use. Because it uses a standard JavaScript format, it is also relatively easy for humans to interpret and write.
JSON JavaScript Object Notation
may be used to store configuration information that is used on newly deployed virtual machines. This information may be used by cloud-init to install software or create user accounts during the virtual machine’s first boot, or may be used by orchestration tools like Ansible.
YAML Ain’t Markup Language (YAML)
which 2 commands to discover dependencies before attempting an installation on Red Hat-derivative distributions.
the rpm -qR {package name} and yum deplist {package name}
command to verify that all components of a package are installed. This is particularly useful if you believe configuration files or other needed files have been deleted.
rpm -V {package name}
command to discover dependencies before attempting installation on Debian-derivative distributions.
apt-cache depends {package name}
what command can be used to check for shared library file dependencies for software you will be compiling
ldd [options] {program binary}
translate source code written in a human-friendly programming language, such as C or C++, into machine-readable binaries.
Compilers
A _________ is a file that contains instructions used by a compiler to build a program from source code. These instructions typically define the resources that the program depends on in order to function properly, as well as any additional directives as defined by the developer.
makefile
_________ are storage locations for available software packages. they can be checked by package managers like YUM and APT when installing or upgrading software.
Repositories or repos
The rpm command is used to manage RPM packages on Red Hat-derived distributions. What are the two primary options available for Red Hat Package Manager (RPM) to keep software current?
-U upgrades and installs if not already installed -F freshens the installed package but does NOT install the package if not already installed
is a package manager that supports repositories, dependency solving, and management of the software lifecycle. It is an openSUSE package manager that supports .rpm packages.
Zypper
the ____________ package manager is an improved version of YUM. It uses fewer resources while still maintaining support for the fundamental RPM package manager.
Dandified YUM (DNF)
What are the three kinds of repositories?
Local Centralized internal Vendor
This apt subcommand for managing packages, is used to uninstall the package and remove its configuration files.
purge
This apt subcommand for managing packages is used to uninstall the package, leaving behind its configuration files.
remove {package name}
This apt subcommand for managing packages, is used to upgrade the package, or upgrade all packages if none provided (time-consuming).
upgrade {package name}
_________ is a Linux kernel framework that handles packets that traverse a network interface. Some of the major services it provides are packet filtering, NAT, and connection tracking.
Netfilter
In most Linux distributions, system logs are located in the ___________. Inside this directory are the logs themselves, and each file corresponds to a service, application, or feature
/var/log/ directory
A _____________ is a message digest that has been encrypted with a user’s private key. Asymmetric encryption algorithms can be used with hashing algorithms to create digital signatures.
digital signature
___________ are the most fundamental component of a PKI, and the overarching task of a PKI is to manage digital certificates in a variety of ways.
Digital certificates
A ____________ is a server that issues digital certificates for entities and maintains the associated private/public key pair. CAs sign digital certificates so that clients can validate the authenticity of certificates owned by entities.
CA certificate authority
A _________________ is a message sent to a CA in which an entity applies for a certificate. It typically includes information that should go into the entity’s certificate, like its public key, digital signature, and other identifying information.
CSR Certificate Signing Request
is the default context-based permissions scheme provided with CentOS and Red Hat Enterprise Linux (RHEL), and is optionally available on other distributions.
Security-Enhanced Linux (SELinux)
is a model in which access is controlled by comparing an object’s security designation and a subject’s (users or other entities) security clearance.
Mandatory access control (MAC)
describe multiple types of information about processes and files that are used in combination to make decisions related to access control. In other words, the permission scheme defines various properties for a file or process, and uses those properties together, rather than in isolation, to determine whether to grant or deny access.
Context-based permissions
is packaged with Debian-based and SUSE Linux distributions, whereas SELinux is more commonly associated with RHEL.
AppArmor
___________ is a procedure in which data is encoded to reduce the amount of bits that are used to represent that data. The process can significantly reduce the size of a file or collection of files to make the storage and transfer of data more efficient.
compression
____________ is an authentication service that is based on a time-sensitive ticket-granting system. It is used as a single sign-on (SSO) method where the user enters access credentials that are then passed to the authentication server, which contains an access list and allowed access credentials.
Kerberos
________ is a directory service protocol that runs over Transmission Control Protocol/Internet Protocol (TCP/IP) networks.
LDAP
A ________ is any unique object, whether physical or digital, that you possess and that can be used to verify your identity.
token
A __________ is a technique of controlling what a process—a user, for example—can access on a file system by changing the root directory of that process’s environment.
chroot jail
____________ occurs when a user is able to obtain access to additional resources or functionality that they are normally not allowed access to. One of the most common scenarios is when a normal user is able to exploit some vulnerability on a system to gain root-level privileges.
Privilege escalation
The ________ command can effectively change a shell variable into an environment variable
export
The _______ command will effectively change a shell variable into an environment variable. It can also be used to change the value of existing environment variables. When adding multiple directories, the _____ character is used to separate each directory you wish to add.
export , colon (:)
The /usr/local/bin/dailyscript.sh command execution is using an ______________ to the dailyscript.sh script
absolute path
The _________ command is used to download the branch of code from the remote repository. This is performed after the local repository is completely setup
git pull
The _________ command initializes Git for the specific path that will hold all the project’s code. It is the first step in creating the local repository.
git init
The ________ command is performed prior to creating the local repository. It configures a Git account
git config
The ___________ command is the last step when creating the local repository. This will verify that there is nothing to commit.
get status
The _____ command will list the current user’s pending jobs. Each job will display information in the following order: [job number] [date] [hour] [year] [queue] [username]. As a superuser, this command will list all automated tasks for all users.
atq
_______ is the name of an orchestration tool that uses an agentless architecture to deploy and configure endpoints automatically. It can communicate over Secure Shell (SSH) and Windows Remote Management (WinRM).
Ansible
_________ Orchestration does not require extra components at endpoints. It does this by connecting to systems or devices over existing transport mechanisms. SSH is an example of a transport mechanism that can be used to connect to Linux machines. this approach reduces the amount of setup required for agent-based models.
Agentless
________ Orchestration requires a software component to reside on the managed device. This may impose additional demands on the organization’s environment and require extra setup. For example, this model may require firewall configuration in constrained environments.
Agent-based
__________ is the name of an orchestration tool that operates in a client-server architecture. This requires an agent called a ______ client, to run on each managed node. The ______ client downloads and evaluates configuration code, known as recipes from a _____ server. (all the same name)
Chef
Which orchestration tool uses YAML files to create repeatable “playbooks” that define the desired configuration state?
Ansible
_______ was originally a joint Rackspace and NASA project, usually deployed as an IaaS solution to manage cloud resources. It is an open source software commonly used to create private and public clouds. It can orchestrate the deployment of a Linux, Apache, MySQL, PHP (LAMP) service, for example.
OpenStack
__________ is an open source solution that provides container deployment and application orchestration for cloud and on-premises container environments. You define a desired state and this solution configures containers to match that state.
Kubernetes
_______ uses _______ files to create repeatable “playbooks” that define the desired configuration state. this is an agentless solution that delivers files over SSH connections. Red Hat emphasizes the use of this solution.
Ansible, YAML
The ______ command is used to manage Git repositories. Using this command and subcommands you can create a repository, add files to the repository, commit changes to the repository, pull down files from another repository, and much more. The _________ subcommand is used to create a working copy of an existing repository.
git, clone
The _______ subcommand is used with the git command and integrates changes from one branch into a “master” branch.
merge
The _______ subcommand used with the git command updates the Git repository with changes and creates a “snapshot” of that repository. These “snapshots” can be useful to compare previous versions of the repository with the “master.”
commit
The ______ subcommand used with the git command sets options for a repository or for Git users, as well as other global options.
config
_____________ is a name for orchestration tools that manage the entire deployment and configuration process through scripting and code files, rather than through traditional software tools. It relies on a single configuration specification to deploy the supporting infrastructure (the operating system) and the necessary applications.
Infrastructure as code
print real and effective user and group IDs
id
two types of network based booting
PXE and NFS
print or control the kernel ring buffer
dmesg
send ICMP ECHO_REQUEST to network hosts
ping
print effective userid
whoami
modify a user account
usermod
modify a group definition on the system
groupmod
create a new user or update default new user information
useradd
create a new group
groupadd
change user password expiry information
chage
show a listing of last logged in users
last
a fast, versatile, remote (and local) file-copying tool
rsync
changes group ownership of a file or directory. Useful for applying permissions to a group.
chgrp
a special permission bit that provides protection for files in a directory. Only owner or root can delete the object. Ensures other users cant delete but can still w/x. set with chmod, indicated by a t
sticky bit
an attribute of a file or directory that prevents it from being modified, even by the root user. indicated by an “i”
Immutable Flag
This command is used to list attributes of files/directories.
lsattr
lsattr -R
Recursively list attributes of directories and their contents.
lsattr -a
list all files and their attributes in directories
lsattr -d
list directories like files, instead of their contents when looking at attributes
lsattr -v
used to list attributes of files/directories -v = list version number of files
Command that is used to change file/directory attributes. Options -R, -v, +i, -i
chattr -R = recursively change attributes of directories and their contents, -v = set version number of file, +i = mark file as immutable, -i = remove immutable attribute
A list of permissions attached to an object
Access Control Lists
Command that is used to retrieve ACLs of files and directories, output shows metadata about file and permissions info.
getfacl
Command used to change permission associate with file/directory ACLs
setfacl
setfacl -R
Recursively set ACL options for directories and their contents
setfacl -s
Set ACL of an object/replace existing ACL
setfacl -m
modify existing ACL
setfacl -x
remove entries from existing ACL
setfacl -b
remove all ACL entries
Troubleshooting Model
- Identify the problem
- Establish a theory of probably cause
- Test the theory to determine the cause
- Establish a plan of action to resolve the issue
- Implement a solution or escalate the issue
- Verify system functionality and implement preventative measures
- Document findings, actions, and outcomes
Permissions Troubleshooting always verify permissions with what command first?
ls -al
The mechanism by which a shell maintains settings and other behavioral details about the shell
Shell Environment
Computer programs that automate the execution of tasks for a particular runtime/shell environment.
scripts
entities whose values change from time to time
variables
_____ variable values are not passed on to child processes, but ________ variable values are
shell, environment
a variable that is passed onto child shell processes
Environment Variable
What does the env command do when not given arguments?
prints environment variables
Environment variables returned by the env command include among other things what four basic pieces of information?
HOSTNAME, SHELL, HISTSIZE, USER
_______ is an environmental variable in Linux and other Unix-like operating systems that tells the shell in which directories to search for executable files in response to commands issued by a user.
PATH
which command can be used to help diagnose latency issues with a disk?
ioping
You have created a daemon process from the command line, you want to SUSPEND the process. Which key combination do you use?
Ctrl+Z will suspend the process …… Ctrl+C kills the process
the __________ command formats a swat partition
mkswap . . . the fdisk command is used to create the partition but not to format it
which command will show you all of the processes associated with a given argument ex: sshd
pidof
in what directory are modules stored?
/usr/lib/modules/{kernel-version}
You need to temporarily prevent users from logging in to the system, but maintain root user log in
touch /etc/nologin . . . if this file exists, then users will be prevented from logging in to the system, but root still can
Within which directory are the predefined zones for firewalld?
/usr/lib/firewalld/zones/ . . . . . the files are copied to /etc/firewalld/zones when modified
the command kill -HUP does what?
will restart a process
Which command installs a previously downloaded Debian package?
dpkg -i
Within which directory hierarchy will you find configuration files related to printing with the CUPS printing system on a print server?
/etc/cups
Which option for yum performs a search of the package cache?
yum search
Which command and option will unset an environment variable for the current session?
env -u
Which command can be used to listen for netlink messages on a network?
ip monitor
Which command is used to turn off AppArmor profiles?
aa-disable
T or F: Commands within /etc/rc.local will be executed after the computer has gone into multiuser mode
true - by placing the commands in this file they will execute upon boot
what will the command syntax echo s{i,a,e}t produce? (those are curly brackets)
sit sat set
what does command and option rmmod -f
it forces the removal of the module
which option with git merge can be used to attempt to roll back a merge that has conflicts?
–abort
what is sudo -u used for?
to execute a command as a specific user
Which command can be used to determine how much time a Linux command takes?
time
in /etc/resolv.conf, what will the line nameserver 192.168.1.4 do?
will set the DNS server to the ip 192.168.1.4
what is the maxlogins parameter within /etc/security/limits.conf used to control?
controls the number of simultaneous logins for a given account
Which PAM module is responsible for enforcing limits such as the maximum number of logins and CPU time used?
pam_limits.so
What are the functions of the command and options hwclock -w hwclock -s
the -w option sets the hardware clock to the current system time . . . . . the -s option sets the system time to the hardware clock (these are opposite functions)
T or F: The .gitignore file is used to store files that will not be versioned.
True .gitignore file is used within a git repository to indicate files and file patterns that should not be versioned.
Within the SELinux configuration, which option controls whether the policy will be targeted or strict?
SELINUXTYPE
You need to disable the ability to reboot the Linux computer using the Ctrl+Alt+Del key combination. Within which file will you find the configuration for this key combination?
/etc/inittab
Which word pair indicates the beginning and end of a “for loop” and an “until loop” in a bash script?
do; done
What is the result of the following command hwclock –systohc –utc
command will set the hardware clock to UTC based on the current system time
which option with ioping and ping sets the number of requests to send?
-c
which option when used with arp, creates a new entry for a given IP address to MAC pair? What option removes an entry?
-s creates an ARP table entry . . . . -d option removes an entry
What EXT tool can be used to change the label that has been applied to a filesystem?
e2label
what command indicates the current mode of SELinux?
sestatus
What command can be used to change the mode of SELinux to Enforcing?
setenforce Enforcing or setenforce 1
You have backgrounded several tasks using &. Which command can be used to view the current list of running tasks that have been backgrounded?
jobs
which partition type is used to indicate a software RAID array such as an array built with mdadm?
0xFD
is a dialog-driven program for creation and manipulation of partition tables. It understands GPT, MBR, Sun, SGI and BSD partition tables
fdisk
ss -t -a
show all tcp ports connected and listening
which command is used to display information about the access control list for a given file?
getfacl
When using a multipath device, found in /dev/disk/by-multipath, what is the name given to the identifier for that device that is globally unique?
WWID
The directory that holds modules. Modules are specific to the kernel.
/usr/lib/modules/[kernel name]
command that shows a list of modules that have been loaded. Lets you check to see if a needed module was loaded already.
lsmod
command that lists details about a module. Version, kernel, description, etc.
modinfo
command that generates a list of dependencies between modules
depmod
which command manually loads a module into the kernel, but doesn’t search common directories and doesn’t look at dependencies?
insmod
which command removes/unloads a module, but doesn’t look at dependencies.
rmmod [modulename]
which command is best for managing modules?
modprobe
which module management command uses the dependency lists and maps to manage loading and unloading of modules?
modprobe
modprobe automatically looks for modules in what directory that matches the current kernel
/usr/lib/modules/[kernel]
Runlevel 1
when using the preferred module management command what is the syntax for adding a module?
modprobe
when using the preferred module management tool, what is the syntax for removing a module?
modprobe -r
Which command looks at device to kernel messages, and is the best command to look for errors when loading modules?
dmesg
what is the process of preventing the loading of modules to limit functionality?
blacklisting
if you list a module name in this modprobe file, it cannot be automatically loaded
/etc/modprobe.d/blacklist.conf
what is the syntax for adding a .conf file using the module name bluetooth, and then to blacklist the module and prevent it from loading?
echo “blacklist bluetooth” >/etc/modprobe.d/bluetooth.conf
you have stopped the automatic loading of the example bluetooth module by adding “blacklist bluetooth” to the /etc/modprobe.d/bluetooth.conf file. How would you stop the automatic and MANUAL loading of the module using this same file?
by inserting a line in the bluetooth.conf file that states: install bluetooth /bin/true