zoukankan      html  css  js  c++  java
  • [20171124]xxd与通配符.txt

    [20171124]xxd与通配符.txt

    --//linux 上许多命令都支持通配符,比如
    $ ls -l *.txt
    -rw-r--r-- 1 oracle oinstall 44801024 2017-11-24 09:16:38 c01.txt
    -rw-r--r-- 1 oracle oinstall 44801024 2017-11-24 09:16:43 c02.txt
    -rw-r--r-- 1 oracle oinstall    60168 2017-11-24 09:18:02 c03.txt
    --//显示后缀为txt的文件.

    $ md5sum control0*
    12e501eabc3bd85f922a7df9b5d21282  control01.ctl
    115df6fe8408aba742e63b12ce369299  control02.ctl
    --//文件名开头control0的md5.

    --//但是今天在使用xxd时我犯了一个错误.
    xxd -c 16 -g 4 /mnt/ramdisk/book/control0[12].ctl | grep '01404010'

    --//检查发现/mnt/ramdisk/book/control02.ctl文件破坏了.看看前面的md5sum输出就明白了.

    $ file control0*
    control01.ctl: data
    control02.ctl: ISO-8859 text

    --//如果你看xxd的man文档就明白了:
    XXD(1)                                                                  XXD(1)

    NAME
           xxd - make a hexdump or do the reverse.

    SYNOPSIS
           xxd -h[elp]
           xxd [options] [infile [outfile]]
           xxd -r[evert] [options] [infile [outfile]]
    --//输入文件在前,输出文件在后.这样control02.ctl就变成了输出文件.

    SYS@book> shutdown immediate ;
    ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
    ORA-00202: control file: '/mnt/ramdisk/book/control02.ctl'
    --//可以发现控制文件损坏了.只能shutdown abort关机.

    --//看来以后工作要注意..^_^.
    --//以后切记xxd命令使用通配符.

  • 相关阅读:
    linux的一般命令------附加
    linux(4)----------ssh config详解
    linux(3)--------SSH工具的安装使用
    linux(2)-----新装linux配置
    linux(1)------vmvear虚拟机安装linux
    (3)hadoop单节点配置
    (2)hadoop之-----配置免密码登录
    (1)hadoop之----linux配置jdk环境
    BZOJ 1037 生日聚会(神DP)
    BZOJ 1046 上升序列(LIS变形)
  • 原文地址:https://www.cnblogs.com/lfree/p/7889165.html
Copyright © 2011-2022 走看看