Question about .bashrc

Bret Busby bret at busby.net
Sat Sep 9 10:49:11 UTC 2023


On 9/9/23 17:55, Peter Flynn wrote:
> On 09/09/2023 09:30, Bret Busby wrote:
>> Hello.
>>
>> I am wondering whether it is possible to set .bashrc to display, at 
>> terminal prompts, the date and time in ISO format, rather than in the 
>> USA format, and, if so, what setting(s) to apply.
> 
> Something like
> 
> export PS1="\u@\H \D{%Y-%m-%d}> "
> 
> at the command line, as a test.
> In .bashrc, use set instead of export.
> 
> https://phoenixnap.com/kb/change-bash-prompt-linux
> 
> Peter
> 

Thank you.

2023-09-09 18:38:26 bret at bret-Precision-Tower-5810:~ >

What I did, was opened .bashrc with the text editor, used the Find 
function from the menu, to locate the applicable setting (the file is 
120 lines long), copied the
\D{%Y-%m-%d}
from your message, and replaced the
\d
in the applicable setting, and
replaced the
$
with
<space> '>'
(not sure how to correctly express that last line, but, I replaced the 
dollar symbol with a space, followed immediately by the "greater than" 
symbol)


..
Bret Busby
Armadale
West Australia
(UTC+0800)
..............




More information about the ubuntu-users mailing list