Finding files in Linux?

Find all .txt files with find: find / -name \\\*\.txt Find all files with pattern: find /path/to/files -type f -exec grep "pattern" {} /dev/null \\; Finding Files Less than 5MB… find / -name '\*' -size -5000k Finding Files Greater than 1 GB… find / -size +1000000k Finding Files modified in the last 10 Minutes… find / -amin -10 -name '\*' Finding Files modified in the last 10 hours… find / -atime -2 -name '*' Finding Files excluding the Mounted filesystems…...

October 25, 2013 · 1 min · Jahnin Rajamoni

Multiple ways to list directories in Linux

ls -ld */ find * -prune -type d -exec ls -ld {} \; ls -l |grep ^d ls -al -d \* | egrep "^d" ls -p | grep "/" tree -d -L 1 find . -type d find . -type d -exec ls -d {} \; ls -d .*"/" *"/"

October 25, 2013 · 1 min · Jahnin Rajamoni

Customizing the logon screens in ESXi

In order to post a message before the user logs in, edit the /etc/issue file and insert your custom text! To post a message after login, edit the message of the day file, i.e. /etc/motd and insert your custom text! To output custom text on the DCUI, from the vSphere Client, navigate to: Host -> Configuration -> Software -> Advanced Settings -> Annotations ->Add text to Annotations.WelcomeMessage

October 10, 2012 · 1 min · Jahnin Rajamoni

Removing parameters from multiple VMX files

Had a customer who wanted to remove parameters from multiple VMX files. The parameters were added in by vShield and we were unable to power on the VM Wrote the following script to search and remove the parameter for all the VMs registered on each ESXi host: vmlist=`hostname`.vmlist grep -i vmx /etc/vmware/hostd/vmInventory.xml | sed 's///g' | sed 's/<\/vmxCfgPath>//g' > $vmlist for i in `cat $vmlist` do echo " " echo Filename:$i echo Backing up VMX....

April 5, 2012 · 1 min · Jahnin Rajamoni

Adding the same annotations to multiple vmx files?

Here is a script you can run on the ESXi host to add an annotation into multiple vmx files: SAVEIFS=$IFS IFS=$(echo -en "\\n\\b") for i in \`find /vmfs/volumes/ -name \*.vmx\` do echo Filename:$i echo Backing up VMX... cp $i $i.bak echo Backup complete... echo adding the annotation: echo "annotation = \\"<Fill the annotation text here without the angle braces>\\"" >> $i echo Update done... read -p "Hit any key to continue....

October 18, 2011 · 1 min · Jahnin Rajamoni