How can I restore /etc/profile? [duplicate]


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


isanae
1112
1112
asked Mar 20 at 5:24


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


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