.profile missing in Unix (bash shell)

  • Thread starter Thread starter Arnoldjavs3
  • Start date Start date
  • Tags Tags
    Shell Unix
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 2K views
Arnoldjavs3
Messages
191
Reaction score
3

Homework Statement


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.

Homework Equations

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?

#!/bin/bash

echo "blablabla"

I've tried this and it doesn't work.
 
Physics news on Phys.org
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.
 
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/dp/0596009658/?tag=pfamazon01-20 that was very helpful.
 
Last edited by a moderator:
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.
 
Arnoldjavs3 said:
I actually found it in /etc/skell/.

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..
 
UNIX and bash shell. Someone had guided me there from unix.stackexchange.

Although I'm feeling a lot more confident now, found a couple online tutorials that are great
 
Arnoldjavs3 said:
book similar to C by brian and ritchie I'm all ears
Often referred to as "K & R," (but not B & R) for Brian Kernighan and Dennis Ritchie.