merge two files together

  1. in vim test : :read file.name
  2. just run cat file.1 file.2 > file.merge or cat file.* > file.merge

Sed

  1. remove all spaces behind the lines %s/\s\+$//g
  2. remove line with charactor you wont like g/somestring/, d

Encoding

  1. Show file encoding file $file or in vim :set fileencoding
  2. If you only want to see all kinds of encoding files, just edit ~/.vimrc set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936
  3. Change encoding :set fileencoding=utf-8
  4. Other ways to change encoding : lconv convmv

Delete BOM

  1. remove UTF-8 BOM :set nobomb
  2. keep UTF-8 BOM :set bomb

About how to search special characters

  1. Referencd : http://vimcdoc.sourceforge.net/doc/digraph.html

Reference : http://www.cnblogs.com/processakai/archive/2012/07/25/2608713.html