Linked Questions

0
votes
1answer
1k views

Functions in ~/.bash_profile not found in an interactive shell [duplicate]

I thought that whatever lies in .bash_profile(or .profile) which is sourced in a login-shell, is available in an interactive shell. My goal is to have available a list of functions, either in a login ...
2
votes
0answers
79 views

~/.bash_profile not executed upon login, but ~/.profile is [duplicate]

I'm running Ubuntu, with Gnome3 as my desktop manager. While debugging some initialization issues (the usual confusion over bash_profile, bashrc, etc.), I found that given the following files, # ~/....
293
votes
5answers
159k views

Difference between Login Shell and Non-Login Shell?

I understand the basic difference between an interactive shell and a non-interactive shell. But what exactly differentiates a login shell from a non-login shell? Can you give examples for uses of a ...
103
votes
4answers
31k views

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 ...
62
votes
6answers
7k views

What features are in zsh and missing from bash, or vice versa?

As a Linux user, I've always just used bash because it was the default on every distro I used. People using other Unix systems such as BSD seem to use other shells far more frequently. In the ...
11
votes
3answers
3k views

What does [ -t 1 ] check?

I just found a way to start zsh when I start the bash on Windows from https://www.howtogeek.com/258518/how-to-use-zsh-or-another-shell-in-windows-10/. It recommended to add following code at the ...
9
votes
3answers
1k views

In what way isn't SFTP based on SSH?

I've just completed OverTheWire Bandit wargame, level 18. That was a surprise. Here are the instructions for this level. The password for the next level is stored in a file readme in the ...
7
votes
1answer
4k views

In bash vi mode, map jk to exit insert mode

I'm using a fresh install of ubuntu 16.04, with the bash shell. There are two things that I want to do: Set up vi mode so I can have vim-like movements from the terminal exit insert mode by typing jk ...
3
votes
1answer
9k views

.bashrc and .bash_profile not executed [closed]

I'm running RHEL5. I added simple alias command into ~/.bashrc. When I start a new terminal, nothing happens but source ~/.bashrc works so I know the syntax is correct. I also modified/source-...
5
votes
1answer
3k views

Can't export environment variables on X session start

My setup is: Debian testing (stretch), up to date LightDM with autologin enabled Awesome window manager bash, in ROXTerm or XTerm I don't seem to be able to set own environment variables and get it ...
3
votes
3answers
2k views

Issues with .bash_profile and terminal commands

I added some data to my .bash_profile to run two aliases ruby version 19 and the proper gems. As soon as I added the data I could not longer run any commands such as the MacPorts command port nor the ...
-2
votes
2answers
530 views

Why does sourcing a script in .profile not work?

I have an executable script which I want to run every time I log in or open a new interactive shell. I added the path to this executable in .profile and sourced it by adding this line to .profile ...
2
votes
1answer
458 views

Bash aliases not picked up on initial login

I'm running Debian 8.5 (Jessie) on a virtualbox vm. I have some bash aliases that I can't get to run when I initially login to my vm. However, when I run bash from inside the shell, then they work. ...
0
votes
1answer
424 views

How to make the command in /etc/profile be found? [duplicate]

Os: debian9. touch /home/test/test.log There is a simple function write-date in /etc/profile. write-date(){ date >> /home/test/test.log } Create a service running at reboot or ...
1
vote
1answer
280 views

Why bash does not update Java path without running source ~/.bash_profile?

I am using Mac, and $JAVA_HOME environment path is set in ~/.bash_profile like: export JAVA_HOME=$(/usr/libexec/java_home) After I updated Java, bash kept trying to find Java from the older version. ...