how to change unix cmd display prompt?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to change unix cmd display prompt?
# 1  
Old 05-23-2011
how to change unix cmd display prompt?

I am new to to unix and I want to make my own basic shell. What is the code I can use to change the unix cmd console display? For example my unix display prompt says MyCompterName~, I want it to say WhatEverMan~
# 2  
Old 05-23-2011
Code:
export PS1="whateverMan\w \$ "

# 3  
Old 05-23-2011
does that still allow me to use unix regular commands too?
# 4  
Old 05-23-2011
It just changes your prompt, you can set it in your .bashrc file in your home directory and then your setting will be applied each time you start a shell.

There are a number of special character strings available for use in the prompt string have a look at the list here http://www.cyberciti.biz/tips/howto-...up-prompt.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Prompt path display issue

I use the following command to print the current directory above the command prompt set prompt="`exec pwd`\n$USER@`hostname -s` %B: % > " The output is something like this <current path> $USER@hostname > But when I try to CD to any other directory and press the return key, the... (6 Replies)
Discussion started by: aelhosiny
6 Replies

2. UNIX for Dummies Questions & Answers

How to Change the % prompt to - prompt in UNIX?

how to Change the % prompt to - prompt in unix :wall: ---------- Post updated at 07:40 AM ---------- Previous update was at 07:38 AM ---------- How To display the last modification time of any file in unix ---------- Post updated at 07:40 AM ---------- Previous update was at 07:40 AM... (2 Replies)
Discussion started by: manjiri sawant
2 Replies

3. Shell Programming and Scripting

How to display current time in the prompt

Hello All, I would like to display the current time in prompt. I tried using following command: export PS1="$(date +%k:%M:%S) $ " but it gave me a fixed time in prompt whereas my objective is to get the current time everytime. $ export PS1="$(date +%k:%M:%S) $ " 17:42:42 $ 17:42:42 $... (32 Replies)
Discussion started by: manishdivs
32 Replies

4. Shell Programming and Scripting

Use Unix shell script to open Windows command prompt (cmd)

Hello, I work on Windows and I use Putty to access a remote UNIX server. I am trying to build a shell script that will have as main task to open the Windows command prompt (cmd) and run some Windows commands thereafter. The commands are actually file transfer commands that will download a file... (14 Replies)
Discussion started by: rookie2785
14 Replies

5. Windows & DOS: Issues & Discussions

script to open new cmd prompt for devices on visio

Hello, Can any one please help: I have a lab design on Visio, with routers and switches. What I am planning to do is: when I double click a device icon - it should open a new cmd prompt window and automatically performs the telnet session and log's me into the device. Appreciate your... (0 Replies)
Discussion started by: sureshcisco
0 Replies

6. Shell Programming and Scripting

Unix cmd prompt how to get old cmd run?

Hi, I am using SunOS I want to serch my previous command from unix prompt (like on AIX we can search by ESC -k) how to get in SunOs urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies

7. UNIX for Dummies Questions & Answers

Where to change the UNIX password prompt?

Hi guys, I got these 3 servers: a, b and c which I ssh from a to b/c. a:$ ssh userid@b Password: a:$ ssh userid@c userid@c's password: Notice that the password prompt is different (highlighted in bold) on both servers even though their SUN Solaris version the same, OpenSSH version... (0 Replies)
Discussion started by: DrivesMeCrazy
0 Replies

8. Shell Programming and Scripting

Interaction shell cmd prompt

hi , how do i interact with the shell prompt. i need no. of args to be dynamic e.g $> type the no of args: <input from keyboard> Enter the 1 st arg : <input from keyboard> Enter the 2nd arg : <input from keyboard> ......... ......... let me know how to do it ... (1 Reply)
Discussion started by: adityamahi
1 Replies

9. Solaris

no boot prompt display

just put blank harddisk in my ultra10. i see no display to show me the boot> prompt. i don't know what happened....?? Got a third party graphic card. Display was ok. Monitor seems to be ok. i used different one with same result. (1 Reply)
Discussion started by: S26+
1 Replies

10. Shell Programming and Scripting

display previous cmd

how can i program shell to appear previous cmd on the cmd line when i press up arrow key thanx yy990605 (3 Replies)
Discussion started by: yy990605
3 Replies
Login or Register to Ask a Question