# for uid and gid info for user: id # for system information uname # e.g. uname -a for all items ====== Hardware Detection ====== dmidecode # cli hardware probe lspci # lsusb # ====== Disk Utilities ============ blkid # extremely useful # Lists UIID, LABEL, SEC_TYPE, TYPE, PARTUUID lsblk # -b option shows partition sizes in bytes; default is human-readable lsblk -f # -f option requires lsblk to be run as root; size not included # gives tree view of disks -> partitions lsscsi # not installed by default # identifies known attached disk devices fdisk -l # needs to be run as root # partition/filesystem info - size listed only in blocks ================================== # console editor other than nano mcedit # this forces midnight commander to open in editor mode # uptime daemon: package 'uptimed' (on ubuntu) uprecords # displays the data accumulated by uptimed # find # EXTREMELY IMPORTANT: -exec and -execdir require {} and ; to be escaped # find files with any permission bit set; r=4, w=2, x=1 find . -type f -perm /111 -print # print name, including path, one per line find . -type f -perm /111 -print0 # print name, including path, null-delimited find . -type f -perm /111 -printf '%f\n' # print basenames, one per line find . -type f -perm /111 -printf '%f\0' # print basenames, null-delimited # execdir requires basenames # the following successfully removed execute permissions from files: find . -type f -perm /111 -printf '%f\n' -execdir /bin/chmod a-x '{}' \; # the following found files readable by 'other' users: find . -type f -perm -o+r -printf '%f\n' # the following removed read permission from 'other' users: find . -type f -perm -o+r -printf '%f\n' -execdir /bin/chmod o-r '{}' \; # the following found directories readable by 'other' users: find . -type d -perm -o+r -printf '%f\n' # the following removed read permission by 'other' users from directories: find . -type d -perm -o+r -printf '%f\n' -execdir /bin/chmod o-r '{}' \; # the following found directories executable by (and hence visible to) 'other' users: find . -type d -perm -o+x -printf '%f\n' # the following removed execute permission by 'other' users from directories: find . -type d -perm -o+x -printf '%f\n' -execdir /bin/chmod o-x '{}' \; # ACL setfacl -R -m d:o:0 OnTopic/ # remove all rights from 'others' setfacl -bR OnTopic/ # remove all existing ACLs setfacl -bR Personal/ # remove all existing ACLs setfacl -R -m d:g::rwX OnTopic/ # set correct group effective rights setfacl -R -m d:g::rwX Personal/ # set correct group effective rights