merge two files together in vim test : :read file.name just run cat file.1 file.2 > file.merge or cat file.* > file.merge Sed remove all spaces behind the lines %s/\s\+$//g remove line with charactor you wont like g/somestring/, d Encoding Show file encoding file $file or in vim :set fileencoding If you only want to see all kinds of encoding files, just edit ~/.vimrc set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936 Change encoding :set fileencoding=utf-8 Other ways to change encoding : lconv convmv Delete BOM remove UTF-8 BOM :set nobomb keep UTF-8 BOM :set bomb About how to search special characters Referencd : http://vimcdoc.