943,678 Members | Top Members by Rank

Ad:
Sep 24th, 2009
0

i cant find my .profile file

Expand Post »
i changed the directory using cd $HOME but i dont see any .profile files under that directory. am i missing it? or it can be under some other directory? is it required to have it?
Similar Threads
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Sep 24th, 2009
0

Re: i cant find my .profile file

No, it is not required to have and depends on the shell you're using. For example bash uses .bash* prefixed files:
sk@sk:~$ ls -al .ba*
-rw------- 1 sk wheel 148196 Sep 24 14:18 .bash_history
-rw-r----- 1 sk wheel    509 May  9  2005 .bash_profile
-rw-r----- 1 sk wheel   1093 Oct 15  2004 .bashrc

There is also global profiles for most shells:
sk:/etc# ls -al bash.bashrc
-rw-r--r-- 1 root root 1127 Mar  4  2005 bash.bashrc

You can also just cd to return to your home directory:
sk@sk:/var/lib$ cd
sk@sk:~$
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 24th, 2009
0

Re: i cant find my .profile file

i use korn shell, ksh
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Sep 24th, 2009
0

Re: i cant find my .profile file

Here is the ksh login logic:
text Syntax (Toggle Plain Text)
  1. If the shell is invoked by exec(2), and the first character of argument zero ($0) is -, then the shell is assumed to be a login shell and commands are read from /etc/profile and then from either .profile in the current directory or $HOME /.profile, if either file exists. Next, for interactive shells, commands are read from the file named by performing parameter expansion, command substitution, and arithmetic substitution on the value of the environment variable ENV if the file exists. If the -s option is not present and arg and a file by the name of arg exits, then it reads and executes this script. Otherwise, if the first arg does not contain a /, a path search is performed on the first arg to determine the name of the script to execute. The script arg must have execute permission and any setuid and setgid settings will be ignored. If the script is not found on the path, arg is processed as if it named a built-in command or function. Commands are then read as described below; the following options are interpreted by the shell when it is invoked:

Files used:
text Syntax (Toggle Plain Text)
  1. /etc/passwd
  2. /etc/profile
  3. /etc/suid_profile
  4. $HOME /.profile
  5. /tmp/sh*
  6. /dev/null

ksh man page
Last edited by sknake; Sep 24th, 2009 at 4:09 pm.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 24th, 2009
0

Re: i cant find my .profile file

i cant add to your reputation for today, i will tomorrow.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Applications and Software Forum Timeline: Makefile with multiple directories
Next Thread in Linux Applications and Software Forum Timeline: LS





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC