Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1.27 KB

script.md

File metadata and controls

31 lines (23 loc) · 1.27 KB

find Linux binary files

find . -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print

delete Linux binary files

find . -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print | xargs rm -f

find Mac binary files

find . -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-mach-binary; charset=binary'" \; -print

delete Mac binary files

find . -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-mach-binary; charset=binary'" \; -print | xargs rm -f

find windows executables

find . -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-dosexec; charset=binary'" \; -print

delete windows executables

find . -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-dosexec; charset=binary'" \; -print | xargs rm -f

delete others

for f in $(find ./ -name '*.log' -or -name '*.doc'); do rm $f; done

find some* process port

sudo lsof -i -P -n | grep some

resize linux /dev/sda

VBoxManage modifyhd /path/to/your/virtualdisk.vdi --resize SIZE_IN_MB (if expand vdi in virtualbox)
apt install parted
lsblk
parted /dev/sda resizepart 1 100%
resize2fs /dev/sda1 (resize2fs for ext4, xfs_growfs for XFS)
reboot