Questions tagged [.profile]
A user-specific (not systemwide) configuration script executed when starting login shells.
205
questions
251
votes
7
answers
439k
views
Why ~/.bash_profile is not getting sourced when opening a terminal?
Problem
I have an Ubuntu 11.04 Virtual Machine and I wanted to set up my Java development environment. I did as follows
sudo apt-get install openjdk-6-jdk
Added the following entries to ~/....
106
votes
5
answers
282k
views
I cannot find .bash_profile in ubuntu
I can't find .bash_profile in Ubuntu 14.04 in my /home/user directory. I used the ls -a command to see the .bash_profile, but there isn't such a file.
91
votes
2
answers
74k
views
What are login and non-login shells?
It is said that settings for non login shell to go into .bashrc file and login shell settings to go into .profile file.
What is really meant by login and non-login shells?
Please explain without ...
84
votes
5
answers
118k
views
Why are scripts in /etc/profile.d/ being ignored (system-wide bash aliases)?
I'm new to Ubuntu. I'm running 13.10 Desktop.
I wanted to set some system wide aliases and a custom prompt for bash. I found this article:
https://help.ubuntu.com/community/EnvironmentVariables
...
81
votes
4
answers
260k
views
Permanent PATH variable
How will I make this /media/De Soft/mongodb/bin PATH variable permanent?
Everyone is saying "export PATH=$PATH:media/De\ Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv depending on your ...
79
votes
2
answers
81k
views
Why isn't .profile sourced when opening a terminal?
Just installed Ubuntu 14.04.1 LTS.
According to .profile,
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash, if ~/.bash_profile or ~/.bash_login ...
55
votes
3
answers
54k
views
Sequence of scripts sourced upon login
I would like to concentrate all my login config in my ~/.bash_profile. There was a ~/.bashrc there by default but I replaced it with a ~/.bash_profile.
However, when I log in, something before my ~/....
51
votes
6
answers
80k
views
Why is /etc/profile not being loaded during non-login bash shell sessions?
For 11.04, I did a fresh install of my system. Part of that install was to install rvm, which sticks a rvm.sh in /etc/profile.d/. This doesn't work as /etc/profile (which loads each +r in /etc/profile....
39
votes
3
answers
20k
views
What goes in ~/.profile and ~/.bashrc?
I'm having trouble wrapping my head around what belongs in ~/.profile and what belongs in ~/.bashrc.
From what I've read, it seems to me that ~/.profile should be used for environment variables and ~/....
33
votes
2
answers
14k
views
Why does Ubuntu's default ~/.profile source ~/.bashrc?
These are the contents of the stock ~/.profile that came with my 13.10 (commented lines removed):
if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
...
29
votes
4
answers
51k
views
Configure gnome-terminal to start bash as a login shell, doesn't read .bashrc
I'm trying to integrate RVM with gnome-terminal.
Per default, gnome-terminal does not start bash as a login shell. I enabled run command as a login shell as suggested in this answer about the same ...
20
votes
2
answers
27k
views
how to reset ~/.profile to default
I have been playing around with the ~/.profile file trying to add something permanently to my $PATH variable and it seems i have done some damage.
I can't log into ubuntu now. When I enter my ...
18
votes
1
answer
8k
views
How can I restore /etc/profile?
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? Is there a system default ...
18
votes
1
answer
31k
views
What can cause my .profile file to not be loaded when a new terminal shell is initialized?
There are no errors in xsession and I don't have a .bash_login or .bash_profile file, so I'm 100% certain neither of those is loaded and thus cancels .profile loading.
When I rename the .profile to ....
16
votes
5
answers
28k
views
Why is setting alias in .profile not working?
I have this as the last line in my .profile:
alias gl="cd /home/jrenner/glances/glances"
yet even after reboot I get command not found when typing gl. What is happening? I am logged in as the ...
16
votes
4
answers
28k
views
/etc/profile vs ~/.profile
I run ubuntu 12.04.1 LTS. And I can't get what is the order/priority for loading profile files. When I start the system and login using GUI which file is loaded? And why? What if run login-shell? Will ...
14
votes
3
answers
26k
views
Can I ssh into my account without invoking .profile?
I want to ssh into my account, but I don't want the current version of my .profile login script to be executed. Is there a way to log in without running .profile?
(Disclaimer: I found a work-around ...
11
votes
2
answers
10k
views
Why do I have to `source .profile` in every terminal I open?
When we change some variable in ~/.profile in Ubuntu, then we execute the command source .profile. Then the change is effective only in this terminal. If we open a new terminal we have to execute the ...
11
votes
3
answers
10k
views
Where is my PATH variable being set?
I'm trying to set my path variable to look like this:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/jgrande/android-sdk-linux/platform-tools:/usr/lib/...
10
votes
2
answers
6k
views
Why .profile (and not .bashrc) appends ~/bin to path?
Since .bashrc is more "generic" (in the sense that .profile sources it), why "include ~/bin to path" procedure is not inside .bashrc? Why the user would not want it in a non-login shell? (Especially ...
9
votes
1
answer
681
views
Where are the pristine, untouched contents of a ~/.profile file?
Several files in my home directory have been disappearing. E.g. .bashrc, .bash_profile, authorized_keys and now .profile.
Regardless of how this happened, I would like to restore the original ...
8
votes
7
answers
22k
views
How to set default umask in Ubuntu 17.04?
In the past, I have always set umask at ~/.profile. I set a umask of 077 so my documents get a permission of 600 (rw-------). But setting this at ~/.profile no longer works in Ubuntu 17.04.
So as new ...
8
votes
1
answer
2k
views
Is .profile read upon GUI login
In this question, it is mentioned that there is no standard behavior in terms of whether .profile is read or not when a user logs in from the GUI in today's Linux and Unix systems. So for Ubuntu, is ....
7
votes
2
answers
13k
views
Where to place local executables [duplicate]
Where is the correct place to store user-local executable files?
echo $PATH gives
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
It doesn't include eg. $HOME/bin
Would $...
7
votes
1
answer
1k
views
Is there one file that all Desktop Managers (GNOME, KDE, XFCE and etc) are required to read/execute when users login?
I use GNOME and it first executes commands from /etc/profile and then from ~/.profile. This I have found by putting statements like echo 'something' > test in all files that i could think of like ....
6
votes
1
answer
1k
views
Ubuntu Desktop: Why the .profile script is executed in an interactive non-login shell?
I understand about the difference between Interactive login and Interactive non-login
According with this excellent post: Zsh/Bash startup files loading order (.bashrc, .zshrc etc.) we have the ...
5
votes
4
answers
7k
views
How to log in after wrongly modifying path
I wanted to add a path so that the system could find some manually installed executable. However, instead of typing PATH=xxx:$PATH;export PATH at the end of ~/.profile where xxx is the directory in ...
5
votes
3
answers
7k
views
How to fix ~/.profile and ~/.bashrc syntax errors
Ubuntu 18.04.4 (automatic upgrade from 18.04.3 just a few weeks ago)
/bin/bash
After I log in from the Gnome shell, this message appears while the screen is just plain purple and before the desktop ...
5
votes
2
answers
42k
views
How do I get Ubuntu to use Anaconda's python instead of the standard /usr/lib/python...?
I installed Anaconda using instructions provided on the main website, which are similar to those that can be seen here: How to install Anaconda on Ubuntu?
However, I found that I had to manually ...
5
votes
1
answer
2k
views
`alias` command in `.profile` not recognized until `source .profile` is called
I have the following line in my .profile file in my home directory:
alias flux='redshift -O 2500'
But whenever I login and type flux I get a flux is not a recognized command.
I then do a source ....
5
votes
2
answers
980
views
Shell prompt customization and cmd behavior
I want my prompt to display:
current (absolute) working directory, colored in green and
in a NEW line, the dollar sign and an empty space.
I am using this line in .profile
export PS1='\e[0;32m$(pwd)...
5
votes
1
answer
3k
views
Ubuntu 12.04 doesn't seem to execute my .profile file
(I'm kinna n00bish)
1: I had ubuntu 11.10 installed, then upgraded to 12.04.
2: I had a script in my .profile file to turn off my laptop's touchpad (it worked, and was executed on login)
3: Now it ...
5
votes
3
answers
5k
views
Remove brew completely from my system
I interrupted the execution of homebrew while installing. Consequently, I ran into a problem mentioned here Error found when loading /home/user/.profile:. I had to comment eval statements in the ...
5
votes
1
answer
2k
views
How can I set path so it can be read from GUI and command line by the same program?
I installed texlive and I want to add it as an environment variable to my Path so that Emacs AucTeX can read it when I start emacs from the GUI or from the command line. So far I've read that emacs ...
5
votes
1
answer
3k
views
why my .xprofile file doesn't work?
I have xorg and xinit and I want to start some commands before the X environment. I did this many times and idk bc doesn't work.
I made a touch ~/.xprofile and here I wrote the command that I want to ...
5
votes
3
answers
16k
views
Error found while loading /home/[username]/.profile
When the system loads it gives the following error:
Error found while loading /home/[username]/.profile
mesg: ttyname failed: inappropriate ioctl for device
As a result the session should not be ...
5
votes
1
answer
15k
views
How to set environment without sourcing .bash_profile myself every time? [duplicate]
When I restart Ubuntu 14.04, environment variables are set back to default and I have to run source .bash_profile every time which is very annoying. I generally keep my environment vars in ....
5
votes
1
answer
1k
views
Can't login after adding script to /etc/profile.d
I have created a little script to add bookmarks in Nautilus to redirect users to network share. If I run the script manually, it works brillantly but as soon as I try to add it in /etc/profile.d, I ...
5
votes
0
answers
2k
views
Error found when loading /home/[myusername]/.profile
I get this error each time after logging on:
Error found when loading /home/[myusername]/.profile:
stty: standard input: Inappropriate ioctl for device
As a result the session will not be ...
4
votes
2
answers
20k
views
"qmake" is not recognized
I have installed Qt 5.6 from the official website via a *.run file. The installation directory is in my home folder. When I run
qmake --version
I get the following message:
qmake: could not exec '/...
4
votes
3
answers
7k
views
Why won't environment variables added to .profile show up in screen
I'm running Ubuntu 12.04
I added
export LD_LIBRARY_PATH=/home/dspies/workspace/hdf5-1.8.11-linux-shared/lib
to .profile
but when I log in and open terminal and put echo $LD_LIBRARY_PATH there's ...
4
votes
3
answers
2k
views
Which bash profile file should I use for each scenario?
I have seen many detailed explanations on how .bashrc, .bash_profile and the various other profile files interact, so I'm not after an explanation of how they fit together (I've read many such ...
4
votes
1
answer
313
views
How can I configure the steps of font size changes in the terminal?
How can I configure the steps of font size changes in the terminal? I now use 10pt and the next step when using keyboard shortcuts is too big. How can I configure the step size?
4
votes
2
answers
266
views
Something wrong with my `.profile`
I recently installed a few softwares and needed to add their bin/ directories to my PATH. Nothing abnormal so far. But I decided to be smart about it, and rewrote a part of my .profile so I didn't ...
4
votes
1
answer
3k
views
run .profile function as cron job
In the .profile file of the root user I have defined a function, e.g.
function printDate() {
date
}
I want to run this function every minute and append the output to cron.log. I tried adding the ...
4
votes
1
answer
238
views
App installed in ~/usr launches from terminal but not Applications menu (or why does setting ld_library_path in .profile not work as it should)
I have built and installed an application under a directory of my choosing, let's say under /home/jim/usr, so files have been put in three-four folders, all under this $HOME/usr folder (e.g., bin, ...
4
votes
1
answer
576
views
Function inside .profile results in no log-in
I've created a custom function in my .profile, and I've added right at the bottom, after my custom aliases :
# custom functions
function eclipse-gtk {
cd ~/development/eclipse-juno
./...
3
votes
1
answer
4k
views
What are the dangers of sourcing ~/.profile from ~/.bashrc? [closed]
I see many people do the opposite. Are there any reasons why it is a bad idea to source ~/.profile from ~/.bashrc?
# .bashrc
if [ -f ~/.profile ]; then
source ~/.profile
fi
I've done a lot of ...
3
votes
2
answers
13k
views
repair ~./profile file
I just messed up with ~/.profile, tried to add something to PATH, but looks like there was a syntax error in my code and now the login screen functionality won't work and I can use ctrlshiftf1 tty to ...
3
votes
3
answers
6k
views
Problem in .bashrc
I try to edit .bashrc to view the C-compilers that I installed before.
But after opening the new terminal I am stuck with strange error.
I am unable to ls the files/directories and nothing works. It ...