LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2014, 12:46 PM   #1
AEDeGance
LQ Newbie
 
Registered: Oct 2014
Posts: 10

Rep: Reputation: Disabled
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
 
Old 10-09-2014, 01:05 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,453

Rep: Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051
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)?
 
Old 10-09-2014, 01:29 PM   #3
AEDeGance
LQ Newbie
 
Registered: Oct 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.

Last edited by AEDeGance; 10-09-2014 at 01:34 PM.
 
Old 10-09-2014, 01:47 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,453

Rep: Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051
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).
 
Old 10-09-2014, 02:34 PM   #5
AEDeGance
LQ Newbie
 
Registered: Oct 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-09-2014, 02:46 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,453

Rep: Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051
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).
 
Old 10-09-2014, 02:52 PM   #7
AEDeGance
LQ Newbie
 
Registered: Oct 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
Is the .bashrc just a flat file? I'll take a shot and get back if it dont work. Thank you.
 
Old 10-09-2014, 03:04 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,453

Rep: Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051Reputation: 2051
It's a regular plain text ascii file, just like .profile is.
 
Old 10-09-2014, 07:05 PM   #9
AEDeGance
LQ Newbie
 
Registered: Oct 2014
Posts: 10

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
login without using .profile shobhit Linux - Software 8 06-02-2007 12:39 PM
which file loads the profile of login? rlee923 Fedora 2 01-26-2007 11:20 AM
Login Profile jonty_11 Linux - General 6 10-28-2004 05:17 PM
about the login profile ust Linux - Software 2 02-02-2004 09:43 PM
.profile .login albean Linux - Newbie 4 10-04-2002 08:51 PM


All times are GMT -5. The time now is 03:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration