Linux sysadmin scratchpad

linux essentials
tux academy
logon to system – check user, check bash, check groups
$ whoami # shows current user
$ pwd # shows current directory
$ getent passwd # prints content of the /etc/passwd file
$ passwd # changes current users password
$ members sudo # lists all members of group sudo
$ members root # lists all members of group root
check hdd/ssd setup and disk utilization
$ lsblk # lists all block devices in tree diagramm
$ fdisk -l # lists all disk/volumes with additional information
$ lshw -c disk # list all hardware in the disk class
$ df -h # shows disk utilization in human readable format
check raid

$ cat /proc/mdstat # displays the content of the mdstat file, shows state of  all mds
$ mdadm -D /dev/md0 # shows the current state of a md device in detail  (multiple devices admin -Detail)

Analyzing a Faulty Hard Disk using Smartctl
check SMART
$ smartctl -a /dev/sda # displays all smart info for sda

$ top # gives an overview of system resources and current running processes
$ free -h -t # human readable display of ram utilization and swap disk
network adapter check n manipulation
$ ip a # lists information about current network adapters
$ ifconfig # old command to do the same