RHEL 567 Commands Cheatsheet
RHEL 567 Commands Cheatsheet
SYSTEM BASICS
TASK
RHEL
/etc/sysconfig/rhn/systemid
/etc/sysconfig/rhn/systemid
subscription-manager identity
subscription-manager identity
rhn_register
subscription-manager 1
rhn_register
Configure subscription
rhnreg_ks
subscription-manager
subscription-manager 2
rhn_register 3
sosreport
dmidecode
hwbrowser
RESOURCE MANAGEMENT
sosreport
dmidecode
lstopo
TASK
lscpu
/etc/redhat-release
top
ps
sar
iostat
netstat
vmstat
mpstat
numastat
BASIC CONFIGURATION
TASK
RHEL
system-config-*
6
7
gnome-control-center
system-config-network
Configure network
nmcli
nmtui
nm-connection-editor
system-config-language
system-config-date
date
7
5
timedatectl
date
ntpdate
/etc/ntp.conf
timedatectl
/etc/chrony.conf
ntpdate
Configure keyboard
system-config-keyboard
top
ps
sar
iostat
netstat
ss
vmstat
mpstat
numastat
tuna
df
6
7
localectl
top
ps
sar
iostat
ss
vmstat
mpstat
numastat
tuna
localectl
RHEL
df
iostat
strace
ltrace
Change process
priority
nice
renice
system-config-*-tui
Configure printer
system-config-printer
Change process
run location
taskset
Kill a process
kill
pkill
killall
/etc/ssh/ssh_config
Configure SSH
/etc/ssh/sshd_config
~/.ssh/config ssh-keygen
SOFTWARE MANAGEMENT
TASK
NETWORKING
RHEL
yum install
yum groupinstall
TASK
iptables and ip6tables
/etc/sysconfig/ip*tables
Install software
yum install
View software
info
yum groupinfo
Update software
yum update
Upgrade software
yum upgrade
Find file in
package
View software
version
View installed
software
subscription-manager repos
/etc/yum.repos.d/*.repo
rpm -q packagename
rpm -qa
yum list installed
Configure
name
resolution
/etc/hosts
/etc/resolv.conf
/etc/sysconfig/network
Configure
hostname
View network
interface info
Configure
network
interface
RHEL
system-config-users
Create user
account
useradd
Delete user
account
userdel
usermod
View/change user
account details
/etc/passwd
vipw
View ports/
sockets
id
groupadd
groupdel
Change group
details
groupmod
Change user
password
/etc/group
passwd
Change user
permissions
usermod
Change group
permissions
groupmod
visudo
visudo
Change password
policy
chage
View user
sessions
View routes
7
5
6
7
ip addr
nmcli dev show
teamdctl
brctl
bridge
/etc/sysconfig/network-scripts/ifcfg-*
nmcli con [add|mod|edit]
nmtui
nm-connection-editor
ss
lsof
netstat
ss
lsof
ip route add
system-config-network
/etc/sysconfig/route-iface
Configure
routes
hostnamectl
/etc/hostname
nmtui
ip addr
ifconfig
brctl
USER MANAGEMENT
Graphical user
management
/etc/hosts
/etc/resolv.conf
nmcli con mod
/etc/sysconfig/network-scripts/ifcfg-*
TASK
firewall-cmd
firewall-config
Configure
software
repository
Configure
firewall
yum info
RHEL
ip route add
nmcli
nmtui
nm-connection-editor
/etc/sysconfig/route-iface
ip route
RHEL
Configure system
security
/etc/selinux/config
chcon
restorecon
semanage
setsebool
system-config-selinux
Report on system
security
sealert
LDAP, SSSD,
Kerberos
authconfig
authconfig-tui
authconfig-gtk
Network users
getent
RHEL
/etc/syslog.conf
5
6
/etc/rsyslog.conf
Configure logging
/etc/rsyslog.conf
/etc/rsyslog.d/*.conf
/var/log/journal
systemd-journald.service
chkconfig --list
ls /etc/init.d/
Start/stop service
Enable/disable service
7
5
6
7
7
5
7
5
6
7
6
7
systemctl daemon-reload
/etc/systemd/system/*.service
runlevel
who -r
7
5
systemctl get-default
who -r
/etc/inittab
init run_level
7
5
View logs
7
5
/var/log
journalctl
aureport /var/log/faillog
Schedule/batch tasks
cron
at
batch
locate
find
Create archive
tar
cpio
zip
RHEL
ext3
ext4
xfs
copy data to new file system
fsck (look for non-contiguous inodes)
7
5
6
7
6
7
lvcreate
ssm create (if backend is lvm)
vgextend
lvextend
resize2fs
vgextend
lvextend
xfs_growfs
ssm resize
resize2fs
lvreduce
vgreduce
vgcreate
ssm create (if backend is lvm)
lvcreate
pvcreate
ssm create (if backend is lvm)
vgcreate
7
5
fsck
ssm check
/etc/exports
service nfs reload
mount
/etc/fstab
ssm mount
pvcreate
Mount storage
fdisk
gdisk
parted
ssm create
mkfs.filesystem_type (ext4, xfs)
mkswap
7
5
/etc/exports
systemctl reload nfs.service
/etc/fstab
swapon -a
/etc/fstab
df
RHEL
lvdisplay
lvs
vgdisplay
vgs
pvdisplay
pvs
showmount -e
mount
/etc/auto.master.d/*.autofs
/etc/auto.*
chmod
chown
chgrp
umask (future file creation)
chattr
setfacl
RHEL
append 1 or s or init=/bin/bash to kernel cmdline
6
7
6
7
6
7
reboot
systemctl reboot
/etc/inittab
7
5
systemctl set-default
/boot/grub/grub.conf
halt
systemctl halt
reboot
Reboot system
poweroff
systemctl poweroff
halt
Halt system
shutdown
systemctl shutdown
poweroff
7
5
/etc/default/grub
grub2-mkconfig
grub-set-default
hwbrowser
7
5
modprobe
udev
sysctl -a
cat /proc/cmdline
modprobe
modprobe -r
rpm -q kernel
uname -r
11/14
Copyright 2014 Red Hat, Inc. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, and JBoss are trademarks of Red Hat, Inc.,
registered in the U.S. and other countries. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.