恢复rm删除的文件
利用foremost工具
apt install foremost
Recover files from a disk image based on file types specified by the user using the -t switch.
all Run all pre-defined extraction methods. [Default if no -t is
specified] 若不加-t会恢复所有
EXAMPLES
Search for jpeg format skipping the first 100 blocks
foremost -s 100 -t jpg -i image.dd
Only generate an audit file, and print to the screen (verbose mode)
foremost -av image.dd
Search all defined types
foremost -t all -i image.dd
Search for gif and pdf's
foremost -t gif,pdf -i image.dd
Search for office documents and jpeg files in a Unix file system in
verbose mode.
foremost -vd -t ole,jpeg -i image.dd
Run the default case
foremost image.dd
foremost -t jpg -i /dev/sdb3 -o /data
删除了/dev/sdb3中的jpg,现在恢复到/data下,请注意/data要求为空
新产生的恢复文件会重命名,audit.txt会有详细的恢复信息
在Linux shell中不显示路径了,显示为-bash-4.1~用起来很不方便。
如何改为显示路径的shell呢?
步骤如下:
# vim ~/.bash_profile
(不用管.bash_profile这个文件有几个,自己新建一个也是可以的)
在最后加上
export PS1='[u@h W]$’
然后执行
# source ~/.bash_profile
这样shell就可以显示路径了。