.profile missing in Unix (bash shell)

  • Thread starter Thread starter Arnoldjavs3
  • Start date Start date
  • Tags Tags
    Shell Unix
Click For Summary

Discussion Overview

The discussion revolves around the absence of a .profile file in a user's home directory while working in a Unix environment, specifically within the bash shell. Participants explore the implications of this absence, potential solutions for creating a .profile file, and related configuration files like .bashrc and .bash_profile.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes the absence of the .profile file and questions whether they should create one to display their name upon login.
  • Another participant suggests that in bash, the relevant files to edit are ~/.bashrc and ~/.bash_profile, depending on the desired outcome.
  • A participant shares their experience of finding the .profile file in /etc/skell/ and expresses frustration over conflicting information from various sources.
  • One participant mentions successfully adding an echo statement to display the username and indicates that they have gained confidence through online tutorials.
  • There is a question about whether the user is working with Unix or a Linux distribution, with a suggestion to seek help from relevant forums for specific differences.
  • A participant references a desire for books similar to "C" by Brian Kernighan and Dennis Ritchie, indicating interest in further learning resources.

Areas of Agreement / Disagreement

Participants express varying opinions on the existence and use of configuration files, with no clear consensus on the best approach to take regarding the .profile file and its alternatives.

Contextual Notes

There are mentions of different sources of information regarding Unix and Linux configurations, indicating potential limitations in the uniformity of guidance available to users.

Who May Find This Useful

This discussion may be useful for individuals new to Unix or Linux environments, particularly those interested in shell scripting and user configuration files.

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
3K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 5 ·
Replies
5
Views
4K