LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-02-2009, 05:59 PM   #1
wlerin
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, 06:14 PM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,299
Blog Entries: 61

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

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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:
Code:
# /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
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
fi

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

export PATH

umask 022
 
  


Reply



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 01:55 PM
system profile vs user profile bonito SUSE / openSUSE 3 06-28-2006 01:02 PM
Rebuilding K Menu? Vampirite Slackware 18 12-15-2005 06:17 PM
Rebuilding Openoffice-1.1.3 veenanaidu Linux - Software 0 12-11-2004 12:44 AM
Rebuilding RPMs tarballedtux Linux - Software 1 07-02-2002 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:29 PM.

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