I am new to linux. I am currently going through a setup tutorial for Kafka online. It says to add the path of my kafka bin directory as follows to my .profile file which I did as below:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin directories
DOCKER="/usr/local/bin/docker-compose"
PATH="$HOME/bin:$HOME/.local/bin:$PATH:$DOCKER"
# Ubuntu make installation of Ubuntu Make binary symlink
PATH=/home/username/.local/share/umake/bin:$PATH
cat ~/.ssh/config.d/* > ~/.ssh/config
PATH="$PATH:/home/username/softwares/kafka/kafka_2.11-1.0.0/bin"
After that, i did an echo on $PATH, I could see the kafka path added to the PATH. Post which, i typed kafka and then tab, then i could see kafka related optional commands.
The tutorial then tells to edit .bashrc file. It was already there. It was quite a big file. I added at the end of the file the below line(as per the tutorial):
. ~/.profile
After that, i opened another terminal as per the tutorial to see that I am still getting all the kafka related options after kafka and tab. I saw that on the terminal, i was not getting my username and it was a blank terminal window. I then edited the .bashrc to remove the line I added and then tried to open a new terminal, and I could see my username on the terminal. Then i closed all the terminals. Opened a fresh one and typed kafka and tab, and I didnt get any options as earlier. I then opened the .profile file and i could see the kafka path still added. Then, I tried to echo $PATH, and this time, the kafka path was not there.
I am really confused what is happening here. Could you please explain a bit and let me know how to load the .profile every time i open a terminal and that why do I not see the kafka path anymore , when i do an echo on PATH.