A commandline utility that can be used to locate files and directories based on various criteria, such as name, type, size, modification date, etc.
Locates files with extensions commonly associated with Virtual Machines, such as .vmdk and .vmx within /vmfs/volumes folder path. This may be performed programmatically and additional switches can be used to exclude specific folders from the search.
find /vmfs/volumes/ -type f -name "*.vmdk"
- find "/vmfs/volumes/$volume/" -type f -name "*.vmdk" -o -name "*.vmx" -o -name "*.vmxf" -o -name "*.vmsd" -o -name "*.vmsn" -o -name "*.vswp" -o -name "*.vmss" -o -name "*.nvram" -o -name "*.vmem"
- find /vmfs/volumes/ -type f -not \( -path /sys -prune \) -not \( -path /proc -prune \)
-not \( -path /run -prune \) -not \( -path /var/log -prune \) -name "*.vmdk*" -o -name "*.ovf*" -o -name "*.ova*" -o -name "*.vmem*" -o -name "*.vswp*" -o -name "*.vmsd*" -o -name "*.vmsn*" -o -name "*.vib*" -o -name "*.vbk*" -o -name "*.vbm*"
Find and delete all files ending with .log extension
/bin/find / -name *.log -exec /bin/rm -rf {} \;
/bin/find / -name *.log -exec /bin/rm -rf {} \;
Find and replace the ESXi web console homepage.
find /usr/lib/vmware -type f -name index.html
- find /usr/lib/vmware -type f -name index.html
mv "$path_to_ui/index.html" "$path_to_ui/index1.html
cp "$CLEAN_DIR/index.html" "$path_to_ui/index.html"