31
loading...
This website collects cookies to deliver better user experience
git push
git pull
git commit
python main.py
gcc/g++ main.cpp
nano ~/.bashrc
~/.bashrc
file. My terminal currently looks like this. ~/.bashrc
will start with ${debian_chroot:+($debian_chroot)}
, but we can ignore that. If you've never customized the prompt, it will look like PS1=" \u@\h:\w$"
these are escape sequences that tell bash what to put in the prompt.\u
means the logged-in user's username\h
is the hostname of the computer\w
is the current working directory"\u@\h:\w $"
becomes username@computername:workingdir$
. To add the date, time, customize the working dir, and add colors, we need to add more escape sequences.\ d' the date format will be
Day of week Month Day`\ d', my prompt looks like
Thu Jun 24 jwald@Momo-pc:~/blog$`\T
\t
\@
\@
escape sequence, so now my prompt is Thu Jun 24 12:53 jwald@Momo-pc:~/blog$
, and the prompt string is PS1=" \d \@ \u@\h:\w$"
\w
is the working directory, so I'm going to change my prompt string to look like this PS1=" \d \@ \u@\h:<\w>$"
. Now it looks like this.