Archive for April, 2013

Ubuntu : Usefull tips and tricks

Posted: April 27, 2013 in linux, ubuntu
Tags: , ,
  • Disable / enable Ubuntu desktop display manager
<br />service lightdm stop<br />

In order to enable the display manager again, log in via terminal by pressing Ctr + Alt + F1 and execute,

<br />service lightdm start<br />
  • Set maximum number of files open
<br />* soft nofile 65000<br />* hard nofile 65000<br />

Add the above lines to the file /etc/security/limits.conf

  • Show capacity of the current folder
<br />du -h<br />
  • Search only in specified file extension
<br />grep -r --include=*.java "import" *<br />

This will recursively search for the word 'import' only in files which has the extension java.

  • Search for a word
/search_word
  • Search ignore case
/\csearch_word
  • Incremental search

With incremental search you can view the matches as you type, no need to type the whole word.

:set incsearch
  • Highlight search matching word.
:set hlsearch
  • Smartcase

Search case sensitively if caps letters are in search pattern.

:set ignorecase smartcase
  • Type “*”  to search for the word under the cursor
  • Search for whole word
\<search_term\>

Here “/<” represents the start of the word and “\>” represents the end of the word