cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Etc


Reference














.

os:linux:command:nkf.html



Linux Commands Cheat Sheet

Linux Commands:nkf

OPTIONS

           Specify input and output encodings. Upper case is input.
           -J  ISO-2022-JP (JIS code).

           -S  Shift_JIS and JIS X 0201 kana.  EUC-JP is recognized as X0201
               kana. Without -x flag, JIS X 0201 Katakana (a.k.a.halfwidth
               kana) is converted into JIS X 0208.  If you use Windows, see
               Windows-31J (CP932).

           -E  EUC-JP.

           -W  UTF-8N.


       -L[uwm] -d -c
           Convert line breaks.

           -Lu -d
               unix (LF)

           -Lw -c
               windows (CRLF)

           -Lm mac (CR)


Example

Check Character

$ nkf -g test.txt
UTF-8

Change CharacterFrom

To EUC, LF

# nkf -ed utf8.txt > euc-jp.txt

-Lu = -d



To UTF-8, LF

nkf  -w -Lu --overwrite test.txt



os/linux/command/nkf.html.txt ยท Last modified: 2017/05/14 by admin

Page Tools