LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   login start-up file .profile (https://www.linuxquestions.org/questions/linux-newbie-8/login-start-up-file-profile-4175521584/)

AEDeGance 10-09-2014 12:46 PM

login start-up file .profile
 
Guys,

I've placed several alias cmds in my .profile so that when I login I can use them. But when I type any of the alias's none of them work in the shell. If I type an alias in the shell, it then works fine. Where do I go to figure out why the stuff in .profile aint working?

Tony Dee

suicidaleggroll 10-09-2014 01:05 PM

What distribution and shell are you using?
Did .profile already exist or did you create it to do this?
Have you tried using .bashrc (assuming you're using bash)?

AEDeGance 10-09-2014 01:29 PM

I'm running Linux Mint 17.0. I've logged in and am running a BASH. The .profle existed and I've modified it to include three lines, viz.
alias lsd="ls -a"
alias lsa="ls -a"
alias lsl="ls -al"
And no, I have not tried using bashrc.

suicidaleggroll 10-09-2014 01:47 PM

I believe .profile is only sourced once when you first log in, which means you'll need to log out of the machine and back in in order for the changes to take effect.

.bashrc, on the other hand, is sourced every time you open a terminal, so for the changes to take effect you only need to close and re-open the terminal (or manually source the file).

AEDeGance 10-09-2014 02:34 PM

Yes, I have tried logging out and logging back it. But the alias's are still not working. And I do not have .bashrc or bashrc available to me. Is there perhaps something missing from the alias cmd that needs to be there in the .profile?? Since the $PATH has changed to include ~/bin I know that the .profile is used. I'm missing something and I'm not sure what might be going on.

suicidaleggroll 10-09-2014 02:46 PM

After some googling I'm seeing some weird posts about aliases not working properly in .profile, but no real explanation why.

Your best bet is to just move them to .bashrc (create it since it doesn't already exist).

AEDeGance 10-09-2014 02:52 PM

Is the .bashrc just a flat file? I'll take a shot and get back if it dont work. Thank you.

suicidaleggroll 10-09-2014 03:04 PM

It's a regular plain text ascii file, just like .profile is.

AEDeGance 10-09-2014 07:05 PM

It works well. Thank you for solving the problem. I was bouncing all over google but couldn't hit upon a solution.


All times are GMT -5. The time now is 11:50 AM.