iconv
text processingLinux/Unix
The iconv command is one of the most frequently used commands in Linux/Unix-like operating systems. iconv Convert text from one character encoding to another
Quick Reference
Command Name:
iconv
Category:
text processing
Platform:
Linux/Unix
Basic Usage:
iconv [options] [arguments]
Common Use Cases
Syntax
iconv [options] [-f from-encoding] [-t to-encoding] [input-file]...
Options
Option | Description |
---|---|
-f, --from-code=NAME |
Encoding of original text |
-t, --to-code=NAME |
Encoding for output |
-l, --list |
List all known coded character sets |
-c |
Omit invalid characters from output |
-o, --output=FILE |
Output file |
-s, --silent |
Suppress warnings |
--verbose |
Print progress information |
-?, --help |
Give this help list |
--usage |
Give a short usage message |
--version |
Print program version |
Examples
How to Use These Examples
The examples below show common ways to use the iconv
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
iconv -f ISO-8859-1 -t UTF-8 input.txt