Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-02-2009, 06:59 PM   #1
LQ Newbie
Registered: Nov 2004
Posts: 1

Rep: Reputation: 0
Restoring/Rebuilding Obliterated /etc/profile

So... I was messing around with cat __ __ > ___ the other day, trying to combine several nifty little files into a single /etc/profile, ... and somehow I ended up with only the last file, it having apparently overwritten everything else, including the original /etc/profile (which, being an idiot, I didn't back up before trying this).

So, long story short, my /etc/profile now consists solely of alias definitions and a few environment variables I've tried to add after the fact to fix the locale errors I keep getting every time I run something.

What should be in this file? Where could I find a replacement, or, if not a replacement, at least some idea what I need to put in it?

I'm running ubuntu-server jaunty, with xfce4 installed because I got tired of using my 10 yr old laptop and turned my server into a desktop machine.
Old 08-02-2009, 07:14 PM   #2
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,661
Blog Entries: 56

Rep: Reputation: Disabled
You could try copying the /etc/profile from your Ubuntu CD.
Old 08-02-2009, 11:08 PM   #3
Senior Member
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
You may find a version of it in '/usr/share/base-files/profile'. However, '/etc/profile' may also have changes depending on what is installed (eg X11), mainly to the default paths.

So /etc/profile will look something like this:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    PS1='\u@\h:\w\$ '
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
      PS1='$ '

export PATH

umask 022


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rebuilding a kernel overlook1977 Slackware 13 06-02-2007 02:55 PM
system profile vs user profile bonito SUSE / openSUSE 3 06-28-2006 02:02 PM
Rebuilding K Menu? Vampirite Slackware 18 12-15-2005 07:17 PM
Rebuilding Openoffice-1.1.3 veenanaidu Linux - Software 0 12-11-2004 01:44 AM
Rebuilding RPMs tarballedtux Linux - Software 1 07-02-2002 09:36 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration