2 RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register should
be used for Satellite server 5.6 and newer only. For details, see: Satellite 5.6 ...
RED HAT ENTERPRISE LINUX 5, 6, AND 7 Common administrative commands
Configure subscription
View system profile
RHEL6
RHEL7
/etc/sysconfig/rhn/systemid
/etc/sysconfig/rhn/systemid subscription-manager identity
subscription-manager identity
rhn_register
rhn_register rhnreg_ks subscription-manager
subscription-manager 1 rhn_register 2
sosreport dmidecode hwbrowser
TASK
sosreport dmidecode lshw
View RHEL version information
/etc/redhat-release
Configure system security
Report on system security LDAP, SSSD, Kerberos
1 subscription-manager is used for Satellite 6, Satellite 5.6 with SAM and newer, and Red Hat’s CDN. 2 RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register should be used for Satellite server 5.6 and newer only. For details, see: Satellite 5.6 unable to register RHEL 7 client system due to rhn-setup package not included in Minimal installation
RHEL5
RHEL6
timedatectl date
ntpdate /etc/ntp.conf
timedatectl /etc/chrony.conf
system-config-keyboard
localectl
smbclient /etc/samba/smb.conf smbpasswd
TASK
Configure logging
RHEL5
/etc/syslog.conf
/etc/rsyslog.conf
/etc/rsyslog.conf /etc/rsyslog.d/*.conf /var/log/journal systemd-journald.service systemctl -at service ls /etc/systemd/system/*.service ls /usr/lib/systemd/system/*.service
chkconfig --list ls /etc/init.d/
List all services List running services
service --status-all
systemctl -t service --state=active
service name start service name stop
systemctl start name.service systemctl stop name.service
chkconfig name on chkconfig name off
systemctl enable name.service systemctl disable name.service
service name status
systemctl status name.service
Check if service is enabled
chkconfig name
systemctl is-enabled name
Create new service file or modify configuration
chkconfig --add
systemctl daemon-reload
runlevel who -r
systemctl get-default who -r
/etc/inittab init run_level
systemctl isolate name.target systemctl set-default
/var/log
/var/log journalctl
Start/stop service Enable/disable service View service status
JOBS AND SERVICES
RHEL7
Change run level/target View logs
add
Configure system audit
View audit output
Configure batch tasks
RHEL5
KERNEL, BOOT, AND HARDWARE
RHEL6
systemctl shutdown
Configure default run level/target Configure GRUB bootloader
poweroff
systemctl poweroff
halt
systemctl halt
reboot
systemctl reboot
/etc/inittab
systemctl set-default
/boot/grub/grub.conf
/etc/default/grub grub2-mkconfig grub-set-default
hwbrowser
modprobe -r rpm -q kernel uname -r
View kernel version
SOFTWARE MANAGEMENT
vgcreate
vgcreate ssm create (if backend is lvm)
Create logical volume
lvcreate
lvcreate ssm create (if backend is lvm)
Enlarge volumes formatted with default file system
vgextend lvextend resize2fs
vgextend lvextend xfs_growfs ssm resize
Shrink volumes formatted with default file system
resize2fs lvreduce vgreduce
XFS cannot currently be shrunk; copy desired data to a smaller file system.
fsck
fsck ssm check
/etc/exports service nfs reload
/etc/exports systemctl reload nfs.service
Check/repair file system Configure NFS share Mount and activate swap
/etc/fstab swapon -a
Automatically mount at boot
/etc/fstab
View free disk space
df lvdisplay lvs vgdisplay vgs pvdisplay pvs showmount -e mount /etc/auto.master.d/*.autofs /etc/auto.* chmod chown chgrp umask setfacl
RHEL5
RHEL6
RHEL7
iptables and ip6tables /etc/sysconfig/ip*tables
iptables and ip6tables /etc/sysconfig/ip*tables system-config-firewall
firewall-cmd firewall-config
dhcpd /etc/dhcp/dhcpd.conf /etc/sysconfig/dhcpd
/etc/dhcpd.conf /etc/dhcp6c.conf
/etc/hosts /etc/resolv.conf
/etc/hosts /etc/resolv.conf nmcli con mod
/etc/sysconfig/network
hostnamectl /etc/hostname nmtui
ip addr ifconfig brctl
ip addr nmcli dev show teamdctl brctl bridge
Configure network interface
/etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-* nmcli con [add|mod|edit] nmtui nm-connection-editor
View ports/sockets
ss lsof netstat
ss lsof
Configure hostname
View network interface info
TASK
modprobe
Remove kernel module
View installed software
Create volume group
ip route /etc/sysconfig/network system-config-network
Configure routes
sysctl -a cat /proc/cmdline
Load kernel module
View software version
pvcreate ssm create (if backend is lvm)
udev
View kernel parameters
Find file in package
pvcreate
RHEL5
RHEL6
RHEL7
top ps sar iostat netstat vmstat mpstat numastat
top ps sar iostat netstat ss vmstat mpstat numastat tuna
top ps sar iostat ss vmstat mpstat numastat tuna
modprobe
Configure hardware device
Configure software repository
Create physical volume
View routes
lshw
Configure kernel module
Upgrade software
RHEL7
shutdown
Reboot system
Update software
w
mount /etc/fstab ssm mount
Configure name resolution
append rd.break or init=/bin/bash to kernel cmdline
Halt system
View software info
/etc/shadow
mount /etc/fstab
Configure DHCP client
append 1 or s or init=/bin/bash to kernel cmdline
Power off system
Install software
chage
mkfs.filesystem_type (ext4, xfs) mkswap ssm create
Configure firewall
tar cpio zip gzip bzip2
Shut down system
TASK
groupmod /etc/sudoers
find
Create archive
View hardware configured
Change group permissions
mkfs.filesystem_type (ext4, xfs) mkswap
TASK
locate
Find file by characteristic
Single user/rescue mode
usermod /etc/sudoers
batch
Find file by name
TASK
Change user permissions
fdisk gdisk parted ssm create
Change access control list
cron at
Schedule tasks
passwd username
fdisk parted
Change file permissions
aureport /var/log/faillog
groupmod
copy data to new file system fsck (look for ‘non-contiguous inodes’) xfs_fsr
copy data to new file system fsck (look for ‘non-contiguous inodes’)
Automatically mount after boot
auditctl /etc/audit/auditd.conf /etc/audit/audit.rules authconfig /etc/pam.d/system-auth pam_tty_audit kernel module
Change group details
View/end user sessions
View NFS share
audit=1 to kernel cmdline
groupdel
Encrypted password location
View logical volume info
View run level/target
Delete user group
Change user password
authconfig authconfig-tui authconfig-gtk
Mount storage
RHEL6
groupadd
Change password policy
Format disk partition
/etc/ssh/ssh_config /etc/ssh/sshd_config ~/.ssh/config ssh-keygen
Configure SSH
Create user group
sealert
Create/modify disk partitions
FILE SYSTEMS, VOLUMES, AND DISKS
Configure samba
usermod /etc/passwd
View user account details
xfs
system-config-date
system-config-printer
usermod
ext4
localectl
Configure printer
Change user account details
ext3
system-config-language
system-config-*-tui
userdel
RHEL7
system-config-network
Text-based configuration tools
Delete user account
RHEL6
Defragment disk space
NETWORKING
BASIC CONFIGURATION
Configure keyboard
useradd
RHEL5
nmcli nmtui nm-connection-editor
Synchronize time and date
/etc/selinux/config chcon restorecon semanage setsebool system-config-selinux
Create user account
TASK
Default file system
Configure time and date
RHEL7
RHEL7
system-config-users
getent
gnome-control-center
Configure network
RHEL6
RHEL6
Network users
system-config-*
Graphical configuration tools
Configure system language
RHEL7
RESOURCE MANAGEMENT
TASK
RHEL5
RHEL5
Graphical user management
USER MANAGEMENT
View subscription information
RHEL5
SECURITY AND IDENTITY
SYSTEM BASICS
TASK
TASK
RHEL5
RHEL6
RHEL7
yum install yum groupinstall
yum install yum group install
yum info yum groupinfo
yum info yum group info
View system usage
View disk usage Trace system calls
strace
Trace library calls
ltrace
Change process priority
nice renice
Change process run location
taskset
Kill a process
kill pkill killall
yum update yum upgrade
df iostat
df
/etc/yum.repos.d/*.repo rpm -qf filename rpm -q packagename rpm -qa
10/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.