![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Want to hide password | arpitk | Shell Programming and Scripting | 1 | 09-29-2006 05:42 AM |
| Hide a script ? | new2ss | Shell Programming and Scripting | 5 | 06-01-2006 04:31 AM |
| Hide Passwords | lesstjm | Shell Programming and Scripting | 3 | 04-04-2005 10:18 PM |
| how to hide | Rameshmca | Shell Programming and Scripting | 3 | 11-30-2004 02:45 AM |
| hide hostname in dns | lusifer | UNIX for Advanced & Expert Users | 4 | 10-15-2001 06:38 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hello everyone,
i am new to unix and still learning about different commands. Can some one tell me how can i hide my directory name. For instance someone is logged in a directory named [home:/user/myname]$ . I've seen some people hiding their above path name by just one word or letter like [anything]$ in order to keep their path hidden for security reasons. I also heard from some people that i have to do changes in my .profile file. Can some one help me out with this and tell me how do i do so! Thank You Last edited by a25khan; 12-06-2003 at 11:27 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
If you use (ba)sh, try
export PS1='[\u@\h]$' But I don't think it's a security feature having to remove the current directory from the shell prompt. It's just inconveniencing yourself when you need to use relative paths and don't know whether your current directory is the one intended. |
|
#3
|
||||
|
||||
|
Hello cbkihong,
Yes I use bash and it worked Last edited by a25khan; 12-07-2003 at 07:13 AM. |
|
#4
|
||||
|
||||
|
I dont know about you, but I really like to know what directory I am in... and whether I am root or not...
I use this as my root prompt. So I know for a fact when root is logged in and where I am. That is 2 lines on purpose for root... if you were wondering. PS1="`hostname`-$LOGNAME:\${PWD#*} # " For my users, I use this prompt. PS1="`hostname`:/\${PWD#*}> "
__________________
My brain is your brain |
|
#5
|
||||
|
||||
|
Hi there,
ok i used the command you posted i.e. PS1="`hostname`:/\${PWD#*}> " But can you tell me how does this work? I mean what is PS1 (i guess it's a variable)? Why do you have a hash sign after pwd and what about the curly braces? And you are redirecting it with ">". Can you please elaborate on the above? Thank you |
|
#6
|
|||
|
|||
|
you can type command 'set' to view all command prompts.
PS1 to PS4 PS1 is default shell prompt PS2 is secondary prompt string. If you type command like ls -l "file* and then press enter. Then you will see this prompt. PS3 is a selection prompt string and it is used for select loop usually. The prompt lets user know that who need to enter something to reply to the script. PS4 is used for execution trace. If you have a script and the content is ls -l Then you run it as ksh -x scriptname Then you will see a symbol before each process for execution trace. Which is useful for troubleshoot any script errors. About the prompt question, PS1="`hostname`:/\${PWD#*}> " `hostname` I think that you should know the this part. ${PWD#*} To get the same prompt, then I will type export PS1=`hostname`':/$PWD >' ">" it doesn't mean redirect because it has been quoted by double quotes
__________________
tikual :) |
|
#7
|
||||
|
||||
|
My prompt appears as follows for root:
THIS : PS1="`hostname`-$LOGNAME:\${PWD#*} # " GIVES THIS: hostname-root:/root #
__________________
My brain is your brain |
||||
| Google The UNIX and Linux Forums |