Basics Flashcards
View Specific Disk Partition
fdisk -l /dev/sda
View all Disk Partitions
fdisk -l
Find Out Top File Sizes
find -type f -exec du -Sh {} + | sort -rh | head -n 5
Disk space usage: Exclude Certain File System Type
df -x ext3
Disk space usage: Display Certain File System Type
df -t xfs
Display File System Inodes
df -i
File space usage: grand total for each argument
du -ch
File space usage: summary of a grand total disk usage size
du -sh
File space usage: displays the number of disk blocks
du
list running services
systemctl list-units --type=service --state=running
rpm package manager
query all packages
rpm -qa
kernel parameters
sysctl -a
display the largest folders/files including the sub-directories
du -Sh | sort -rh | head -5
how to handle this:
> $ sudo echo ‘127.0.0.1 bob’»_space; /etc/hosts
zsh: permission denied: /etc/hosts
> $ echo ‘127.0.0.1 bob’ | sudo tee -a /etc/hosts
[sudo] password for gludwig:
127.0.0.1 bob
all Available fdisk Commands
fdisk /dev/sda
rsync: Count files recursively through directories
rsync –stats –dry-run -ax /etc /test
rsync –stats –dry-run -ax .
all File System Disk Space Usage
df -a
compile options
cat /boot/config-$(uname -r)
loaded kernel modules
lsmod
is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded.
generate password having length 64
mkpasswd -l 64
Find Top 15 Processes by Memory Usage
top -b -o +%MEM | head -n 22
cat | cut
cat report.csv |cut -f 5-11,13- -d’,’ > cleanreport.csv
cat | sudo tee
cat
> new_file
> new_file
text text
^C