Linux Cheat Sheet
Linux Cheat Sheet
pvcreate 5 6
Power off system poweroff
chkconfig name --list 5 6 7
Check if service is enabled Create physical volume
systemctl poweroff
systemctl is-enabled name 7 pvcreate
7 halt 5 6
ssm create (if backend is lvm)
chkconfig --add 5 6
Create new service file or Halt system halt
vgcreate 5 6 7
modify configuration systemctl daemon-reload systemctl halt
7
/etc/systemd/system/*.service Create volume group vgcreate
7 reboot 5 6
ssm create (if backend is lvm)
runlevel
5 6 Reboot system reboot
who -r lvcreate 5 6 7
View run level/target systemctl reboot
systemctl get-default
7 Create logical volume lvcreate
who -r 7 /etc/inittab 5 6
ssm create (if backend is lvm) Configure default run level/target
/etc/inittab systemctl set-default 7
5 6 vgextend
init run_level 5 6
lvextend /boot/grub/grub.conf 5 6
Change run level/target resize2fs
systemctl isolate name.target /etc/default/grub
7 Enlarge volumes formatted Configure GRUB bootloader
systemctl set-default vgextend grub2-mkconfig 7
with default file system
lvextend grub-set-default
/var/log 5 6 7
xfs_growfs
View logs /var/log ssm resize hwbrowser 5
7 View hardware configured
journalctl
resize2fs lshw (in EPEL) 6 7
add audit=1 to kernel cmdline lvreduce 5 6
Shrink volumes formatted vgreduce Configure kernel module modprobe 5 6 7
auditctl
/etc/audit/auditd.conf with default file system
XFS cannot currently be shrunk; copy Configure hardware device udev 5 6 7
Configure system audit /etc/audit/audit.rules 5 6 7 7
desired data to a smaller file system.
authconfig sysctl -a
View kernel parameters cat /proc/cmdline
5 6 7
/etc/pam.d/system-auth fsck 5 6
pam_tty_audit kernel module
Check/repair file system fsck Load kernel module modprobe 5 6 7
7
View audit output aureport /var/log/faillog 5 6 7 ssm check
Remove kernel module modprobe -r 5 6 7
cron /etc/exports
5 6
Schedule/batch tasks at 5 6 7 service nfs reload rpm -q kernel
Configure NFS share View kernel version uname -r
5 6 7
batch /etc/exports
7
5 6 7 systemctl reload nfs.service
Find file by name locate
/etc/fstab
Find file by characteristic find 5 6 7 Mount and activate swap swapon -a
5 6 7
showmount -e Copyright © 2017 Red Hat, Inc. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, and JBoss are
View NFS share mount 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.