Show Menu

Red Hat Cheat Sheet by


systemctl list-u­nit­-files -at service
Lists enable­d/d­isabled service unit files.
systemctl list-units -at service
Lists enable­d/d­isabled running services.
systemctl list-units -t service --state running
Shows active running services.
Shows enabled service unit files.
Shows both enabled and disabled service unit files.
systemctl mask [service name]
Prevents service from starting.


User cron jobs.
System cron jobs.
[minute 0-59] [hour] [day of the month] [month of the year] [day of the week] [path of script]
Cron job time format.
Crontab generator.
0 1 *
Runs job everyday at 1 a.m.
0 1 * [user]
Format for system wide cron jobs.
Allow access to the AT services.
Allow access to cron services.
An empty deny file means nobody is denied.
An empty allow file means nobody is allowed.
If both are missing nobody is allowed.
Root always has access.


rpm -qa
Queries all installed packages.
rpm -qa | sort
rpm -qi [package]
Shows inform­ation about the package.
rpm -qa Group=­"­System Enviro­nme­nt/­She­lls­"
rpm --qa -last
Shows packages install sorted by date
rpm -ql yum
Queries for list of file paths.
rpm -qc yum
rpm -qf [path to file]
Query file.
rpm -qdf [path to file]
Shows all docume­ntation for specified comman­d/file.
rpm -q --provide
rpm -q --requires [file]
rpm -q --chan­gelog [file]
Shows changes to package.


Enforcing mode
Security policy is enforced.
Permissive mode
Security policy is observed and warnings are printed but policy is not enforced.
Mandatory access control if turned off.
Shows SELinux status.
set setenforce <mo­de>
Tempor­arily changes SELinux mode.
vi /selin­ux/­config
SELinux config file.


graphical network editor


less -N /etc/r­sys­log.conf
View rsyslog config­uration file with line numbering turned on.
cat /var/l­og/­mes­sages
Lists messages log.
grep -v 'systemd:' /var/l­og/­mes­sages
Lists everything that does not include systemd.
tail -f /var/l­og/­mes­sages
Follows log file.
Private authen­tic­ation messages (logins)
Logrotate cron job.
Logrotate config­uration file.
logger "­mes­sag­e"
Writes message to messages log file.


yum --show­dup­licates -list [pacakge name]
Shows versions of a package.
yum list installed
Lists all packages installed.
Update available in reposi­tory.
Bold and underline
Current kernel
Package doesn't exist in reposi­tory.
Newer package then in reposi­tory.
yum list updates
Lists updates for packages installed.
yum list available
yum info [package name]
Shows package info.
yum deplist [package name]
Shows depend­encies for package.
yum search [package name]
Searches for package name.
yum reinstall [package name]
Reinst­alled package.
yum reinstall --skip­-broken [package name]
yum remove [package name]
Removes package.
yum autoremove [package name]
Removes packages including depend­encies.
yum packag­e-c­leanup
Shows unused packages.
yum install yum-utils
yum check-­update
Checks for updates.
yum list obsoletes
yum install yum-pl­ugi­n-v­ers­ionlock
yum versio­nlock [package name]
Prevents package from updating.
yum versio­nlock
Lists version locked packages.
yum versio­nlock delete [output from yum versio­nlock]
Removes version lock from package.
yum update --security
Only updates security packages.
yum update­-mi­nimal --security
Install strictly security updates. Doesn't include bug fixes.
yum install yum-plugin changelog
View package change logs.
yum changelog updates
Gets all change logs for packages with updates.
yum changelog [package name]
View change log for specific package.
yum list installed kernel-*
Lists currently installed kernel.
ls -l /boot
Kernel directory.
uname -r
Shows running kernel.
yum list available kernel
Lists available kernel.
yum -y update kernel
Updates kernel.
yum remove kernel
grub2-­set­-de­fault [kernel number]
Changes kernel.
ls /lib/m­odu­les­/$(­uname -r)/kernel
Lists kernel module directory.
Lists modules.


Lists local time for current timezone.
timeda­tectl list-t­ime­zones | grep America
Filters timezones via grep.
timeda­tectl set-ti­mezone [timezone]
Sets timezone.
timeda­tectl set-time 24:00:00
Manually sets time.
timeda­tectl set-time 2018-12-30
Manually sets date.
timeda­tectl set-ntp true
Enables NTP.
systemctl restart system­d-t­ime­dated
Restarts NTP service.
yum install ntp
Installs NTP client.
NTP config file.
ntpdate -q <server addres­s>
Checks NTP server address.
ntpdate <server addres­s>
Sets NTP server.
systemctl enable ntpdate
Enables NTP synchr­oni­zation.


Lists all journal entries.
journalctl /sbin/­crond
Specifies journal.
journalctl -f
Tails journal.
mkdir /var/l­og/­journal
Directory for persistent journals.

File Access Control

ls -l [file name]
Lists group owners.
The user-owner is the third column from the left. THe group-­owner is the fourth column.
Read (r)
Write (w)
Execute (x)
chmod u=rwx,­g=rx,o= <fi­le>
Symbolic permission format.
chmod u+rwx <fi­le>
Adds permis­sions format.
chmod o-x <fi­le>
Remove permis­sions format.
chmod a-x <fi­le>
Removes execute from all positions.
Recurs­ively adds permis­sions.
View umask.
umask -S
View umask in symbolic notation.
Default directory permis­sions.
Default file permis­sions. (umask 002)
umask 022
Changes umask.
umask 002
Direct­ories- rwx-r-­xr-x, Files- rwxr--r--
vi ~/bashrc
User umask startup file
add new umask to end of file.
vi /etc/p­rof­ile.d/­unm­
System wide unmask.
if [ "­$UI­D" -ge 1000] ;then
getfacl <fi­le>
lists ACLs on file.
setfacl -m user:<­use­r>:­<pe­rmi­ssi­ons> aclfile
Sets ACLs on file.
setfacl -m user:r­oot:rwx /home/­fil­e.txt
setfacl -m group:­<gr­oup­>:<­per­mis­sio­n> <fi­le>
setfacl -x group:root <fi­le/­dir>
-x remove specific ACL, -k removes all default ACLs, -b removes all ACLs


No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          Vim NERDTree Cheat Sheet