Questions tagged [profile]

250 questions
141
votes
4 answers

Is there a ".bashrc" equivalent file read by all shells?

Is ~/.bashrc the only place to specify user specific environment variables, aliases, modifications to PATH variable, etc? I ask because it seems that ~/.bashrc seems to be bash-only, but other shells exist too…
Stefan
  • 24,830
  • 40
  • 98
  • 126
134
votes
4 answers

What is the difference between ~/.profile and ~/.bash_profile?

What is the difference between ~/.profile and ~/.bash_profile?
lakshmen
  • 6,071
  • 5
  • 17
  • 9
128
votes
3 answers

What do the scripts in /etc/profile.d do?

I am reading about basic shell scripting from Linux Command Line and Shell Scripting Bible. It says that the /etc/profile file sets the environment variables at startup of the Bash shell. The /etc/profile.d directory contains other scripts that…
asheeshr
  • 1,897
  • 2
  • 18
  • 23
77
votes
3 answers

What is the difference between ~/.profile, ~/.bashrc, ~/.bash_profile, ~/.gnomerc, /etc/bash_bashrc, /etc/screenrc ...?

Answers to the questions on SO and askubuntu, along with poking through (and reading headers of) $HOME and /etc/, indicate a number of files that can be used to set environment variables, including: ~/.profile ~/.bashrc ~/.bash_profile…
Abe
  • 1,681
  • 2
  • 13
  • 8
75
votes
8 answers

Making zsh default shell without root access

I am using my school's computers and would like to use zsh instead of bash. I'd like to make it the default shell, but I cannot run a command such as $ chsh -s $(which zsh) because I don't have admin privileges. Is there a way I can put something…
goodcow
  • 903
  • 1
  • 7
  • 6
50
votes
3 answers

Ash profile/configuration file

I am looking for a way to customize Ash sessions with my own sets of aliases and whatnots. What is the Ash equivalent of Bash's bashrc files?
reg
  • 1,113
  • 1
  • 8
  • 12
46
votes
5 answers

Why doesn't my ~/.bash_profile work?

I'm using Linux Mint. My login shell (cat /etc/passwd | grep myUserName) is bash. After I start my graphical desktop environment and run a terminal emulator from it, I can see that .bash_profile is not sourced (environment vars that are exported in…
AntonioK
  • 1,151
  • 2
  • 15
  • 28
42
votes
5 answers

how can I use bash as my login shell when my sysadmin refuses to let me change it

The unix sysadmin where I'm working is reluctant to give me access to change my login shell from ksh to bash. He has given various excuses, the funniest being that since they write all their scripts for ksh they won't work if I try to run them. I…
iconoclast
  • 9,057
  • 12
  • 56
  • 95
36
votes
5 answers

How to write a shell script that gets executed on login?

I am trying to write bash shell script in Ubuntu 11.10 Linux distro, that will get executed automatically on logging into the system. But I am not able to figure out that what to write in script that by it will get automatically executed on logging…
dubex
  • 601
  • 2
  • 6
  • 6
36
votes
4 answers

Global bash_profile

I realize there are /etc/profile and /etc/bashrc files for setting global environment variables and maybe I'm just misunderstanding their purposes, but... Is there a global bash_profile file? I'm using Mac OS X
user23312
35
votes
6 answers

How to add a function to .bash_profile/.profile/bashrc in shell?

I have a function which converts epoch time to date. Here is the definition date1(){ date -d @$1 } I'd like to be able to write: $ date1 xxxyyy Where xxxyyy is the parameter I pass into my function so I can get the corresponding date. I…
Max
  • 705
  • 1
  • 7
  • 14
34
votes
3 answers

Find out what scripts are being run by bash at login

After starting a bash terminal, I noticed that the PATH variable contains duplicate entries. My terminal starts a login shell, so ~/.bash_profile is sourced, followed by ~/.profile and ~/.bashrc. Only in ~/.profile do I create the paths entries…
smac89
  • 1,279
  • 1
  • 13
  • 17
33
votes
2 answers

Setting PATH vs. exporting PATH in ~/.bash_profile

What's the difference and which is better to use when customizing my bash profile? Documentation on the export command is scarce, as it's a builtin cmd. Excerpt from version 1 of my ~/.bash_profile: #PATH export…
njboot
  • 581
  • 1
  • 7
  • 13
31
votes
7 answers

How can I change what's displayed at a login shell?

I'm getting more familiar with tweaking the way things look in a shell via the prompt (.bashrc), but I'm now trying to change the initial stuff displayed when I first log in. On my EC2 instance, this is what I see when I log in: __| __|_ …
Naftuli Kay
  • 38,686
  • 85
  • 220
  • 311
30
votes
4 answers

Why no shebang in .bashrc/.bash_profile?

Simple inquiry: I have just realized that I have never seen a shebang on top of a .bashrc script, which leads me to think the system uses the default shell to source it upon login (${SHELL}). I am pondering over reasons why that is the case, i.e.…
amphibient
  • 12,222
  • 18
  • 62
  • 87
1
2 3
16 17