Operating Environment:
System: Mac 10.12
Editor: Vim
One, no brain configuration:1. Open the Midrange input:VI ~/.bash_profile2. Open and edit the. bash_profile file:Press keyboard "I" to enter edit modeCopy the following code:Export clicolor=1export PS1="Press esc--"W" and press "Q"--"restart terminal--" complete!Second, advanced operation:Escape characters:The above example uses a backslash-escaped sequence of characters to notify
Bash inside the variable PS1 is the user's usual prompt, the system defaults to [[email protected] working directory]$. For more information about PS1, see: http://www.cnblogs.com/starspace/archive/2009/ 02/21/1395382.htmlIn the article, it is introduced that the PS1 modification is required to be written to the ~/.bash_profile in the restart, but this is for the
The meaning of the prompt in the PS1 variable:\d: Represents the date, in the format weekday month date, for example: Wed Dec 12\h: Full host name. For example: hostname is debian.linux\h: Take the first name of the host only, as in the example above, then the debian,.linux is omitted \ t: Display time in 24-hour format, such as: hh:mm:ss\t: Display time 12 hours format \a : Display time is 24 hours format: hh:mm\u: The current user's account name suc
If you don't want to talk about it, first glance at my command line prompt (a little big ):
The command line in the figure is as follows:Calendar [date of the Gregorian calendar/date of the lunar calendar]Else [number of directories under the current directory + number of items below the current directory] [current absolute Directory]Users [username @ host name-the number of terminals required _ hosts]
Related configuration files
Global configuration file:/etc/bash. bashrc or/ect/bashrc
Single-
Take bash shell as an ExampleIn general, the default. bashrc should be:~ /. BashrcExport PS1 = '\ U @ \ H: \ W \ $'The above means: user @ host: Current directory $Escape SequenceIf you use a colored prompt to increase personalization, you need to use escape sequences. The escape sequence is a control command that allows shell to execute a special step. Generally, escape sequences start with ESC (which is also the reason for its naming ). ^ [. This re
[Email protected]:~$ vim. BASHRC ps1= ' ${debian_chroot:+ ($debian _chroot)}\[email protected]\033[1;33mhttp:// 990487026.blog.51cto.com\e[m\w\$ 'Save, create a new window:Look at the effect:650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/83/B8/wKiom1d7OeTDs4mHAAAV8u1xAgI702.png "title=" 1467693446.png "alt=" Wkiom1d7oetds4mhaaav8u1xagi702.png "/>This article is from the "Soul Bucket" blog, please be sure to keep this source http://99048702
Prompt "Unable to load file PS1 when running PowerShell directly because scripting is forbidden in this system." For more information, see "Get-help about_signing".Mainly because there is no permission to execute the script.Run Get-help about_signing tips to understand execution policy inputGet-executionpolicyShow RestrictedThe execution of any script is not allowed.by commandGet-help Set-executionpolicy has the following execution strategy:Then modif
Linux environment variables PS1 set linux environment variables PS1 in simple words is to set the command prompt to display the content, as follows: www.2cto.com 1root@10.1.1.200 :~ # The meaning of the prompt in the PS1 variable: \ d: represents the date in the format of weekday month date, for example, Wed Dec 12 \ H: complete host name. For example, the hostna
Linux host name color settings, ps1 settings, but linux has a color RedHat font and background color change method: Command: PS1 quot; [\ e [32; 1 M \ u @ \ h \ W] \\$ quot; or exportPS1 quot; [\ e [32; 1 M \ u @ \ h \ W] \\\ quot; for details about the differences between the two, see the description of environment variables: \ e [32; 1... linux host name color settings,
In Linux the end of the input command, because all are black white paper, always do not know that line is the command of their own input, which is the result of the command.In the Internet search, the original to modify the/ETC/BASHRC global configuration file or the ~/.BASHRC file.1.ps1to modify the Linux terminal command line color, we need to use the PS1,PS1 is an environment variable for Linux end users
Modify the. bashrc file in the user's home directorySet a new PS1 value that overrides the system's default valueExample: ps1= "[\[email protected] \w]\$"X Note: No spaces on both sides of the equals signThe usual escape characters and meanings are as follows:# \d: can display date format [day of week]# \h: Full host name# \h: Take the name of the hostname before the first decimal point# \ t: Display time,
Tags: script original round directory Mat code error REAC desMy original PowerShell script to share.Scripting Purpose: Lists files in a directory where all software signatures do not match.System requirements: Win7 + PowerShell 2.0 and above.#nd your file has been tampered with by hackers. PS1 the PS1 document should be saved as a Unicode document that contains the BOM header. #Enter a directory to verify t
First, the experimental environment:installed a Red Hat Enterprise Linux 6.0 can run the system and is a successful verification system. There is another unprivileged user student, password student account exists. Second, the experimental requirements:1 , using alias Create aliases2 , using PS1 Modify Bash the prompt3 , write a simple Shell Small ProgramThird, the experimental steps:Create aliases C:[[Email protected]~]$ alias c= ' Clear ' [[email pro
Linux host name color settings, ps1 settings, but linux has a color RedHat font and background color change method: Command: PS1 = "[\ e [32; 1 m \ u @ \ h \ W] \ $ "or export PS1 =" [\ e [32; 1 m \ u @ \ h \ W] \ $ "for the differences between the two, please refer to the Environment Variable related information explanation: \ e [32; 1 m: this is the escape char
Bash PS1 in LinuxChatting with a friend, he said he had such a confusion when using Ubuntu: using the cd command in bash, after entering some deep directories, or after directories with very long names, the bash command prompt is so long that every command will wrap
Hadoop-mapred @ hdp32:/etc/opt/directorynameisfuckingsolong/my/name/is/spazzzz $This is similar to the above situation... this is the problem with the bash command prompt variable
Many people in the use of Linux, the prompt is not too much attention, can use a good prompt can be more intuitive to see, for their own judgmentLinux has PS1 PS2 PS3 PS4 Four class prompt, these four variables are environment variables, as to what environment variables in the system, you can use the command "env" to viewPS1 Command PromptPS1 has those configuration, or PS1, that can be configured with a co
characters
Therefore, you can specify your preferred command prompt format based on these settings:
PS1 = "/u @/h:/W/$"However, the prompt displayed after this setting has no color. If you want to add a color setting, you can do this:
PS1 = "/E [1; 32 m/u/E [m/E [1; 33m @/E [m/E [1; 35 m/h/E [M: /W/$"At this point, the display in the terminal should be a color prompt, where/E [1; xxm and/E [m is the part t
PS1 scripts are all executed and can be executed directly through Windows PowerShell, but what if we want to execute a PS1 script on a regular basis? We can implement this requirement by: System planning task, the implementation method is shown below
Open: Computer Management, right-click: Task Scheduler, new Basic task,
650) this.width=650; "width=" 639 "height=" 271 "title=" image "style=" b
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.