删除后重建主目录

删除后重建主目录

事情是这样的:

root@rasp:~# ls -al
total 72
drwx------  8 root root 4096 Jan 22 21:01 .
drwxr-xr-x 25 root root 4096 Sep 11 14:27 ..
-rw-------  1 root root 8079 Jan 22 19:55 .bash_history
-rw-r--r--  1 root root  570 Jan 31  2010 .bashrc
drwx------  3 root root 4096 Jul 31 16:28 .config
drwxr-xr-x  2 root root 4096 Jan 21 15:18 misc
-rw-r--r--  1 root root  140 Nov 19  2007 .profile
-rw-r--r--  1 root root  204 Jan 22 21:01 psk-01.cap
-rw-r--r--  1 root root  236 Jan 22 21:01 psk-01.csv
-rw-r--r--  1 root root  325 Jan 22 21:01 psk-01.kismet.csv
-rw-r--r--  1 root root  227 Jan 22 21:01 psk-01.kismet.netxml
-rw-------  1 root root 1024 Jul 29 13:26 .rnd
drwxr-xr-x  5 root root 4096 Jan 19 15:51 .rpi-firmware
drwxr-xr-x  2 root root 4096 Sep 10 08:45 scripts
-rw-------  1 root root  259 Aug  1 14:04 .sqlite_history
drwx------  2 root root 4096 Nov  5 02:05 .ssh
root@rasp:~# rm psk *
rm: cannot remove `psk': No such file or directory
rm: cannot remove `aircrack': Is a directory
rm: cannot remove `misc': Is a directory
rm: cannot remove `scripts': Is a directory
root@rasp:~# rm psk * -f
rm: cannot remove `aircrack': Is a directory
rm: cannot remove `misc': Is a directory
rm: cannot remove `scripts': Is a directory
root@rasp:~# rm psk * -fR

我想放rm psk*但里面有一个空白。

有什么方法可以重建 bash、config、profile、rnd、rpi-firmware、ssh 文件夹和文件?

答案1

您可以并且应该从备份中恢复它。

答案2

以下命令将重新复制新设置的帐户获得的标准文件。

$ cd /etc/skel
$ cp .* /root/

相关内容