.profile missing in Unix (bash shell)

  • Thread starter Thread starter Arnoldjavs3
  • Start date Start date
  • Tags Tags
    Shell Unix
Click For Summary
The discussion revolves around the absence of a .profile file in the user's home directory while working in a Unix environment. Users suggest creating the .profile file if it doesn't exist, and recommend using either .bashrc or .bash_profile for customizations like displaying a name at login. A successful solution was found by using the echo command with $(user). The conversation highlights the variability in Unix and Linux setups, emphasizing the importance of consulting specific resources or forums for guidance. Overall, users express a mix of frustration and newfound confidence as they navigate Unix shell scripting.
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.
 

Similar threads

Replies
1
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
16
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
10
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K