"Hello,/
> My friend"
Hello, my friend
Prompt
In linux, the prompt is usually $, which is already the root user #. This is related to the specific linux version. We can also set our prompt, such as adding the user name and time. In Linux with four prompts, PS1, PS2, PS3 and PS4. PS1 is the default prompt. For example, we need to change the user name to $. You can reset
Q: How can I change the shell display mode to [complete working directory of username @ host] $ to [last working directory of username @ host] $
Solution: Add export PS1 = '[/u @/h/W]/$' to. bashrc'
Note:
In Linux, there are two variables for the system prompt: PS1 and PS2. PS1 is the system prompt. The general format is:[Username @ hostWorking directory] #, t
(remember to back up to avoid failure ). [Cpp] #/etc/profile: system-wide. profile file for the Bourne shell (sh (1) # and Bourne compatible shells (bash (1), ksh (1), ash (1 ),...). if ["$ PS1"]; then if ["$ BASH"] ["$ BASH "! = "/Bin/sh"]; then # The file bash. bashrc already sets the default PS1. # PS1 = '\ h: \ w \ $' if [-f/etc/bash. bashrc]; then. /etc/ba
Linux Shell Command Prompt and color modification, linuxshell
1. Sequence of loading configuration files during Linux Logon:
/Etc/profile →/etc/profile. d/*. sh → ~ /. Bash_profile → ~ /. Bashrc → [/etc/bashrc]You can view the default ~ The/. bashrc file is as follows:
1 [root@localhost ~]$ cat ~/.bashrc 2 # .bashrc3 4 # User specific aliases and functions5 6 # Source global definitions7 if [ -f /etc/bashrc ]; then8 . /etc/bashrc9 fi
2. The Shell command prompt and color are configured by
["$ PS1"]; then # if the shell environment exists and is not sh, read/etc/bash. bashrc if ["$ BASH"] ["$ BASH "! = "/Bin/sh"]; then # The file bash. bashrc already sets the default PS1. # PS1 = '\ h: \ w \ $' if [-f/etc/bash. bashrc]; then. /etc/bash. bashrc fi else if ["'id-U'"-eq 0]; then PS1 = '# 'else
Nbsp; Shell is divided into user and root. With "su", you can achieve switching. The shell color control is implemented through the PS1 system variable operation in the/home/user/. bashrc and/root/. bashrc files! /Home/user/. bashrc and/root/. bashrc correspond to user and root respectively. First
Shell can be divided into user and root. With "su", you can achieve switching.The shell color control is implemented through the
; export PATH
(6) shell Environment Variables
CDPATH is used to find the path of the cd command.
HOME/etc/passwd file
IFS Internal Field Separator. The default value is space, tab, and line feed.
Use MAIL/var/mail/$ USERNAME mail and other programs
PATH
PS1, PS2 default prompt ($) and line feed prompt (>)
TERM terminal type. Common types include vt100, ansi, vt200, and xterm.
Example: $ PS1 = "test:"; e
log on to the system, and the commands contained in it are executed by bash.
This file defines the basic environment of the user's logon account, including the PATH of the PATH and some alias settings.
If you change the content of your. bash_profile file, the change will not take effect until you log out and log on again, and the file is read again. If your temper is urgent, use source. bash_profile to make the change take effect immediately.
My personal. bash_profile file configuration is as f
progress, the code accesses the memory card, and most of the time there is nothing wrong ... But the occasional read-write will time out ... There's no obvious reason. A short write often destroys the memory card. Players want to save the progress, not only do not save, but also erase their memory card all things. Oh, my God.After a while, we panicked at the Sony producer Connie Booth. We obviously can't release the game with this bug, and after six weeks I have no clue what the problem is. Thr
to a server, will use the user's default shell to launch login shell mode. The shell in this mode will automatically execute the/etc/profile and ~/.profile files, but will not execute any of the BASHRC files, so generally/etc/profile or ~/.profile we will manually go to source bashr C file. The case of the No-login shell is the shell we launched directly under the terminal with bash or bash-c "CMD". This mode is not automatically run any profile files.Interactive shell and non-interactive shell
Linux Modify shell command prompt and color1. Load the configuration file sequence during the Linux login process:/ETC/PROFILE→/ETC/PROFILE.D/*.SH→~/.BASH_PROFILE→~/.BASHRC→[/ETC/BASHRC]You can view the default ~/.BASHRC file as follows:[Root@~/wade/codereview/redis-2.8.17]cat ~/. BASHRC #. Bashrc# User specific aliases and Functions# Source Global Definitionsif [-f /etc/BASHRC ]; then. /etc/bashrcfi 2. shell command prompt and color is configured by
Zhanhailiang Date: 2014-10-181. Load the configuration file sequence during the Linux login process:/ETC/PROFILE→/ETC/PROFILE.D/*.SH→~/.BASH_PROFILE→~/.BASHRC→[/ETC/BASHRC]You can view the default ~/.BASHRC file as follows:[Root@~/Wade/Codereview/redis-2.8.17] Cat~/. BASHRC#. BASHRC# User specific aliases and functions# Source Global Definitionsif [ - F /etc/Bashrc]; Then./etc/Bashrcfi2. shell command prompt and color is configured by PS1:[Root@/etc/I
instance of */
Access the name of the person store property and assign a value P.name = "Caocao"//Call Method P.say ("The Emperor to make the World") print (p.name) struct Size {var width = 0, height = 0} Struct's parameterless constructor var s = size ()//appears to initialize the value to be called, var d = Dog () The error is var size = size (width:10, height:20)//struct Initializes a all storage property of the constructor var dog = Dog (name: "Mong Wang", age:2)//mark:-The class of value
Tags: text place set national command line standard LLD warning features2nd Chapter PS1 (environment variable)Variable: x+y=10 known x=11 y=?Environment variables: Features
uppercase
meaning (can be used in most places in the system meaning basically unchanged)
system creation PS1 ===== martial arts cheats (sunflower treasure) Echo $PS 1 ===== book
used by the current system[[emailprotected] ~]#echo $SHELL /bin/bashView all shells supported by the system[[emailprotected] ~]#cat /etc/shells /bin/sh /bin/bash /sbin/nologin /usr/bin/sh /usr/bin/bash /usr/sbin/nologin /bin/tcsh /bin/cshCommand Prompt--prompt##### 1. The shell command prompt and color is configured by PS1 and can be customized to suit your needs.显示提示符格式:[[emailprotected] ~]#echo $PS1\[\e[
System.Management.Automation.PSCredential ("administrator", $secpasswd)Start-Process "C:\Program Files (x86)\TeamViewer\TeamViewer.exe" -Credential $mycredsThe next step needs to be compiled into EXE. Here need to explain that PowerShell does not really ' compile ' into an EXE, his essence is to compress after processing exe shell. Generally can be compiled with PowerGUI this software, but I am too lazy to download the installation of such a large software, directly with PowerShell script can a
] ~]# echo $abc
8.9 environment variable configuration fileThe environment variable profile can be divided into two dimensions: the system environment variable profile and the user environment variable configuration file.System configuration file (no changes allowed)
/etc/profile user Environment variables, interaction, login only execution
/ETC/BASHRC user does not need to log in, the execution shell is effective user profile
~/.bashrcThis file contains bash information
structure, and you can see that Pstree is running in the new bash, Echo $hll, which is the same as the global variable, which takes effect down, and the parallel bash does not take effect.unset custom variable name//Cancel custom variable#bash//Enter a new sub-shellIII. environment variable configuration fileenvironment variable configuration file/etc/profile and/ETC/BASHRC belong to the system level, generally do not modify;Can modify the user's home directory ~/.BASHRC ~/.bash_profile These b
Linux Modify shell command prompt and color1. Load the configuration file sequence during the Linux login process:/ETC/PROFILE→/ETC/PROFILE.D/*.SH→~/.BASH_PROFILE→~/.BASHRC→[/ETC/BASHRC]You can view the default ~/.BASHRC file as follows:[Root@~/wade/codereview/redis-2.8.17Cat ~#. BASHRC # User specific aliases and functions c10># Source Global Definitions/etc/bashrcfi 2. shell command prompt and color is configured by PS1:[Root@/etc/init.d$PS 1[
.
Prompt
Bash has two levels of prompt. The first-level prompt is often seen when Bash is waiting for command input. The default value of the first-level prompt is the $ symbol. If you do not like this symbol or want to define a prompt, you only need to modify the value of the PS1 variable. For example, change it:
PS1 = "Enter a command :"
The second-level prompt is displayed when you need to en
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service