Red Hat Certified Systems Administrator
How do you immediately repeat the previous command?
!!
How do you run the most recently command that starts with ls
!ls
Which Bash shortcut or command re-executes a specific command in the history list?
!number
Which Bash shortcut or command is used to re-execute a recent command by matching the command name?
!string
Which pattern will only match filenames that container a number?
*[[:digit:]]*
What file is used to track the default password aging policies?
/etc/login.defs
Where are man pages located?
/usr/share/man
Where do you see failed sudo attempts?
/var/log/secure
List common sections of the linux manual
1 - user commands 2 - system calls 3 - library functions 4 - special files 5 - file formats 6 - games 7 - conventions, standards, and misc 8 - system admin and privileged commands 9 - Linux kernel API
What is /tmp?
A world-writable space for temporary files. Files which have not been accessed, changed, or modified for 10 days are deleted from this directory automatically. Another temporary directory exists, /var/tmp, in which files that have not been accessed, changed, or modified in more than 30 days are deleted automatically.
What does command substitution do?
Allows the output of a command to replace the command itself on the command line
How do you get a terminal window?
Alt-F2 or use the dash shortcut
What does a process consist of?
An address space of allocated memory, security properties including ownership credentials and privileges, one or more execution threads of program code and process state
How do you send output to and screen and file at the same time?
At the end of the command append: | tee
What is the Stop action?
Cause a program to stop executing (suspend) and wait to continue
What is the Core action?
Causes a program to save a memory image (core dump), then terminate
What is the Term action?
Causes a program to terminate at once
What is a permissive open source license?
Code from maintainer is open source but improvements made by contributor can make their contributions proprietary.
What is /etc for?
Configuration files specific to this system.
What is /dev?
Contains special device files that are used by the system to access hardware.
What is the CONT signal?
Continue - sent to a process to resume, if stopped. Cannot be blocked.
What is copy left license?
Contributors have to abide by same terms and conditions that the maintainer followed.
How do you add sudo to a group named "consultants" without the need for password entry?
Create a file call consultants in /etc/sudoers.d/ then add the following %consultants ALL=(ALL) NOPASSWD: ALL
What is the keyboard sequence to get a core dump?
Ctrl + \
Using the keyboard how do you send a job to the background and suspend it immediately.
Ctrl+z
What does the Z zombie flag mean?
EXIT_ZOMBIE - A child process signals it's parent as it exits. All resources except the PID are released EXIT_DEAD - When the parent reaps the remaining child process structure and the process is completely released
What is channel 2 used for?
Error messages
What is /boot?
Files needed in order to start the boot process.
List some examples of copy left open source licensing
General Public License and Lesser General Public License
What is the HUP signal?
Hangup - used to report termination of the controlling process
What happens when you use -r with userdel?
In addition to the username being deleted from /etc/passwd the home directory is deleted as well.
What happens when you use a double dash after a command?
It tells the system to use the following as a complete word vs individual options
How does a file get input and send output?
It uses numbered channels called file descriptors. All processes start with at least three file descriptors.
What is the INT signal?
Keyboard interrupt - causes program termination (Ctrl-c)
What is the KILL signal?
Kill, unblockable - Causes abrupt program termination. Cannot be blocked, ignored, or handled; always fatal
List examples of permissive open source licenses
MIT, Simplified BSD, Apache
Can a hard link work across two different file system?
No
What is channel 1 used for?
Output to terminal
What variable in login.defs sets maximum days a password can be used?
PASS_MAX_DAYS
What variable in login.defs sets minimum age for a password?
PASS_MIN_DAYS
What variable in login.defs sets the default warning age?
PASS_WARN_AGE
What is PPID?
PID of the parent process
What is PGID?
PID of the process group leader
What do you use to indicate a command substitution?
Parentheses preceded by the dollar sign. For example echo Today is $(date +%A)
How do you get a list of all the -- options associated with useradd
Press tab twice after the --
Which Bash shortcut or command jumps to the beginning of the command line?
Pressing Ctrl+A
Which Bash shortcut or command is used to clear characters from the cursor to the end of the command line?
Pressing Ctrl+K
Which Bash shortcut or command copies the last argument of previous commands?
Pressing Esc+.
Which Bash shortcut or command is used to complete commands, file names, and options?
Pressing Tab
What directories will mkdir RHEL{6,7} create?
RHEL6 RHEL7
What is /run for?
Runtime data for processes started since the last boot. This includes process ID files and lock files, among other things. The contents of this directory are recreated on reboot.
What is the QUIT signal?
Similar to SIGINT; adds a process dump at termination
What is channel 0 used for?
Standard input
What is the STOP signal?
Stop, unblockable - Suspends the process
What does the S sleeping flag mean?
TASK_INTERRUPTIBLE - waiting on some condition
What does the K sleeping flag mean?
TASK_KILLABLE - same as D but modified to allow a waiting task to respond to the signal that it should be killed
What does the I sleeping flag mean?
TASK_REPORT_IDLE - A subset of state D, the kernel does not count these processes when calculating load average, used for kernel threads.
What does the T stopped flag mean?
TASK_STOPPED - task stopped but can be resumed or TASK_TRACED - task stopped for debugging
What does the D sleeping flag mean?
TASK_UNINTERRUPTIBLE - sleeping but does not respond to signals, used when process interruption may cause an unpredictable state
What are the three possible actions for signals?
Term, Core, and Stop
What is the TERM signal?
Terminate - Cuases program termination and cannot be blocked, ignored, or handled; always fatal
What is the SID?
The PID of the session leader which is normally the interactive shell that is running on it's controlling terminal
What is the purpose of the nologin shell?
The shell acts as a replacement shell for the user accounts not intended to interactively log into the system
Name two advantages of soft links
They can link two files on different file systems. They can point to a directory or special file, not just a regular file.
What is the touch command normally used for?
To update a file's timestamp to the current date and time without otherwise modifying it
What is PID?
Unique process ID of the process
What is the TSTP signal?
Unlike SIGSTOP, can be blocked, ignored, or handled. Sent by typing (Ctrl-z)
How do you execute multiple separate commands on the command line?
Use ;
How do you find out if two soft links are linked to the same file?
Use ls -il and if they are they will have the same inode number
How do I executes commands one after another iff the prior command executed successfully?
Use the conditional operator && like this date +%A && whoami
How do I executes a series of commands iff the initial command fails?
Use the double pipe operator like this ate +%A || uname -r && whoami
How do you run separate commands that execute one after another?
Use the semicolon date +%A; whoami
What does brace expansion do?
Used to generate a discretionary string of characters
What is /var for?
Variable data specific to this system that should persist between boots. Files that dynamically change, such as databases, cache directories, log files, printer-spooled documents, and website content may be found here
When does the prompt display ~ ?
When you are in your home directory
What would be the pattern to match all files that do not begin with a "b"?
[!b]*
How can you access an independent login session for a particular virtual console?
by pressing Ctrl+Alt and a function key (F1 through F6)
Which command will always return you to the working directory used prior to the current working directory?
cd -
How do you display the password aging details for user01?
chage -l user01
What does the -p option do in mkdir?
creates missing parent directories for the requested destination
How do you get the current weekday name at the command line?
date +%A
How do you get the full date at the command line?
date +%F
How do you print the date in dd/mm/yyyy
date +%x
How do you use date to calculate a date 45 days out?
date -d "+45 days" +%F
How do you create a system group?
groupadd -r
How do you delete a group?
groupdel
How do you change the properties of an existing group?
groupmod
How do you rename a group?
groupmod -n <oldname> <newname>
How do you recursively look at files in directories and subdirectories?
ls -R
What does echo {m..p} generate?
m n o p
What is a more modern implentation of man that has hyperlinks included?
pinfo
How do you set user01's password aging details such that they have to use the changed password for at least 10 days, can use the same password for 100 days and start being warned 14 days before of expiration but allow 2 days of buffer after expiration to still change the password before the account is locked?
sudo chage -m 10 -M 100 -W 14 -I 2 user01
How do you lock a user account?
sudo usermod -L <name>
how do you lock a user account?
sudo usermod -L <user>
All processes are descendants of the first system process, what is the name of the first system process?
systemd
In a graphical environment for RHEL 8 what is the name of the virtual console that will have the login screen?
tty1
How can you exit a host?
type exit at the prompt or ctrl+D
How do you add a comment to a user account?
usermod -c "<comment>" <username>
What do you use to edit the sudoers file?
visudo
How do you simultaneously find the binary, source and manual pages for a command?
whereis
