Vous êtes sur la page 1sur 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 system ext4 6
information subscription-manager
6 7 8 xfs 7 8
systemctl -at service
identity ls /etc/systemd/
system/*.service 7
ssm create 7
rhnreg_ks 6 List all ls /usr/lib/systemd/
system/*.service
Configure Create/ gdisk 7 8 services
rhn_register 1, 3 5 6 7 8
subscription modify disk ssm_create 8 systemctl list-units
2 6 7 8
partitions -at service
subscription-manager find /etc/systemd/ /
fdisk 8
5 6 7 8 usr/lib/systemd/ /
hwbrowser 5 parted
run/systemd/ -name
sosreport ssm create 7 8 *.service”
dmidecode 5 6 7 8 Format disk
View system mkfs.filesystem_type service --status-all 5 6
partition (ext4, xfs) 5 6 7 8 List running
profile lstopo
lscpu 6 7 8 mkswap services systemctl -t service
7 8
--state=active
cat/proc/cpuinfo xfs_fsr 6 7 8
8 service name start
lshw
Defragment copy data to new file 5 6
service name stop
disk space system
5 6 7 8 Start/stop
View RHEL fsck (look for ‘non-con- systemctl start name.
version /etc/redhat-release 5 6 7 8 tiguous inodes’) service service
information 7 8
systemctl stop name.
ssm mount 7 8 service
Mount
1 Be aware of potential issues when using subscription-manager on storage mount
5 6 7 8 chkconfig name on
/etc/fstab 5 6
Red Hat Enterprise Linux 5: https://access.redhat.com/ chkconfig name off
solutions/129003. Enable/
Mount and /etc/fstab disable systemctl enable name.
2 Subscription-manager is used for Satellite 6, Satellite 5.6 with SAM 5 6 7 8
and newer, and Red Hat’s CDN. activate swap swapon -a service service
7 8
systemctl disable name.
3 RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register service
should be used for Satellite server 5.6 and newer only. For details, Configure /etc/fstab 5 6 7 8
see: What subscription management services are offered by RHSM?, static mounts service name status 5 6
Transition of Red Hat Network Classic Hosted to Red Hat View service
Subscription Management, and Satellite 5.6 unable to register status systemctl status name.
7 8
RHEL 7 client system due to rhn-setup package not included in
View free disk service
df 5 6 7 8
Minimal installation. space
Check if chkconfig name --list 5 6
lvdisplay service is systemctl is-enabled
lvs enabled 7 8
View logical vgdisplay
name
5 6 7 8
Software management volume info vgs
chkconfig --add 5 6
pvdisplay Create new
TASK RHEL pvs service file systemctl daemon-reload
or modify /etc/systemd/system/*. 7 8
ssm create (if backend
yum groupinstall 5 6 Create 8 configuration service
is lvm)
Install physical
software
yum group install 7 8 volume pvcreate 5 6 7 8 runlevel 5 6
View run
5 6 7 8 systemctl get-default 7 8
yum install ssm create (if backend
8
level/target
Create volume is lvm) who -r 5 6 7 8
yum groupinfo 5 6 group
vgcreate 5 6 7 8 /etc/inittab
View software 5 6
yum group info 7 8 init run_level
info ssm create (if backend Change run
Create logical 8
yum info 5 6 7 8
is lvm) level/target systemctl isolate name.
volume target 7 8
lvcreate 5 6 7 8 systemctl set-default
Update yum update 5 6 7 8
software resize2fs 5 6 /etc/syslog.conf 5
Enlarge
volumes xfs_growfs /etc/rsyslog.conf 6 7 8
Upgrade formatted ssm resize 7 8 Configure
yum upgrade 5 6 7 8
software with default logging /etc/rsyslog.d/*.conf
/var/log/journal
file system vgextend
5 6 7 8 7 8
lvextend systemd-journald.
Configure subscription-manager
service
software repos 5 6 7 8 resize2fs
repository /etc/yum.repos.d/*.repo Shrink lvreduce 5 6 journalctl 7 8
volumes vgreduce View logs
/var/log 5 6 7 8
rpm -qf filename formatted
Find package with default
XFS cannot currently be
yum provides 5 6 7 8 pam_tty_audit kernel
owning file file system
shrunk; copy desired
7 8 module 5 6 7
filename-glob data to a smaller file
system.
tlog 8
rpm -q packagename 5 6
Check/repair ssm check 8 Configure add audit=1 to kernel
View software
version
yum list installed file system fsck 5 6 7 8
system audit cmdline
packagename 7 8 auditctl
rpm -q packagename
/etc/audit/auditd.conf 5 6 7 8
View NFS showmount -e /etc/audit/audit.rules
5 6 7 8
share mount authconfig
View installed rpm -qa /etc/pam.d/system-auth
5 6 7 8
software yum list installed
service nfs reload 5 6
View audit aureport
Configure 5 6 7
Install a yum module install systemctl reload nfs.
7 8
output /var/log/faillog
8 NFS share
module module_name service
cron
/etc/exports 5 6 7 8 at 5 6 7 8
View info on a yum module info Schedule/ batch
8
module module_name Configure /etc/auto.master.d/*. batch tasks
on-demand autofs 8 systemd-run
8
--on-calendar
View a auto-mounts /etc/auto.*
yum module info
module’s 8
module_name Find file by
streams chmod locate 5 6 7 8
chown name
Change file
chgrp 8
yum module remove permissions umask (future file Find file by
module_name:stream creation) find 5 6 7 8
Change characteristic
yum module reset
module 8
streams module:stream Change file tar
chattr 8
yum module install attributes cpio
Create archive 5 6 7 8
module:new_stream zip
Change xz
List available access setfacl 8
yum module list 8
modules 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 semanage
append 1 or s or security setsebool
Text-based rd.break or init=/bin/ 7 8 system-config-selinux
bash to kernel cmdline
configuration system-config-*-tui 5 6
tools Report on
Shut down system sealert 5 6 7 8
shutdown 5 6 7 8
system security
Configure system-config-printer 5 6 7
printer gnome-control-center 8 systemctl poweroff 7 8
Power off authconfig
system-config-date 5 6
system LDAP, SSSD, authconfig-tui 5 6 7
poweroff 5 6 7 8 authconfig-gtk
Kerberos
Configure timedatectl 7 8 systemctl halt 7 8 authselect 8
time and date date 5 6 7 8
Halt system
halt 5 6 7 8 Network users getent 5 6 7 8
gnome-control-center 8
Reboot systemctl reboot 7 8
/etc/ntp.conf 5 6
system reboot 5 6 7 8
ntpdate 5 6 7
Synchronize Configure /etc/inittab 5 6
time and date
timedatectl
/etc/chrony.conf 7 8 default run User management
level/target systemctl set-default 7 8
TASK RHEL
date
8
chronyc
/boot/grub/grub.conf 5 6 5 6 7
Configure Graphical user system-config-users
system-config-keyboard 5 6 GRUB /etc/default/grub management
Configure gnome-control-center 8
localectl 7 8 bootloader grub2-mkconfig 7 8
keyboard grub-set-default
Create user useradd 5 6 7
gnome-control-center 8
hwbrowser 5 account gnome-control-center 8
/etc/ssh/ssh_config View hardware
Configure /etc/ssh/sshd_config lshw (in EPEL) 6 7
5 6 7 8 configured 5 6 7
SSH ~/.ssh/config Delete user userdel
ssh-keygen lshw 8 account gnome-control-center 8
Configure modprobe 5 6 7 8 usermod
kernel module
/etc/passwd
View/change 5 6 7
user account vipw
Networking Configure
details id
hardware udev 5 6 7 8
TASK RHEL device gnome-control-center 8

Configure nmcli con mod 7 8 View kernel groupadd 5 6 7


sysctl -a
5 6 7 8
Create user
name parameters cat /proc/cmdline group
resolution
/etc/hosts
5 6 7 8 gnome-control-center 8
/etc/resolv.conf
Load kernel Delete user groupdel 5 6 7
5 6 modprobe 5 6 7 8
/etc/sysconfig/network module group
Configure gnome-control-center 8
hostnamectl
hostname /etc/hostname 7 8 Remove modprobe -r 5 6 7 8 groupmod
nmtui kernel module Change group /etc/group
5 6 7
details
ifconfig 5 6
View kernel rpm -q kernel gnome-control-center 8
5 6 7 8
nmcli dev show version uname -r
View network teamdctl 7 8 Change user passwd 5 6 7
interface info bridge password gnome-control-center 8
ip addr
5 6 7 8
brctl usermod
Change user 5 6 7
visudo
nmcli con Resource management permissions
[add|mod|edit]
Configure 7 8 gnome-control-center 8
nmtui TASK RHEL
network nm-connection-editor
Change chage 5 6 7
interface
/etc/sysconfig/ Trace system password
5 6 7 8 strace 5 6 7 8
network-scripts/ifcfg-* calls policy gnome-control-center 8

View routes ip route 5 6 7 8 Trace library w 5 6 7


ltrace 5 6 7 8 View user
calls sessions
system-config-network 5 6 gnome-control-center 8

nmcli Change
nice
Configure nmtui 7 8 process renice 5 6 7 8
routes nm-connection-editor priority
ip route add
/etc/sysconfig/ 5 6 7 8 Change
route-iface process run taskset 5 6 7 8
location
iptables and ip6tables
5 6
/etc/sysconfig/ip*tables
kill
system-config-firewall 6
Kill a process pkill 5 6 7 8
Configure 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.

Vous aimerez peut-être aussi