Common commands for Linux File Operations VI interesting commands: 1 replace www.2cto.com s -- substitue replace command Replace the current line with the first cici titi command: s/cici/titi command to replace all the cici in the current line with titi: the command to replace s/cici/titi/g with titi from line n to line 1 and line 1 in each line: n, $ s/cici/titi replace all the cici in the n to the last line with the titi command: n, $ s/cici/titi/g the command to replace the first cici in each row with titi from the current row to the last row :., when replacing $ s/cici/titi, you must confirm that the command is followed by the letter c (meaning configuration ): the mingl [root @ localhost doc] # grep-o CREATE cici -. SQL | wc-l 223 View File Encoding Method of command file filename.txt: UTF-8 Unicode text 4 using the iconv command for encoding conversion file content encoding conversion iconv-f UTF-8-t gb2312 aaa.txt> bbb.txt character file. ========================================================== ====================================== The iconv command is used to convert the encoding of the specified file, the output file is output to the standard output device by default. You can also specify the output file. Usage: iconv [option...] [file...] input/output format specifications:-f, -- from-code = Name original text encoding-t, -- to-code = Name output encoding information:-l, -- list lists all known character set output control:-c ignores invalid characters-o from the output, -- output = FILE output FILE-s, -- silent close warning -- verbose prints progress information -?, -- Help provides the system's help list -- usage provides brief usage information