You are on page 1of 2

Common administrative commands

in Red Hat Enterprise Linux 5, 6, 7, and 8


System basics File systems, volumes, and disks Jobs and services
TASK RHEL TASK RHEL TASK RHEL

/etc/sysconfig/rhn/ ext3 5 chkconfig --list


View 5 6 5 6
systemid Default file ls /etc/init.d/
subscription ext4 6
system
information subscription-manager
6 7 8
systemctl -at service
identity xfs 7 8 ls /etc/systemd/system/*.
service 7
6 ssm create 7 ls /usr/lib/systemd/
rhnreg_ks List all
system/*.service
Create/ gdisk 7 8 services
Configure rhn_register 1, 3 5 6 7 8
subscription modify disk ssm_create 8
systemctl list-units -at
partitions service
subscription-manager 2 6 7 8 find /etc/systemd/ /
fdisk 8
parted 5 6 7 8 usr/lib/systemd/ /
hwbrowser 5 run/systemd/ -name
*.service”
sosreport
ssm create 7 8
5 6 7 8 Format disk
dmidecode
mkfs.filesystem_type (ext4,
service --status-all 5 6
View system partition List running
xfs) 5 6 7 8
profile lstopo
6 7 8 mkswap
services systemctl -t service
7 8
lscpu --state=active

cat/proc/cpuinfo
xfs_fsr 6 7 8 service name start
lshw 8 5 6
Defragment copy data to new file service name stop
disk space system Start/stop
View RHEL 5 6 7 8 systemctl start name.
fsck (look for ‘non-contig- service service
version /etc/redhat-release 5 6 7 8 uous inodes’) 7 8
systemctl stop name.
information service
ssm mount 7 8
Mount
1 Be aware of potential issues when using subscription-manager on Red storage mount chkconfig name on
5 6
Hat Enterprise Linux 5: https://access.redhat.com/solutions/129003. /etc/fstab 5 6 7 8 chkconfig name off
Enable/
2 Subscription-manager is used for Satellite 6, Satellite 5.6 with SAM disable systemctl enable name.
and newer, and Red Hat’s CDN. Mount and /etc/fstab
5 6 7 8 service service
3 RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register activate swap swapon -a
systemctl disable name.
7 8
should be used for Satellite server 5.6 and newer only. For details, see: service
What subscription management services are offered by RHSM?, Configure
Transition of Red Hat Network Classic Hosted to Red Hat Subscription /etc/fstab 5 6 7 8 5 6
static mounts service name status
Management, and Satellite 5.6 unable to register RHEL 7 client system View service
due to rhn-setup package not included in Minimal installation. status systemctl status name.
7 8
View free disk service
df 5 6 7 8
space
Check if chkconfig name --list 5 6
lvdisplay service is
Software management lvs enabled systemctl is-enabled name 7 8
View logical vgdisplay
volume info vgs 5 6 7 8
TASK RHEL Create new chkconfig --add 5 6
pvdisplay
pvs service file systemctl daemon-reload
yum groupinstall 5 6 or modify /etc/systemd/system/*. 7 8
Install Create ssm create (if backend is
8
configuration service
yum group install 7 8 lvm)
software physical
volume runlevel 5 6
yum install 5 6 7 8 pvcreate 5 6 7 8
View run
systemctl get-default 7 8
yum groupinfo 5 6 ssm create (if backend is level/target
Create volume lvm) 8
who -r 5 6 7 8
View software group
yum group info 7 8
info vgcreate 5 6 7 8 /etc/inittab
init run_level 5 6
yum info 5 6 7 8 ssm create (if backend is
8
Change run
Create logical lvm) level/target systemctl isolate name.
Update volume target 7 8
yum update 5 6 7 8
software lvcreate 5 6 7 8 systemctl set-default

resize2fs 5 6 /etc/syslog.conf 5
Upgrade Enlarge
yum upgrade 5 6 7 8
software volumes xfs_growfs /etc/rsyslog.conf 6 7 8
formatted 7 8 Configure
ssm resize
with default logging /etc/rsyslog.d/*.conf
Configure subscription-manager
file system vgextend /var/log/journal 7 8
software repos 5 6 7 8 lvextend 5 6 7 8 systemd-journald.service
repository /etc/yum.repos.d/*.repo
resize2fs journalctl 7 8
Shrink 5 6 View logs
Find package rpm -qf filename
volumes
lvreduce
5 6 7 8 vgreduce /var/log 5 6 7 8
owning file yum provides filename-glob
formatted
with default XFS cannot currently be pam_tty_audit kernel
5 6 7
rpm -q packagename 5 6 file system shrunk; copy desired data 7 8 module
to a smaller file system.
View software yum list installed tlog 8
version ssm check 8
packagename 7 8 Check/repair Configure add audit=1 to kernel
rpm -q packagename file system system audit cmdline
fsck 5 6 7 8
auditctl
View installed rpm -qa
View NFS
/etc/audit/auditd.conf 5 6 7 8
5 6 7 8 showmount -e
software yum list installed
share mount 5 6 7 8 /etc/audit/audit.rules
authconfig
/etc/pam.d/system-auth
Install a yum module install service nfs reload 5 6
8
module module_name View audit aureport
Configure systemctl reload nfs. 5 6 7
7 8 output /var/log/faillog
NFS share service
View info on a yum module info
8
module module_name /etc/exports 5 6 7 8 cron
Schedule/ at 5 6 7 8
batch
View a Configure /etc/auto.master.d/*. batch tasks
yum module info
module’s 8 on-demand autofs 8 systemd-run --on-calendar 8
module_name
streams auto-mounts /etc/auto.*
Find file by locate 5 6 7 8
yum module remove chmod name
chown
module_name:stream Change file
Change chgrp 8
yum module reset permissions Find file by
module 8 umask (future file find 5 6 7 8
streams module:stream creation) characteristic
yum module install
module:new_stream Change file tar
chattr 8
attributes Create archive cpio
5 6 7 8
zip
List available yum module list 8 xz
modules Change
access setfacl 8
control list
Basic configuration Kernel, boot, and hardware Security and identity
TASK RHEL TASK RHEL TASK RHEL

Graphical system-config-* 5 6 append 1 or s or init=/ /etc/selinux/config


configuration bin/bash to kernel 5 6 Configure chcon
tools gnome-control-center 7 8 Single user/ cmdline
system restorecon
5 6 7 8
rescue mode append 1 or s or rd.break security
semanage
setsebool
Text-based or init=/bin/bash to 7 8 system-config-selinux
kernel cmdline
configuration system-config-*-tui 5 6
tools Report on
Shut down shutdown 5 6 7 8 system sealert 5 6 7 8
system
Configure system-config-printer 5 6 7 security
printer 8 systemctl poweroff 7 8
gnome-control-center Power off authconfig
system authconfig-tui 5 6 7
system-config-date 5 6 poweroff 5 6 7 8 LDAP, SSSD,
authconfig-gtk
Kerberos
Configure timedatectl 7 8 systemctl halt 7 8
Halt system authselect 8
time and date date 5 6 7 8 halt 5 6 7 8
Network users getent 5 6 7 8
gnome-control-center 8 systemctl reboot 7 8
Reboot
/etc/ntp.conf 5 6 system reboot 5 6 7 8
ntpdate 5 6 7
Configure /etc/inittab 5 6
Synchronize
default run
time and date
timedatectl
/etc/chrony.conf 7 8
level/target systemctl set-default 7 8
User management
date TASK RHEL
8 /boot/grub/grub.conf 5 6
chronyc Configure
GRUB /etc/default/grub Graphical user system-config-users 5 6 7
system-config-keyboard 5 6 bootloader management
grub2-mkconfig 7 8
Configure grub-set-default
gnome-control-center 8
localectl 7 8
keyboard
hwbrowser 5 Create user useradd 5 6 7
gnome-control-center 8
View hardware account gnome-control-center 8
lshw (in EPEL) 6 7
/etc/ssh/ssh_config configured
Configure /etc/ssh/sshd_config userdel 5 6 7
5 6 7 8 lshw 8 Delete user
SSH ~/.ssh/config
ssh-keygen account gnome-control-center 8
Configure modprobe 5 6 7 8
kernel module usermod
/etc/passwd
View/change 5 6 7
Configure
user account vipw
Networking hardware udev 5 6 7 8
details id
device
TASK RHEL gnome-control-center 8
View kernel sysctl -a
7 8 5 6 7 8 groupadd 5 6 7
Configure nmcli con mod parameters cat /proc/cmdline Create user
name group
/etc/hosts gnome-control-center 8
resolution /etc/resolv.conf
5 6 7 8 Load kernel modprobe 5 6 7 8
module Delete user groupdel 5 6 7
/etc/sysconfig/network 5 6
group gnome-control-center 8
Configure Remove
hostnamectl modprobe -r 5 6 7 8
hostname /etc/hostname 7 8 kernel module groupmod
nmtui Change group 5 6 7
/etc/group
View kernel rpm -q kernel details
ifconfig 5 6 5 6 7 8 8
version uname -r gnome-control-center

nmcli dev show


Change user passwd 5 6 7
View network teamdctl 7 8
interface info bridge password gnome-control-center 8
ip addr
5 6 7 8 usermod
brctl Resource management Change user visudo
5 6 7
nmcli con [add|mod|edit] permissions
TASK RHEL
7 8 gnome-control-center 8
Configure nmtui
nm-connection-editor
network Trace system 5 6 7
interface strace 5 6 7 8 Change chage
/etc/sysconfig/ calls
5 6 7 8 password
network-scripts/ifcfg-*
policy gnome-control-center 8
Trace library
View routes ip route 5 6 7 8
ltrace 5 6 7 8
calls w 5 6 7
View user
system-config-network 5 6 sessions
Change gnome-control-center 8
nice
nmcli process renice 5 6 7 8
Configure nmtui 7 8 priority
routes nm-connection-editor

ip route add
Change
/etc/sysconfig/route-iface
5 6 7 8 process run taskset 5 6 7 8
location
iptables and ip6tables
5 6
/etc/sysconfig/ip*tables kill
Kill a process pkill 5 6 7 8
Configure system-config-firewall 6 killall
firewall firewall-cmd
7 8
netstat 5 6
firewall-config
ss
nftables 8 tuna 6 7 8

pcp-dstat--socket 8 pcp atop 8


View ports/ View system
sockets
ss usage top
lsof 5 6 7 8 ps
netstat sar
iostat 5 6 7 8
vmstat
mpstat
numastat

iostat 6 7 8

View disk pcp-dstat


usage pmiostat 8

df 5 6 7 8

5/19

Copyright © 2019 Red Hat, Inc. Red Hat, Red Hat Enterprise Linux, the Red Hat logo, and JBoss are trademarks or registered trademarks of Red Hat, Inc.
or its subsidiaries in the United States and other countries. Linux ® is the registered trademark of Linus Torvalds in the U.S. and other countries.

You might also like