用iconv命令处理文本文件中文乱码问题 ICONV HPUNIX

iconv命令可以将一种已知的字符集文件转换成另一种已知的字符集文件。

iconv -f eucJP -t sjis  输入文件 > 输出文件

  输入/输出格式规范:
  -f, –from-code=NAME 原始文本编码
  -t, –to-code=NAME 输出编码

文字コード(日本語漢字コード表)

 

以下说明来源于 HP-UX   B.11.31 U ia64

NAME
      iconv – codeset conversion

SYNOPSIS
      iconv [-cs] -f frommap -t tomap [file]…
      iconv [-cs] -f fromcode [-t tocode] [file]…
      iconv [-cs] -t tocode [-f fromcode] [file]…
      iconv -l

DESCRIPTION
      The iconv command converts the encoding of characters in the input
      files from one codeset to another, and writes the results to standard
      output.  If no input files are given, iconv reads from standard input.
      If – appears as an input file name, the iconv command reads standard
      input at that point.  — can be used to delimit the end of options
      (see getopt(3C)).

    Options
      The iconv command recognizes the following options:

-c             Omit any characters that are invalid in the
               codeset of the input file from the output.  This

继续阅读“用iconv命令处理文本文件中文乱码问题 ICONV HPUNIX”

cat命令和EOF标识输出多行文件

CAT  显示或者把多个文本文件连接起来。cat是concatenate的简写,类似于dos下面的type命令。

EOF只是标识,不是固定的 

The - option to mark a here document limit string (<<-LimitString) suppresses tabs (but not spaces) in the output. This may be useful in making a script more readable.

参照:Here Documents

http://www.faqs.org/docs/abs/HTML/here-docs.html

This type of redirection instructs the shell to read input from the current source until a line containing only delimiter (with no trailing blanks) is seen. All of the lines read up to that point are then used as the standard input for a command.
The format of here-documents is:

<<[-]word
here-document
delimiter

继续阅读“cat命令和EOF标识输出多行文件”

查看Hpunix cpu信息

1.查看cpu数

machinfo

sar -M 1 1|awk ‘END {print NR-5}’

ioscan -fnk |grep processor |wc –l

ioscan -fnC processor

 

2.查看内存

dmesg | grep -i physical

tar gzip

tar zxvf XXXX.tar.gz
tar jxvf XXXX tar.bz2

tar

1.将当前目录下所有.txt文件打包并压缩归档到文件this.tar.gz,我们可以使用

tar czvf this.tar.gz ./*.txt

2.将当前目录下的this.tar.gz中的文件解压到当前目录我们可以使用

tar xzvf this.tar.gz -C ./

gzip

例1:把/home目录下的每个文件压缩成.gz文件。
$ cd /home
$ gzip *

例2:把例1中每个压缩的文件解压,并列出详细的信息。
$ gzip -dv *

例3:详细显示例1中每个压缩的文件的信息,并不解压。
$ gzip -l *

例4:压缩一个tar备份文件,如usr.tar,此时压缩文件的扩展名为.tar.gz
$ gzip usr.tar

继续阅读“tar gzip”

Linux/Unix数字权限表示法

数值                     权限                                   目录列表

0            不能读,不能写,不能执行              —

1            不能读,不能写,可执行                  –x

2            不能读,可写,不能执行                  -w-

3            不能读,可写,可执行                     -wx

4            可读,不能写,不能执行                  r–

5            可读,不能写,可执行                     r-x

6            可读,可写,不能执行                     rw-

7            可读,可写,可执行                         rwx