Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is what happened:

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

I wanted to put rm psk* but got a blank space in it.

Is there any way I can rebuild the bash, config, profile, rnd, rpi-firmware, ssh folders and files?

share|improve this question
up vote 4 down vote accepted

You can and should restore it from backup.

share|improve this answer
+1. Either learning or seeking a job ouside system administration are likely good ways to go forward - better do something that dumb (according to your own words) not again ;) – TomTom Jan 22 '14 at 20:10
That's sorta true.. – DanFromGermany Jan 22 '14 at 20:12

The following commands will re-copy the standard files that a newly setup account gets.

$ cd /etc/skel
$ cp .* /root/
share|improve this answer
This doesn't really rebuild it, just restocks the directory with the standard set of files that a newly created account would get. – slm Jan 22 '14 at 20:32
That's what I thought too, and also /etc/skel/.ssh/id_rsa does not exist, it has recoverd ?! How is this possible? – DanFromGermany Jan 22 '14 at 20:38
Oh maybe rm * -fR does not delete .hidden files? – DanFromGermany Jan 22 '14 at 20:39
When you ssh into the system that directory get's automagically created. Without backups you're screwed. The file id_rsa is your public/private key pair (the private part). – slm Jan 22 '14 at 20:39
Those switches likely need to occur before the files, not after. I'm not sure what rm does when they're after like that. You dodged a big bullet. Back your critical files up!!! – slm Jan 22 '14 at 20:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.