Basically it follows the format username @ hostname:working_directory ~:$ by default. Eg: something like: user@Ubuntu-pc:~/Desktop:~$.
But sometimes you might want to hide these information, because of privacy reasons. You can actually do that. These values are controlled by the bashrc file in Linux.
Prompt variable control and configure the command-line structure. There are many prompt variables in bashrc. We can add our own custom variable if necessary. We will only concentrate on the PS1 variable for this article.
Open a terminal and type the following:
echo $PS1
\u indicates the username
@ indicates the @ sign
\h indicates the hostname (computer name)
: indicates the :character
\w indicates the working directory
\$ indicates a $ if you’re a normal user account or # if you’re root.
So, putting that all together, you get username@hostname:working_directory$.
In order to hide this and show something like ~:$ alone, then you can refer the steps below.
Run the commands:
# uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes if [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) color_prompt=yes else color_prompt= fi fi if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt
If you need video assistance please watch the video below.
As a LastPass user, you might have noticed the changes introduced last day. The message… Read More
This post presents with a few bunches of AWS network security checklist. It is basically… Read More
What is this web security checklist? Here is a curated web security checklist for developers… Read More
In the last part of the blog series we have seen the history of internet… Read More
Welcome back budding pen-testers. :) In the first part of the blog series we have… Read More
Last day I was riddling with Evilginx, a phishing attack tool. It needs to be… Read More
Leave a Comment