Common administrative commands in Red Hat Enterprise Linux 5, 6, and 7
来源:互联网 发布:网络十大禁书百度云 编辑:程序博客网 时间:2024/05/16 08:40
官网转载:https://access.redhat.com/articles/1189123
Lists common administrative commands for Red Hat Enterprise Linux 5, 6 and 7. Printable poster also available.
System basics
subscription-manager identitysubscription-manager identityConfigure subscriptionrhn_register
subscription-manager 1rhn_register
rhnreg_ks
subscription-managersubscription-manager2
rhn_register 3View RHEL version information/etc/redhat-releaseView system profilesosreport
dmidecode
hwbrowsersosreport
dmidecode
lstopo
lscpu
Basic configuration
nmtui
nm-connection-editorConfigure system languagesystem-config-languagelocalectlConfigure time and datesystem-config-date
datetimedatectl
dateSynchronize time and datentpdate
/etc/ntp.conftimedatectl
/etc/chrony.conf
ntpdateConfigure keyboardsystem-config-keyboardlocalectlConfigure SSH/etc/ssh/ssh_config
/etc/ssh/sshd_config
~/.ssh/config ssh-keygen
Jobs and services
ls /etc/init.d/systemctl -at service
ls /etc/systemd/system/*.service
ls /usr/lib/systemd/system/*.serviceList running servicesservice --status-allsystemctl -t service --state=activeStart/stop serviceservice name start
service name stopsystemctl start name.service
systemctl stop name.serviceEnable/disable servicechkconfig name on
chkconfig name offsystemctl enable name.service
systemctl disable name.serviceView service statusservice name statussystemctl status name.serviceCheck if service is enabledchkconfig name --listsystemctl is-enabled nameCreate new service file or modify configurationchkconfig --addsystemctl daemon-reload
/etc/systemd/system/*.serviceView run level/targetrunlevel
who -rsystemctl get-default
who -rChange run level/target/etc/inittab
init run_levelsystemctl isolate name.target
systemctl set-defaultConfigure logging/etc/syslog.conf/etc/rsyslog.conf/etc/rsyslog.conf
/etc/rsyslog.d/*.conf
/var/log/journal
systemd-journald.serviceView logs/var/log/var/log
journalctlConfigure system auditadd audit=1 to kernel cmdline
auditctl
/etc/audit/auditd.conf
/etc/audit/audit.rules
authconfig
/etc/pam.d/system-auth
pam_tty_audit kernel moduleView audit outputaureport /var/log/faillogSchedule/batch taskscron
at
batchFind file by namelocateFind file by characteristicfindCreate archivetar
cpio
zip
Kernel, boot, and hardware
systemctl poweroffHalt systemhalthalt
systemctl haltReboot systemrebootreboot
systemctl rebootConfigure default run level/target/etc/inittabsystemctl set-defaultConfigure GRUB bootloader/boot/grub/grub.conf/etc/default/grub
grub2-mkconfig
grub-set-defaultConfigure kernel modulemodprobeView hardware configuredhwbrowserlshw (in EPEL)Configure hardware deviceudevView kernel parameterssysctl -a
cat /proc/cmdlineLoad kernel modulemodprobeRemove kernel modulemodprobe -rView kernel versionrpm -q kernel
uname -r
Software management
yum groupinstallyum install
yum group installView software infoyum info
yum groupinfoyum info
yum group infoUpdate softwareyum updateUpgrade softwareyum upgradeConfigure software repositorysubscription-manager repos
/etc/yum.repos.d/*.repoFind package owning filerpm -qf filename
yum provides filename-globView software versionrpm -q packagenameView installed softwarerpm -qa
yum list installed
User management
/etc/passwd
vipw
idCreate user groupgroupaddDelete user groupgroupdelChange group detailsgroupmod
/etc/groupChange user passwordpasswdChange user permissionsusermod
visudoChange group permissionsgroupmod
visudoChange password policychageView user sessionsw
File systems, volumes, and disks
partedfdisk
gdisk
parted
ssm createFormat disk partitionmkfs.filesystem_type (ext4, xfs)
mkswapmkfs.filesystem_type (ext4, xfs)
mkswap
ssm createDefragment disk spacecopy data to new file system
fsck (look for 'non-contiguous inodes')copy data to new file system
fsck (look for 'non-contiguous inodes')
xfs_fsrMount storagemount
/etc/fstabmount
/etc/fstab
ssm mountMount and activate swap/etc/fstab
swapon -aConfigure static mounts/etc/fstabView free disk spacedfView logical volume infolvdisplay
lvs
vgdisplay
vgs
pvdisplay
pvsCreate physical volumepvcreatepvcreate
ssm create (if backend is lvm)Create volume groupvgcreatevgcreate
ssm create (if backend is lvm)Create logical volumelvcreatelvcreate
ssm create (if backend is lvm)Enlarge volumes formatted with default file systemvgextend
lvextend
resize2fsvgextend
lvextend
xfs_growfs
ssm resizeShrink volumes formatted with default file systemresize2fs
lvreduce
vgreduceXFS cannot currently be shrunk; copy desired data to a smaller file system.Check/repair file systemfsckfsck
ssm checkView NFS shareshowmount -e
mountConfigure NFS share/etc/exports
service nfs reload/etc/exports
systemctl reload nfs.serviceConfigure on-demand auto-mounts/etc/auto.master.d/*.autofs
/etc/auto.*Change file permissionschmod
chown
chgrp
umask (future file creation)Change file attributeschattrChange access control listsetfacl
Networking
/etc/resolv.conf/etc/hosts
/etc/resolv.conf
nmcli con modConfigure hostname/etc/sysconfig/networkhostnamectl
/etc/hostname
nmtuiView network interface infoip addr
ifconfig
brctlip addr
nmcli dev show
teamdctl
brctl
bridgeConfigure network interface/etc/sysconfig/network-scripts/ifcfg-*/etc/sysconfig/network-scripts/ifcfg-*
nmcli con [add|mod|edit]
nmtui
nm-connection-editorView routesip routeConfigure routesip route add
system-config-network
/etc/sysconfig/route-ifaceip route add
nmcli
nmtui
nm-connection-editor
/etc/sysconfig/route-ifaceConfigure firewalliptables and ip6tables
/etc/sysconfig/ip*tablesiptables and ip6tables
/etc/sysconfig/ip*tables
system-config-firewallfirewall-cmd
firewall-configView ports/socketsss
lsof
netstatss
lsof
Security and identity
chcon
restorecon
semanage
setsebool
system-config-selinuxReport on system securitysealertLDAP, SSSD, Kerberosauthconfig
authconfig-tui
authconfig-gtkNetwork usersgetent
Resource management
reniceChange process run locationtasksetKill a processkill
pkill
killallView system usagetop
ps
sar
iostat
netstat
vmstat
mpstat
numastattop
ps
sar
iostat
netstat
ss
vmstat
mpstat
numastat
tunatop
ps
sar
iostat
ss
vmstat
mpstat
numastat
tunaView disk usagedfdf
iostat
Be aware of potential issues when using subscription-manager on Red Hat Enterprise Linux 5:https://access.redhat.com/solutions/129003.↩
subscription-manager is used for Satellite 6, Satellite 5.6 with SAM and newer, and Red Hat's CDN.↩
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:What's the difference between management services provided by Red Hat Network (RHN) Classic and Red Hat Customer Portal Subscription Management/RHSM?,Transition of Red Hat Network Classic Hosted to Red Hat Subscription Management, andSatellite 5.6 unable to register RHEL 7 client system due to rhn-setup package not included in Minimal installation↩
- Common administrative commands in Red Hat Enterprise Linux 5, 6, and 7
- Fedora 6 and Red Hat Enterprise Linux Bible
- Learning Red Hat Enterprise Linux and Fedora
- red hat enterprise linux
- Red Hat Enterprise Linux 5 系统中安装JDK1.6
- Red Hat Enterprise linux 6中文输入法
- red hat enterprise linux 6 改为中文
- Red Hat Enterprise Linux 6 系统安装
- Red Hat Enterprise Linux 7的新功能
- Red Hat Enterprise Linux 7(RHEL7)安装
- Red Hat Enterprise Linux 7 系统安装
- Red Hat Enterprise Linux 7 的安装
- Red Hat Enterprise Linux 5 正式发布
- Red Hat Enterprise Linux 5 序列号
- Red Hat Enterprise Linux 5 Administration Unleashed
- Red Hat Enterprise Linux 5 安装
- Red Hat Enterprise Linux 5基础教程
- Red Hat Enterprise Linux 5 安装手册
- java虚拟机的Stack和Heap
- angular js $http
- Python-RESTful API开发(二)
- gdb调试info threads只能显示一个进程问题
- 【Python django学习笔记】- django安装和启动
- Common administrative commands in Red Hat Enterprise Linux 5, 6, and 7
- jsonp 使用记录(二)跨域设置cookie
- MongoDB创建和删除自启动服务
- linux下如何自动生成Makefile文件
- java特种兵读书笔记(4-1)——java通信之概述
- googel软件测试之道——总结
- 一张图搞定Android学习路线,非常全面
- Springside4搭建自带例子
- Mysql断电mysql:Table 'xxxxx' is marked as crashed and should be repaired