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
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 # 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
getent group # check if user is in group
networking:
ip r
sudo nmtui
systemctl status -l NetworkManager
ifdown
ifup # do this and the previous command to reload config
navigation:
tree
ln -s
unlink # like rm, but won't remove the
generate password hash:
yum install dovecot
doveadm pw -s sha512-crypt -p # ignore output in curly brackets {}
yum package + dependencies offline install for CentOS 6:
yum install --downloadonly --installroot= --releasever=<6> --downloaddir=
createrepo --database
rm -rf
vi /etc/yum.repos.d/offline.repo
```
[offline]
name=Offline repo
baseurl=file://
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
communication to other users on the machine:
wall
write
# if write contains $() or other characters:
cat << 'EOF' | write
EOF