如何恢復使用mostly刪除的文件

如何恢復使用mostly刪除的文件

我在錯誤的資料夾中並刪除了一系列非常重要的 python 檔案!我如何配置最重要的規則來恢復它們?並使用 Debian 作業系統

/etc/foremost.conf

 CONFIGURATION FILE
              The configuration file is used to control what types  of
              files  foremost  searches  for.  A  sample configuration
              file, foremost.conf, is included with this distribution.
              For each file type, the configuration file describes the
              file’s extension, whether the header and footer are case
              sensitive,  the  maximum  file  size, and the header and
              footer for the file. The footer field is  optional,  but
              header, size, case sensitivity, and extension are not!

              Any  line  that begins with a pound sign is considered a
              comment and ignored. Thus, to skip a file type just  put
              a pound sign at the beginning of that line

              Headers and footers are decoded before use. To specify a
              value in hexadecimal use \x[0-f][0-f], and for octal use
              \[1-9][1-9][1-9].   Spaces  can  be  represented  by \s.
              Example: "\x4F\123\I\sCCI" decodes to "OSI CCI".

              To match any single character (aka a wildcard) use a  ?.
              If you need to search for the ? character, you will need
              to change the wildcard line *and*  every  occurrence  of
              the old wildcard character in the configuration file. Do
              not forget those h

但檔案.pypython 和.jsjavascript

答案1

最重要的是僅處理特定文件,例如圖像和影片。

Foremost 開箱即用,無法恢復 Python 或 Javascript 檔案。1,2

但是,您可以讓它發現其他文件類型,如下所述在這篇文章中

例如,透過建立foremost.conf包含下列製表符分隔條目的檔案:

py  y   100000     #!/usr/bin/env\spython3

您可以搜尋後綴為py、區分大小寫 ( y) 的 Python 文件,在標頭中查找最多 100000 字節,並蒐索 shebang 行。

相關內容