How can I restore /etc/profile? [duplicate]
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
14
down vote
favorite
This question already has an answer here:
How can I restore configuration files?
7 answers
I'm working on a bash script that appends to /etc/profile
but instead of appending, I accidentally wrote over it, losing all of its content. How can I restore the file? I did search here but being new to Ubuntu, I don't know if the posted /etc/profile
content I see in other questions is the default content.
.profile etc
marked as duplicate by muru, karel, Eric Carvalho, Fabby, heemayl Mar 20 at 18:17
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
14
down vote
favorite
This question already has an answer here:
How can I restore configuration files?
7 answers
I'm working on a bash script that appends to /etc/profile
but instead of appending, I accidentally wrote over it, losing all of its content. How can I restore the file? I did search here but being new to Ubuntu, I don't know if the posted /etc/profile
content I see in other questions is the default content.
.profile etc
marked as duplicate by muru, karel, Eric Carvalho, Fabby, heemayl Mar 20 at 18:17
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
grep /etc/profile /var/lib/dpkg/info/*.postinst
shows/var/lib/dpkg/info/base-files.postinst
, which in turn has a function copyingprofile
from/usr/share/base-files
to/etc/passwd
(among other such files).
â muru
Mar 20 at 8:30
2
Testing a script on your own OS, as root is not a good idea. You should use a VM (so you can just take a snapshot, and if anything goes wrong you just restore the snapshot), or at the very least backup your files before running it.
â Bakuriu
Mar 20 at 18:20
add a comment |Â
up vote
14
down vote
favorite
up vote
14
down vote
favorite
This question already has an answer here:
How can I restore configuration files?
7 answers
I'm working on a bash script that appends to /etc/profile
but instead of appending, I accidentally wrote over it, losing all of its content. How can I restore the file? I did search here but being new to Ubuntu, I don't know if the posted /etc/profile
content I see in other questions is the default content.
.profile etc
This question already has an answer here:
How can I restore configuration files?
7 answers
I'm working on a bash script that appends to /etc/profile
but instead of appending, I accidentally wrote over it, losing all of its content. How can I restore the file? I did search here but being new to Ubuntu, I don't know if the posted /etc/profile
content I see in other questions is the default content.
This question already has an answer here:
How can I restore configuration files?
7 answers
.profile etc
.profile etc
edited Mar 20 at 21:01
![](https://i.stack.imgur.com/m1Nbb.png?s=32&g=1)
![](https://i.stack.imgur.com/m1Nbb.png?s=32&g=1)
isanae
1112
1112
asked Mar 20 at 5:24
![](https://lh3.googleusercontent.com/-Ss7TxDnodfA/AAAAAAAAAAI/AAAAAAAAW78/gFpBtevfxMg/photo.jpg?sz=32)
![](https://lh3.googleusercontent.com/-Ss7TxDnodfA/AAAAAAAAAAI/AAAAAAAAW78/gFpBtevfxMg/photo.jpg?sz=32)
Alex
8310
8310
marked as duplicate by muru, karel, Eric Carvalho, Fabby, heemayl Mar 20 at 18:17
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by muru, karel, Eric Carvalho, Fabby, heemayl Mar 20 at 18:17
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
grep /etc/profile /var/lib/dpkg/info/*.postinst
shows/var/lib/dpkg/info/base-files.postinst
, which in turn has a function copyingprofile
from/usr/share/base-files
to/etc/passwd
(among other such files).
â muru
Mar 20 at 8:30
2
Testing a script on your own OS, as root is not a good idea. You should use a VM (so you can just take a snapshot, and if anything goes wrong you just restore the snapshot), or at the very least backup your files before running it.
â Bakuriu
Mar 20 at 18:20
add a comment |Â
1
grep /etc/profile /var/lib/dpkg/info/*.postinst
shows/var/lib/dpkg/info/base-files.postinst
, which in turn has a function copyingprofile
from/usr/share/base-files
to/etc/passwd
(among other such files).
â muru
Mar 20 at 8:30
2
Testing a script on your own OS, as root is not a good idea. You should use a VM (so you can just take a snapshot, and if anything goes wrong you just restore the snapshot), or at the very least backup your files before running it.
â Bakuriu
Mar 20 at 18:20
1
1
grep /etc/profile /var/lib/dpkg/info/*.postinst
shows /var/lib/dpkg/info/base-files.postinst
, which in turn has a function copying profile
from /usr/share/base-files
to /etc/passwd
(among other such files).â muru
Mar 20 at 8:30
grep /etc/profile /var/lib/dpkg/info/*.postinst
shows /var/lib/dpkg/info/base-files.postinst
, which in turn has a function copying profile
from /usr/share/base-files
to /etc/passwd
(among other such files).â muru
Mar 20 at 8:30
2
2
Testing a script on your own OS, as root is not a good idea. You should use a VM (so you can just take a snapshot, and if anything goes wrong you just restore the snapshot), or at the very least backup your files before running it.
â Bakuriu
Mar 20 at 18:20
Testing a script on your own OS, as root is not a good idea. You should use a VM (so you can just take a snapshot, and if anything goes wrong you just restore the snapshot), or at the very least backup your files before running it.
â Bakuriu
Mar 20 at 18:20
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
26
down vote
accepted
There should be a copy of the default profile
in /usr/share/base-files
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
26
down vote
accepted
There should be a copy of the default profile
in /usr/share/base-files
add a comment |Â
up vote
26
down vote
accepted
There should be a copy of the default profile
in /usr/share/base-files
add a comment |Â
up vote
26
down vote
accepted
up vote
26
down vote
accepted
There should be a copy of the default profile
in /usr/share/base-files
There should be a copy of the default profile
in /usr/share/base-files
answered Mar 20 at 5:35
![](https://i.stack.imgur.com/y7JEo.jpg?s=32&g=1)
![](https://i.stack.imgur.com/y7JEo.jpg?s=32&g=1)
stumblebee
2,3083922
2,3083922
add a comment |Â
add a comment |Â
1
grep /etc/profile /var/lib/dpkg/info/*.postinst
shows/var/lib/dpkg/info/base-files.postinst
, which in turn has a function copyingprofile
from/usr/share/base-files
to/etc/passwd
(among other such files).â muru
Mar 20 at 8:30
2
Testing a script on your own OS, as root is not a good idea. You should use a VM (so you can just take a snapshot, and if anything goes wrong you just restore the snapshot), or at the very least backup your files before running it.
â Bakuriu
Mar 20 at 18:20