[LINUX] nkf command

nkf command

I wanted to convert a file written in UTF-8 character code to SHIFT-JIS, but I don't know how to do it. As a result of checking, it was said that the nkf command should be used, so I will summarize how to use it here

nkf command

Abbreviation for Network Kanji Filter Command to convert character code and line feed code

Basic format

$ nkf[option][File]
$ nkf[option]--overwrite file


option Right align
-g Output the character code of the file you want to convert
-j Output JIS code
-s Output shift JIS code
-w16 Output UTF code
--overwrite Convert and overwrite files


Check the character code of the file

$ nkf -w --overwrite hoge.html

Character code conversion to Shift-JIS

nkf -s --overwrite hoge.html

It's easy, but I've summarized it. That's all for today.

Recommended Posts

nkf command
Linux command # 4
Linux command # 3
Command memorandum
command prompt
vim command
sed command
Linux command # 5
grep command
command memo
top command
Command memorandum
Command memo
mv command
seq command
linux at command
[Linux] Search command
Linux command <Basic 2>
First command plugin
pip command collection
scp command memo
nc command memorandum
Linux [directory command]
who command memo
Linux server command
Linux # Command Memo 1
Linux command [read]
Linux Command Summary
[Basic] linux command
Linux [shell command]
Convenient command combination
[Linux] Command / Knowledge
IPF command information
My linux command
Future nl command
Memorandum conda command
Linux command <Basic 1>
ps command "wchan"
setuptools command memorandum
Django + Docker command
Broken pip command
Linux command collection
Linux mkdir command
Linux command basics
[Linux] Git command
Docker command summary
Linux (command memory)
DNS dig command