Was looking through some old documents ( From 2007! ) and I ran across a neat command that I had forgotten about. This command searches through your bash shell history for the most commonly used commands and prints them out in order with the count next to it. history | cut -b8- | sort |
Quick and easy way to show the current Git branch on your command prompt
If you work with lots of branches in Git it is nice to be able to see at a glance which branch you are on instead of typing git branch each time. Here are 4 quick lines you can add to your bash prompt that will show the current branch. You will need to edit
Add or Update your vSphere or ESXi license key through the terminal
If you are like me and you forgot to input your vSphere or ESXi license key before it expired not to fear! It is possible to update the license key through the terminal. The license is stored in a plain text file at /etc/vmware/vmware.lic. To edit it from the terminal type in: vi /etc/vmware/vmware.lic Erase
Count lines of code in files recursively
If you are attempting to find a count of the total lines of code in files in a directory recursively from Linux or Mac OS X the following command will do what you want. This particular command prints out all lines contained in any file with a .php extension, then counts the number of lines
Bash: Recursively adding an extension to all files without extensions
While attempting to import an existing website to WordPress I noticed that the local copy of the website I had created with wget –mirror did not have any file extensions. This makes sense because the URL did not have an extension in it. The HTML import tool requires and extension however. The following command will