1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: .profile missing in Unix (bash shell)

  1. Feb 4, 2017 #1
    1. The problem statement, all variables and given/known data
    I'm playing around in UNIX and I wanted to modify my .profile file in my home directory, but It's not there. I know you type in ls -a to view the hidden files but it's simply not there. Do I just create one? I want it to just display my name every time i log in.

    2. Relevant equations

    3. The attempt at a solution
    I'm new with bash, i don't know much of its scripting but I think all I have to do is write an echo statement at the end of it - after creating the file in vim or something?


    echo "blablabla"

    I've tried this and it doesn't work.
  2. jcsd
  3. Feb 4, 2017 #2


    User Avatar
    Science Advisor

    In bash, you should have files called ~/.bashrc and ~/.bash_profile. Depending on what you want to do, you need to edit one of these.
  4. Feb 4, 2017 #3
    There are lots of unix sites that will tutor you through this. Shells can get fairly involved if you want a nice working environment. Although the web is fine for answers for this sort of stuff, when I got into Linux some years back, I bought a few O'Reilly books to help me; they have a https://www.amazon.com/Learning-bas...1?ie=UTF8&qid=1486229213&sr=8-1&keywords=bash that was very helpful.
    Last edited by a moderator: May 8, 2017
  5. Feb 4, 2017 #4
    I actually found it in /etc/skell/. It sucks because I have several books and they all point to different things; It's not a very uniform platform for me :(.

    I simply added in echo$(user) and it worked.

    if you have a book similar to C by brian and ritchie i'm all ears - I have unix shell programming(3rd edition) and one oreilly book as a ebook.
  6. Feb 4, 2017 #5
    Never hear of that before!

    Are you literally using unix, or a linux distro? If the latter, you can go to its forums & people there should be able to tell you how exactly things differ from the more standard setups..
  7. Feb 4, 2017 #6
    UNIX and bash shell. Someone had guided me there from unix.stackexchange.

    Although I'm feeling alot more confident now, found a couple online tutorials that are great
  8. Feb 4, 2017 #7


    Staff: Mentor

    Often referred to as "K & R," (but not B & R) for Brian Kernighan and Dennis Ritchie.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted