Modify the command line path length in linux.
The default path prompt is the complete path, so that a line is too long and may occupy the full width! As shown below:
jack@ubuntu:~/trunk-new/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.17/net/netfilter/commercials$
It basically occupies 80% of the terminal width. If you can change it to show only the name of the last folder!
Modification method:
Vim ~ /. Bashrc
Search PS1
When accessing the ps1 file, be sure to check whether the access path contains spaces.
Spaces must be enclosed in single quotes.
PowerShell-command Set-ExecutionPolicy "Bypass" set filepath = '% CD % \ AppDeployment. ps1 'powershell-command " % filepath %" Pause
Incorrect syntax:
Ps c: \> C: \ Documents ents and Settings \ Mingle \ My Documents ents \ PS \ test.
/profile: This file presets several important variables, such as PATH, USER, LOGNAME, MAIL, INPUTRC, HOSTNAME, HISTSIZE, umas, and so on.
/Etc/bashrc: This file mainly defaults umask and ps1. This PS1 is the character in front of the command. For example, in my linux system, PS1 is [root @ localhost ~]. #. Check the PS1
Introduction to PowerShell and Bash, powershellbash
PowerShell is a script running on windows, While Bash is a script running on linux.
What bash can do now can also be done by PowerShell. What makes PowerShell powerful is that it can manage windows servers (especially domain ), currently, open-source PowerShell can also manage Linux and Mac (via PSRP ).
1. powershell Program
2. Create a script, simple Helloworld. ps1
Task automation is based on prog
, run the start Command, as shown below :? Ps c: \ Users \ v-lukez> start notepad-WindowStyle MaximizedPS C: \ Users \ v-lukez>
The above results can maximize the Notepad window. In fact, there are many similar commands, and more parameters mean more precise control.
Ii. Create a script
Task automation is based on program files or executable script files. PowerShell also supports making command lists into script files for execution. The content of the Hello.
, 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 follows:PS1 = '$ {debi
} $ {BASH_VERSION %. * }$ {CYAN}-DISPLAY on $ {RED} $ DISPLAY $ {NC} \ n"Echo-e "$ {RED} RED $ {BLUE} BLUE $ {cyan} cyan $ {GREEN} GREEN $ {NC }"Echo-e "$ {CYAN} white $ {WHITE} blod white $ {NC} no color !! "Echo "$ {CYAN} white $ {WHITE} blod white $ {NC} no color !! "# Note this sentenceThe running result is as follows:
Note: The-e parameter must be added to output the color correctly.(-E explanation:-e enable interpretation of backslash escapes | meaning that the backslash can be interpreted
/lesspipe] eval "$ (SHELL =/bin/sh lesspipe) "# set variable identifying the chroot you work in (used in the prompt below) if [-z" $ {debian_chroot: -} "] [-r/etc/debian_chroot]; then debian_chroot = $ (cat/etc/debian_chroot) fi # set a fancy prompt (non-color, unless we know we "want" color) case "$ TERM" I N xterm-color) color_prompt = yes; esac # 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 wind
I saw a command line prompt from my colleagues on my system (Linux), which had a color and smiling face.
I think it's cool, and I also copied it,
Display Policy: current user, time, current directory,
If a common user displays a smiling face, the user can operate it at will and follow the $ prompt.
If a superuser shows a suface:-| it means to be cautious with the operation and follow the # prompt.
Create a ps1.sh file in/etc/profile. d/an
Three-way handshake In TCP, one end that initiates a request is called the "client", and the other end of the passive connection is called the "server 』. Both the client and the server can send and receive data after the TCP connection is established. At first, both the server and client are in the closed status. Before communication starts, both parties must create their respective transmission control blocks (TCB ).After creating a TCB, the server enters the listen status again. At this tim
/debian_chroot]; then debian_chroot = $ (cat/etc/debian_chroot) fi # set a fancy prompt (non-color, unless we know we "want" color) case "$ TERM" I N xterm-color) color_prompt = yes; esac # 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 # shocould 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> /d
!! "# Note this sentenceThe running result is as follows:
Note: The-e parameter must be added to output the color correctly.(-E explanation:-e enable interpretation of backslash escapes | meaning that the backslash can be interpreted)
2. Modify the command prompt (that is, [root @ CentOS ~] #)We can give [root @ CentOS ~] # Add color and custom format:
Modify/etc/bashrc to achieve our goal:Vi/ete/bashrc, which is the same as above, is roughly changed to the following format (the color can be ch
4.2 Standard Interface
Python comes with library files for some standard modules. These library files are described in a separate document (python library file Introduction. Some modules are created in the interpreter. They provide non-verbal core operations that are not included in the interpreter for efficiency, or provide access to the underlying operating system, for example, system call. These modules ge perform different selection Configurations Based on the underlying platform. For exampl
The CentOS version of the Linux command prompt is the default color, sometimes tired of watching, so give it a bit of color to see.Command prompt symbol is made to PS1, it's help description can be man bash under Search PS1 can view, some function parameters, I do not introduce, at the command line input:[email protected] etc] #PS1 = "\[\033[1;32m\][\[\033[1;31m\
Ubuntu8.04JDK6.0 installation problems-general Linux technology-Linux programming and kernel information, the following is a detailed description. My younger brother is depressed when using windows, so I want to use Linux to install ubuntu8.04 today (the first time I used linux OS) And then I want to install JDK to learn JAVA.
Install JDK in/usr/local/lib/jdk1.6.0 _ 10.
The profile configuration file is as follows:
#/Etc/profile: system-wide. profile file for the Bourne shell (sh (1 ))
# And Bo
Lock" for 3q)
\ 033 [15: 40 H move close to 15th rows, 40 Columns
\ 007 beep
#######################
How to change the font and background color of RedHat:
Command:
PS1 = "[\ e [32; 1 m \ u @ \ h \ W] \ $"
Or
Export PS1 = "[\ e [32; 1m \ u @ \ h \ W] \ $" for the differences between the two, please refer to the relevant information of environment variables.
Explanation:
\ E [32; 1 m: This is the escape cha
of the color display) 5 set flashing 7 set reverse image 22 set general density 24 turn off underline 25 turn off blinking 27 turn off reverse image 30 set black foreground 31 set red foreground 32 set green foreground 33 set brown foreground 34 set blue foreground 35 set purple foreground 36 set cyan foreground 37 set white foreground 38 set underline on default foreground color 39 disable underline on default foreground color 40 set black background 41 set red background 42 set green backgrou
. The message segment is syn=1,ack=0,seq=x in the head. After the request is sent, the client enters the syn-sent state.* PS1:SYN=1,ACK=0表示该报文段为连接请求报文。* PS2:x为本次TCP通信的字节流的初始序号。TCP regulation: Syn=1 message segment can not have data parts, but to consume a sequence number.Second handshakeAfter the server receives the connection request message segment, if the connection is agreed, a reply is sent: Syn=1,ack=1,seq=y,ack=x+1.When the answer is sent, it e
There are many system variables in the Linux system, so where do these variables exist? Why do users automatically have these variables when they log on to the shell? Several configuration files are described below.1,/etc/profile: This file presets a few important variables, such as path, USER, LOGNAME, MAIL, INPUTRC, HOSTNAME, Histsize, Umask, and so on. You can edit the file to add variables to this file, but this is not recommended. If you need to change a variable or add a variable we can cr
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