225k views
3 votes
How would you change your prompt to have it display the current time (hour and minute) and the full path of the current directory?

1 Answer

3 votes

Answer:I tried using following command:

Code:

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.

Code:

$ export PS1="$(date +%k:%M:%S) $ "

17:42:42 $

17:42:42 $ date

Tue Oct 2 17:42:54 PDT 2012

17:42:42 $

Step-by-step explanation:

User BiBi
by
8.0k points

No related questions found