2024年11月在Linux上如何使用ext3grep恢复文件

发布时间:

  ⑴Linux系统操作中,有时会不小心删除重要文件,而能够恢复删除文件的软件有很多,extgrep就是其中的一种,extgrep在使用中需要用到不少命令,下面小编就给大家介绍下Linux使用extgrep的方法。

  ⑵目前的最新版本是:extgrep-...tar.gz

  ⑶我系统的环境是:虚拟机

  ⑷[rootlocalhost bin]# uname -a

  ⑸Linux localhost.localdomain ..-.el # SMP Tue Aug :: EDT i i i GNU/Linux

  ⑹[rootlocalhost bin]# cat /etc/issue

  ⑺Red Hat Enterprise Linux Server release . (Tikanga

  ⑻tar zxvf extgrep-...tar.gz

  ⑼cd extgrep-..

  ⑽。/configure --prefix=/usr/local/extgrep

  ⑾make install

  ⑿然后进入么安装目录看一下,只有一个bin

  ⒀[rootlocalhost extgrep]# pwd

  ⒁/usr/local/extgrep

  ⒂[rootlocalhost extgrep]# ls

  ⒃进到bin里面看一下

  ⒄[rootlocalhost extgrep]# cd bin

  ⒅[rootlocalhost bin]# ls

  ⒆我们可以看一下帮助,下面是部分

  ⒇[rootlocalhost bin]# 。/extgrep -h

  ⒈Running extgrep version ..

  ⒉。/extgrep: invalid option -- h

  ⒊No action specified; implying --superblock.

  ⒋Usage: 。/extgrep [options] [--] device-file

  ⒌Options:

  ⒍--version, -[vV] Print version and exit suessfully.

  ⒎--help, Print this help and exit suessfully.

  ⒏--superblock Print contents of superblock in addition to the rest.

  ⒐If no action is specified then this option is implied.

  ⒑--print Print content of block or inode, if any.

  ⒒--ls Print directories with only one line per entry.

  ⒓This option is often needed to turn on filtering.

  ⒔--aept filen Aept ‘filen’ as a legal filename. Can be used multi-

  ⒕ple times. If you change any --aept you must remove

  ⒖BOTH stage* files!

  ⒗--aept-all Simply aept everything as filename.

  ⒘--journal Show content of journal.

  ⒙--show-path-inodes Show the inode of each directory ponent in paths.

  ⒚Filters:

  ⒛--group grp Only process group ‘grp’。

  ①--directory Only process directory inodes.

  ②--after dtime Only entries deleted on or after ‘dtime’。

  ③--before dtime Only entries deleted before ‘dtime’。

  ④--deleted Only show/process deleted entries.

  ⑤--allocated Only show/process allocated inodes/blocks.

  ⑥--unallocated Only show/process unallocated inodes/blocks.

  ⑦--reallocated Do not suppress entries with reallocated inodes.

  ⑧Inodes are considered ‘reallocated’ if the entry

  ⑨is deleted but the inode is allocated, but also when

  ⑩the file type in the dir entry and the inode are

  Ⅰdifferent.

  Ⅱ--zeroed-inodes Do not suppress entries with zeroed inodes. Linked

  Ⅲentries are always shown, regardless of this option.

  Ⅳ--depth depth Process directories recursively up till a depth

  Ⅴof ‘depth’。

  ⅥActions:

  Ⅶ--inode-to-block ino Print the block that contains inode ‘ino’。

  Ⅷ--inode ino Show info on inode ‘ino’。

  ⅨIf --ls is used and the inode is a directory, then

  Ⅹthe filters apply to the entries of the directory.

  ㈠If you do not use --ls then --print is implied.

  ㈡--block blk Show info on block ‘blk’。

  ㈢If --ls is used and the block is the first block

  ㈣of a directory, then the filters apply to entries

  ㈤of the directory.

  ㈥If you do not use --ls then --print is implied.

  ㈦--histogram=[atime|ctime|mtime|dtime|group]

  ㈧Generate a histogram based on the given specs.

  ㈨Using atime, ctime or mtime will change the

  ㈩meaning of --after and --before to those times.

  --journal-block jblk Show info on journal block ‘jblk’。

  --journal-transaction seq

  Show info on transaction with sequence number ‘seq’。

  --dump-names Write the path of files to stdout.

  This implies --ls but suppresses it‘s output.

  --search-start str Find blocks that start with the fixed string ’str‘。

  --search str Find blocks that contain the fixed string ’str‘。

  --search-inode blk Find inodes that refer to block ’blk‘。

  --search-zeroed-inodes Return allocated inode table entries that are zeroed.

  --inode-dirblock-table dir

  Print a table for directory path ’dir‘ of directory

  block numbers found and the inodes used for each file.