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命令使用通配符.

  • 相关阅读:
    React在componentDidMount里面发送请求
    React 术语词汇表
    React里受控与非受控组件
    React和Vue等框架什么时候操作DOM
    【LeetCode】79. Word Search
    【LeetCode】91. Decode Ways
    【LeetCode】80. Remove Duplicates from Sorted Array II (2 solutions)
    【LeetCode】1. Two Sum
    【LeetCode】141. Linked List Cycle (2 solutions)
    【LeetCode】120. Triangle (3 solutions)
  • 原文地址:https://www.cnblogs.com/lfree/p/7889165.html
Copyright © 2011-2022 走看看