bash_oneliners
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| bash_oneliners [2020/06/10 15:26] – admin | bash_oneliners [2025/08/06 12:07] (current) – admin | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| * To find the largest file in all sub-directories: | * To find the largest file in all sub-directories: | ||
| < | < | ||
| - | find / | + | find . -type f -exec ls -s {} \; | sort -nr | awk 'NR==1 { $1=""; |
| </ | </ | ||
| * grep for valid IP Addresses. | * grep for valid IP Addresses. | ||
| Line 29: | Line 29: | ||
| < | < | ||
| free && sync && echo 3 > / | free && sync && echo 3 > / | ||
| + | </ | ||
| + | * rescan all SCSI buses | ||
| + | < | ||
| + | for i in / | ||
| + | </ | ||
| + | * enlarge LVM | ||
| + | < | ||
| + | fdisk /dev/sdk | ||
| + | #set partition type to Linux LVM (type 8e) | ||
| + | pvcreate /dev/sdk1 | ||
| + | vgextend VolGroupDB /dev/sdk1 | ||
| + | lvextend -l +100%FREE / | ||
| + | resize2fs -p / | ||
| + | #for xfs use xfs_growfs / | ||
| + | parted -a optimal /dev/sdc mklabel gpt | ||
| + | parted -a optimal /dev/sdc mkpart p 0% 100% | ||
| + | parted -a optimal /dev/sdc set 1 lvm on | ||
| + | vgextend VGEXL /dev/sdf1 | ||
| + | lvresize -l +100%free / | ||
| + | </ | ||
| + | * Enlarge LVM 2 | ||
| + | < | ||
| + | echo ' | ||
| + | yum install cloud-utils-growpart | ||
| + | growpart | ||
| + | pvresize /dev/sdd1 | ||
| + | lvextend -l +100%FREE / | ||
| + | xfs_growfs / | ||
| + | </ | ||
| + | |||
| + | * polkit logging for debugging | ||
| + | < | ||
| + | |||
| + | cat / | ||
| + | |||
| + | polkit.addRule(function(action, | ||
| + | polkit.log(" | ||
| + | polkit.log(" | ||
| + | |||
| + | if (action.id.startsWith(" | ||
| + | action.id == " | ||
| + | action.id == " | ||
| + | action.id == " | ||
| + | action.id == " | ||
| + | action.id == " | ||
| + | polkit.log(" | ||
| + | return polkit.Result.YES; | ||
| + | } | ||
| + | |||
| + | polkit.log(" | ||
| + | }); | ||
| </ | </ | ||
bash_oneliners.1591802788.txt.gz · Last modified: by admin
