1. 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[\[\e[32;40m\]\u@\w] The parameters com
Due to the frequent use of the end (Zhuang) side (BI), each opening is the sauce of the drop:or after entering a few levels of directory, it becomes Jiangzi:True XX ugly! And just lose a few orders. What do we do? Very simple, in two steps:STEP1: Modify Computer nameAs above, "@" and ":" Between the host name, that is, chris-laptop-thinkpad-x240, for example, can be changed to X240(1) Modify/etc/hostname sudo vim/etc/hostname , the file in a host name, instead of X240:(2) Modify/ect/hosts sud
also stop programs: taskkill/f/im Java.exeWith this command, when we are going to end the java.exe running in Cmd.exe, we only end java.exe, and this time the CMD will be ended.4. Call PS1 or batch file (invoke-expression) using dot (.)Grammar:.Description: You can call an existing PS1 file in the PowerShell interactive environment and in the PS1 file, using the
off flashing
27 Turn off the reverse image
30 setting Black foreground
31 Setting the red foreground
32 Setting Green foreground
33 Setting Brown foreground
34 Setting Blue Foreground
35 Setting Purple foreground
36 Setting Cyan Foreground
37 Setting White foreground
38 underline on the default foreground color
39 Close the underline on the default foreground color
40 Setting black background
41 Setting Red background
42 Setting Green Background
43 Setting Brown background
44 Setting Blue backg
you can also stop programs: taskkill/f/im Java.exe
With this command, when we want to end the Java.exe running in Cmd.exe, we only end the Java.exe, this time CMD will also be ended.
4, use Point (.) Call PS1 or batch file (invoke-expression)syntax:.Note: You can invoke an existing PS1 file in the PowerShell interaction environment and PS1 file, using dots (.)
variable is changed, it will take effect the next time the user logs on, and if you want to take effect immediately, execute the following statement:
Source/etc/profile
It should be noted that it is best not to put the current path "./" Into the path, which may be subject to unexpected attacks.
Other files are modified in the same way, it should be noted that/etc/environment does not need to use export to set environment variables, other profile files need.
A more detailed description can be
defining an alias, there can be no spaces on either side of the equals sign, or the shell cannot determine what you need to do. Quotation marks are required only if the command contains spaces or special characters.If you type the alias command without any parameters, all defined aliases are displayed.PromptBash has a level two prompt. The first-level prompt is what bash often sees when waiting for a command to enter. The default value for the first-level prompt is the $ symbol. If the user doe
The default path hint is the full path, so the line is long and may take up the full width, looking very uncomfortable! Just like this.[Email protected]:~/trunk-new/build_dir/target-mips_34kc_uclibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.17/net /netfilter/commercials$Basically occupy the width of terminal 80%, if it can be changed to show only the last folder name is good!Modification Method:Vim ~/.BASHRCSearch PS1If ["$color _prompt" = yes]; Then ps1
/passwd9. Modify user account Information command : usermod Command http://www.jb51.net/LINUXjishu/57943.html(1), add Newuser2 to the group staff# USERMOD-G Staff Newuser2(2), Modify the NewUser user name is newuser1# usermod-l newuser1 newuser(3), lock account Newuser1# usermod-l Newuser1(4), lifting the lock on the Newuser1# usermod-u Newuser1Modify the Linux command prompt http://blog.csdn.net/zhujiangm/article/details/4000709Linux modifies the environment variable
. Profile is a file that is read by the login user after logging in and reads the. bashrc file, regardless. . BASHRC is a file that is read by a non-login user, such as the command line Input bash also reads the file, and the main personal settings can be placed here My. BASHRC currently only adds the PS1 settings and the corresponding increased environment variable settings: # Set PS1 export
In previous techniques you can observe the use of "-erroraction stop" combined with "exception capture command" To catch a PowerShell command error, but after using this mode of operation, the script will stop after the first error occurs.
Here's an example: Use PowerShell to scan a folder recursively. It will not be able to finish capturing all the intermediate exceptions (for example, some subfolders are protected by Access).
Copy Code code as follows:
Try
{
Get-childitem-p
= "Update AAA set num =?";PreparedStatement PS1 = conn.preparestatement (SQL1);Ps1.setstring (1, "4");//For precompiled SQL, string type, other types can be optional such as: Ps.setint (1, 199); Regardless of the type of field, as long as the data can be turned over, it can be int/double, etc.Ps1.setstring (2, "id1");int executeUpdate1 = Ps1.executeupdate ();if (
PS: This requirement was launched by a small camel. Thank Microsoft Cloud Solution Exchange 236804566 for this high-end group of user contributions.Let's start by looking at how a standard array is entered.PS d:\> $arr = "ADF", "Asdfer", "Sredsaf" PS d:\> $arradfasdfersredsafIt is important to note that the double quotation marks and the comma are separated. I have to say, this is the simplest way to enter, but the input method is not very friendly, users need to change the PowerShell scriptTo f
The LINUX text interface is beautifully integrated-Linux general technology-Linux technology and application information. The following is a detailed description. This morning, I watched the Helper's CENTOS interface very beautifully. I also wanted to work on it.
It turns out to be PS1, which can be modified in/ETC/BASHRC. Now the PS1 value is displayed.
'\ 033 [1; 33m \ H \ 033 [1; 34 m [\ w] \ 033 [
updateserver parameter is not specified, the local server currently running invoke-wsusservercleanup is used by default.
The script for creating wsusclean. PS1 is as follows:
Invoke-wsusservercleanup-cleanupobsoletecomputers-cleanupobsoleteupdates-cleanupunneededcontentfiles-compressupdates-declineexpi1_pdates-declinesupersededupdates
Place the preceding script in the C-disk scripts directory of the WSUS server (or in other paths, you need to modif
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.