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

  • 相关阅读:
    os 模块
    time-时间模块
    hashlibloggingconfigparser
    模块-json,pickle
    转载:执行脚本出现bin/bash: bad interpreter: No such file or directory
    转载:如何查看用户当前shell和修改用户登陆时的默认shell
    转载:对#!/bin/sh的认识
    转载:mysql-Auto_increment值修改
    转载:Tomcat多数据源配置方法
    转载:struts2和spring的结合原理(精品)
  • 原文地址:https://www.cnblogs.com/lfree/p/7889165.html
Copyright © 2011-2022 走看看