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

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
14
down vote

favorite
3













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.










share|improve this 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 copying profile 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














up vote
14
down vote

favorite
3













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.










share|improve this 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 copying profile 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












up vote
14
down vote

favorite
3









up vote
14
down vote

favorite
3






3






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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 copying profile 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




    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




    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










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






share|improve this answer



























    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






    share|improve this answer
























      up vote
      26
      down vote



      accepted










      There should be a copy of the default profile in /usr/share/base-files






      share|improve this answer






















        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






        share|improve this answer












        There should be a copy of the default profile in /usr/share/base-files







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 20 at 5:35









        stumblebee

        2,3083922




        2,3083922












            Popular posts from this blog

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            Unable to upgrade pip

            Cutting all the characters after the last /