check OS and software version: cat /etc/centos-release get linux hardware info: lscpu free -h lsblk lspci # find GPU dmidecode # find model get systemd info: systemctl status <unit> get userinfo: w who whoami hostname finger getent groups getent passwd read logs: journalctl -xe get disk usage: du -sch # for current folder du -sch .[!.]* # for dotfiles in current folder check mounts: lsblk df -h less /etc/fstab mount ls /etc/systemd/system | grep mount # check automounts; only on CentOS 7 ls </path/to/folder> # empty? maybe no mounts in ls /sys/block # good during kickstarting ls /sys/fs # arcane; settings + info ls /dev # is what lsblk does?? user and group info: getent passwd <user> getent group <group> # check if user is in group networking: ip r sudo nmtui systemctl status -l NetworkManager ifdown <iface> ifup <iface> # do this and the previous command to reload config navigation: tree ln -s <target> <linkname> unlink <linkname> # like rm, but won't remove the <target> generate password hash: yum install dovecot doveadm pw -s sha512-crypt -p <password> # ignore output in curly brackets {} yum package + dependencies offline install for CentOS 6: yum install --downloadonly --installroot=</installroot> --releasever=<6> --downloaddir=</downloaddir> <package> createrepo --database </downloaddir> rm -rf </installroot> vi /etc/yum.repos.d/offline.repo ``` [offline] name=Offline repo baseurl=file://</downloaddir> enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 ``` repoclosure --repoid=offline # to check deps yum --disablerepo=\* --enablerepo=offline install <package> communication to other users on the machine: wall write # if write contains $() or other characters: cat << 'EOF' | write <user> <string> EOF