In CentOS ulimit to explain to you before, let us know the next CentOS ulimit, then a comprehensive introduction CentOS ulimit, hope to be useful. CentOS ulimit value (Linux file handle number) in CentOS5 (RHEL5) of the adjustment.
Following the deployment of applications in Linux, when sometimes encounter Socket / File: Can't open so many files in question, such as Squid do have agency, when the file open count of more than 900 per hour will drop very fast, there is could not open page.
In fact, Linux is a file handle limit, and Linux the default is not very high, typically 1024, the production server is actually very easy to achieve with this number.
View Methods
We can use CentOS ulimit-a to view all limit
[Root @ centos5 ~] # Centos ulimit-a
core file size (blocks,-c) 0
data seg size (kbytes,-d) unlimited
max nice (-e) 0
file size (blocks,-f) unlimited
pending signals (-i) 4096
max locked memory (kbytes,-l) 32
max memory size (kbytes,-m) unlimited
open files (-n) 1024
pipe size (512 bytes,-p) 8
POSIX message queues (bytes,-q) 819200
max rt priority (-r) 0
stack size (kbytes,-s) 10240
cpu time (seconds,-t) unlimited
max user processes (-u) 4096
virtual memory (kbytes,-v) unlimited
file locks (-x) unlimited | | < Which "open files (-n) 1024" is the Linux operating system, a process the number of open file handles limit (also includes the number of open SOCKET, MySQL can affect the number of concurrent connections). This value can be used CentOS ulimit command to modify the However, CentOS ulimit command changes the value only for the current logged-on user's current environment and effective, system restart or user exits will be invalid. Overall system limit is here, / proc / sys / fs / file-max. Can see the current value of cat, modify / etc / sysctl.conf can also be controlled. There is also a, / proc / sys / fs / file-nr, can see the whole system, the number of file handles currently in use Find file handle problem, there is a very useful program lsof. Can be easily opened to see who handles a process. You can also see a file / directory is what the process of taking up. Modification method To make permanent changes CentOS ulimits numerical effect, you must modify the configuration files, you can modify to CentOS ulimit command into / etc / profile which, this method is not convenient, there is a way to modify / etc / sysctl.conf . I modified, tested, but the CentOS ulimits-a user will not change. But / proc / sys / fs / file-max value has changed. (I give the command into the rc.local of failure) I think the right thing to do is modify the / etc / security / limits.conf There are very detailed notes, such as * Soft nofile 32768 * Hard nofile 65536 Can also be run directly below the shell. Copy directly to your terminal to run just fine. echo-ne " * Soft nofile 65536 * Hard nofile 65536 ">> / Etc / security / limits.conf
Restrictions on the file handle can be unified into soft-32768 hard 65536. Configuration file is the front of the domain, set to star on behalf of the overall situation, plus you can make a different for different users limit attention. That among the hard limit is the actual restrictions, and soft constraints, is warnning restrictions will only make the warning. In fact, CentOS ulimit command itself is divided soft and hard settings, add-H is hard, add-S is the soft limit by default shows the soft If running CentOS ulimit command does not modify the time with it, are two parameters change with it. effect
Re-login to see modifying. (My system is CentOS5.1. Revised and re-login after immediately. Can use CentOS ulimit-a view confirmed.)
If you are using squid, you should be in / etc / init.d / squid file join CentOS ulimit-HSn 65535. In addition, in squid.conf should join max_filedesc 16384
To enable a better understanding of the various systems of common commands, I order personal computer systems over the years a number of commonly used small collection to share, we want some help! If the Hello command skills can also be with me, and shared with Oh.
2010年8月21日星期六
Eight Windows system command prompt special skills
I believe most people have already familiar with Le De Microsoft Windows user interface, but not all the features Bixujiezhu Ta can be achieved, so even in Windows 2000 and Windows XP li still Baoliu the Lei Si DOS command window, Dangrantamen and Yi Wang Windows 9x version under the command window there are many different, and therefore there are many special application skills, we might take a look together.
Click the "Start → Programs → Accessories → Command Prompt" or "Start → Run," and then enter "CMD" into the command can be prompt.
1 Using automatic memory function
Command window with the command and memory function, you enter in the window all the command line will be automatically memory down, by clicking up and down arrow keys on the keyboard can be the command just entered one by one taken out of tune, similar to the DOS in the DOSKEY instructions It just built this instruction in the command window. This memory can relieve you of the pain of repeatedly enter the same commands, for network debugging environment is particularly useful, can save you a lot of duplication of effort and valuable time.
2, fun prompt
You will be imagined to make your command prompt into the present time? Can display the current Windows XP version number? If you want to be able to achieve. Here we will teach you how to achieve.
Here we make use of a prompt in the DOS command, which a lot of useful parameters, the role of detailed parameters prompt the reader in the state of running prompt /? To Search. Understanding of the role of these parameters, you can create a path in the install file, name it as run.bat, the contents of the folder for the prompt $ V $ D $ G $ G. Next, open the Registry Editor, and then click Browse to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Command Processor \, then double-click on the right of the AutoRun key, be revised to% systemroot% \ run.bat, save your settings exit. Re-open the command prompt, how is not made changes. In fact, according to prompt the parameters as long as you can define your own rich text prompt.
3, copy the contents of the window
Copy of the string in terms of useful window for the command. But Windows 2000 and Windows XP command prompt copy, quite different from previous versions, even if not the same between the two, the former is the use of marker replication method, while the latter directly by right-clicking the replication method. Specifically described as follows:
In Windows XP, the for all, you can click the right mouse button in the "Select" to select, and for the contents of the specified range, you can right click the first election in which the "marked" item, then move the mouse to The command character to be copied Department, drag the mouse to select this string, the string will appear immediately in the form of anti-white screen, click the right mouse button or press the Enter key, then move to the target location, right-click and select "Paste "Such a command string is automatically copied to the specified location.
In Windows 2000 下, as in the command window does not support the right of the menu (Dan supports drag the mouse of choice), so it gives up one kind of simplicity of the Fang Shi Yong Geng Wei-day command characters of Fu Zhi, first you must hold down the left mouse button, drag the selected command string to be copied, they will be anti-white form on the screen, first click the mouse to the right (ie implementation of the copy operation), move your mouse over the target location, and then click the left mouse key, the command character is automatically pasted into a new location on the!
4, change the window properties
If you long to work at the command prompt can also self-adjust its appearance to suit their habits, such as their window title, color and other personalized settings, frequent use of the relevant commands are:
a) change the title: CMD / k TITLE new title name
b) to change the command character: CMD / K PROMPT [text] (text for the new command prompt)
c) to change the foreground and background colors: CMD / t: gf (g is the background color specified in hexadecimal numbers, common color have the following values: 0 black, 1 blue, 2 green, 3 light green, 4 red , 5 purple, 6 yellow, 7 white, 8 Gray, 9, light blue, A light green, B blue, C light red, D light purple, E pale yellow, F white light.
5, the command window shortcut keys
In the command window has many useful shortcut keys, can greatly accelerate the speed of your input and debugging, but some of the features also provide a graphical way.
ESC: Clear the current command line;
F7: Display the command history in the form of a graphic window shows a list of all who enter the command, and can be up and down arrow keys to select again the implementation of the order.
F8: search command history, cycle show all who enter the command, press the Enter key until the date;
F9: select the command by numbers, graphical dialog box asking for your input command corresponding to the number (starting from 0), and the order displayed on the screen;
Ctrl + H: Remove the cursor left one character;
Ctrl + C Ctrl + Break, forced suspension of command;
Ctrl + M: said press Enter key;
Alt + F7: Clear all who enter the command history;
Alt + PrintScreen: interception of the screen window of the contents of the current command.
6, good "color" of the command line
By default command line is always black and white, from where the first surgery. In the Run dialog box, type cmd, open a command prompt, in the open right click on the title of the window, the pop-up menu, select "Properties" and open the window switch to the "Color" tab, and then click to select screen text, screen background options, and set the appropriate color, note that when we changed settings Shi Shi Zhi Hou will be displayed at the bottom, under which we can enjoy in a timely manner according to their own adjustments to make after the application save the settings will be asked properties, choose "Save property for later use with the same title of the window," so they would not only effect the current window.
7, quickly select files and folders
At the command prompt, we can press the Tab key to select the current directory the following files and folders, and its order of selection the basis of certain assessment, 按下 Shift + Tab key combination can also be used against the direction of choice, is convenience. Note that at this time we have chosen document also includes hidden files included.
8, save the file list information
Sometimes we need to drive in the list of files in a directory of all information printed, then you can use the following method: type the command DIR> C: \ 1.TXT after the carriage return, so the current directory list of files will be saved to C disk 1.txt file.
Click the "Start → Programs → Accessories → Command Prompt" or "Start → Run," and then enter "CMD" into the command can be prompt.
1 Using automatic memory function
Command window with the command and memory function, you enter in the window all the command line will be automatically memory down, by clicking up and down arrow keys on the keyboard can be the command just entered one by one taken out of tune, similar to the DOS in the DOSKEY instructions It just built this instruction in the command window. This memory can relieve you of the pain of repeatedly enter the same commands, for network debugging environment is particularly useful, can save you a lot of duplication of effort and valuable time.
2, fun prompt
You will be imagined to make your command prompt into the present time? Can display the current Windows XP version number? If you want to be able to achieve. Here we will teach you how to achieve.
Here we make use of a prompt in the DOS command, which a lot of useful parameters, the role of detailed parameters prompt the reader in the state of running prompt /? To Search. Understanding of the role of these parameters, you can create a path in the install file, name it as run.bat, the contents of the folder for the prompt $ V $ D $ G $ G. Next, open the Registry Editor, and then click Browse to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Command Processor \, then double-click on the right of the AutoRun key, be revised to% systemroot% \ run.bat, save your settings exit. Re-open the command prompt, how is not made changes. In fact, according to prompt the parameters as long as you can define your own rich text prompt.
3, copy the contents of the window
Copy of the string in terms of useful window for the command. But Windows 2000 and Windows XP command prompt copy, quite different from previous versions, even if not the same between the two, the former is the use of marker replication method, while the latter directly by right-clicking the replication method. Specifically described as follows:
In Windows XP, the for all, you can click the right mouse button in the "Select" to select, and for the contents of the specified range, you can right click the first election in which the "marked" item, then move the mouse to The command character to be copied Department, drag the mouse to select this string, the string will appear immediately in the form of anti-white screen, click the right mouse button or press the Enter key, then move to the target location, right-click and select "Paste "Such a command string is automatically copied to the specified location.
In Windows 2000 下, as in the command window does not support the right of the menu (Dan supports drag the mouse of choice), so it gives up one kind of simplicity of the Fang Shi Yong Geng Wei-day command characters of Fu Zhi, first you must hold down the left mouse button, drag the selected command string to be copied, they will be anti-white form on the screen, first click the mouse to the right (ie implementation of the copy operation), move your mouse over the target location, and then click the left mouse key, the command character is automatically pasted into a new location on the!
4, change the window properties
If you long to work at the command prompt can also self-adjust its appearance to suit their habits, such as their window title, color and other personalized settings, frequent use of the relevant commands are:
a) change the title: CMD / k TITLE new title name
b) to change the command character: CMD / K PROMPT [text] (text for the new command prompt)
c) to change the foreground and background colors: CMD / t: gf (g is the background color specified in hexadecimal numbers, common color have the following values: 0 black, 1 blue, 2 green, 3 light green, 4 red , 5 purple, 6 yellow, 7 white, 8 Gray, 9, light blue, A light green, B blue, C light red, D light purple, E pale yellow, F white light.
5, the command window shortcut keys
In the command window has many useful shortcut keys, can greatly accelerate the speed of your input and debugging, but some of the features also provide a graphical way.
ESC: Clear the current command line;
F7: Display the command history in the form of a graphic window shows a list of all who enter the command, and can be up and down arrow keys to select again the implementation of the order.
F8: search command history, cycle show all who enter the command, press the Enter key until the date;
F9: select the command by numbers, graphical dialog box asking for your input command corresponding to the number (starting from 0), and the order displayed on the screen;
Ctrl + H: Remove the cursor left one character;
Ctrl + C Ctrl + Break, forced suspension of command;
Ctrl + M: said press Enter key;
Alt + F7: Clear all who enter the command history;
Alt + PrintScreen: interception of the screen window of the contents of the current command.
6, good "color" of the command line
By default command line is always black and white, from where the first surgery. In the Run dialog box, type cmd, open a command prompt, in the open right click on the title of the window, the pop-up menu, select "Properties" and open the window switch to the "Color" tab, and then click to select screen text, screen background options, and set the appropriate color, note that when we changed settings Shi Shi Zhi Hou will be displayed at the bottom, under which we can enjoy in a timely manner according to their own adjustments to make after the application save the settings will be asked properties, choose "Save property for later use with the same title of the window," so they would not only effect the current window.
7, quickly select files and folders
At the command prompt, we can press the Tab key to select the current directory the following files and folders, and its order of selection the basis of certain assessment, 按下 Shift + Tab key combination can also be used against the direction of choice, is convenience. Note that at this time we have chosen document also includes hidden files included.
8, save the file list information
Sometimes we need to drive in the list of files in a directory of all information printed, then you can use the following method: type the command DIR> C: \ 1.TXT after the carriage return, so the current directory list of files will be saved to C disk 1.txt file.
Common command rpm
1. Install a package
# Rpm-ivh
2. Upgrade a package
# Rpm-Uvh
3. Remove a package
# Rpm-e
4. Installation Parameters
- Force even if the cover package of documents belonging to others forced to install
- Nodeps if the RPM package installation depends on other packages, even if no other packages installed, but also to force installation.
5. Check whether a package is installed
# Rpm-q
6. Get the information package to be installed
# Rpm-qi
7. Out of the package in which files
# Rpm-ql
8. Listed on a file server to which they belong RPM package
# Rpm-qf
9. Can be integrated with the use of several parameters
# Rpm-qil
10. Lists all installed rpm package
# Rpm-qa
11. Listed are not installed into the system an RPM package file which contains files?
# Rpm-qilp
<>
First, install the
Command format:
rpm-i (or - install) options file1.rpm ... fileN.rpm
Parameters:
file1.rpm ... fileN.rpm will be installed RPM package file name
More options:
-H (or - hash) hash mark (``#'') installed output
- Test only to test the installation, not the actual installation.
- Percent in the form of output as a percentage of the progress of installation.
- Excludedocs not install packages in the document file
- Includedocs installation documentation
- Replacepkgs forced to re-install already installed package
- Replacefiles replacement documents belonging to other packages
- Force Ignore package and file conflicts
- Noscripts not run pre-installation and post-installation script
- Prefix the package installed by the specified path
- Ignorearch do not check the structure of package
- Ignoreos run the operating system does not check package
- Nodeps do not check the dependency relations
- Ftpproxy used as a FTP proxy
- Ftpport FTP port number specified
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so that after pre-installation procedures and safety
Installation program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
Second, delete
Command format:
rpm-e (or - erase) options pkg1 ... pkgN
Parameter
pkg1 ... pkgN: To remove the package
More options
- Test only delete the test implementation
- Noscripts not run pre-installation and post-installation script
- Nodeps Do not check dependencies
General Options
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup
Program will be installed to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
Third, upgrade
Command format
rpm-U (or - upgrade) options file1.rpm ... fileN.rpm
Parameter
file1.rpm ... fileN.rpm package name
More options
-H (or - hash) hash mark (``#'') installed output
- Oldpackage allow the "upgrade" to an old version of the
- Test only upgrade testing
- Excludedocs not install packages in the document file
- Includedocs installation documentation
- Replacepkgs forced to re-install already installed package
- Replacefiles replacement documents belonging to other packages
- Force Ignore package and file conflicts
- Percent in the form of output as a percentage of the progress of installation.
- Noscripts not run pre-installation and post-installation script
- Prefix the package installed by the specified path
- Ignorearch do not check the structure of package
- Ignoreos run the operating system does not check package
- Nodeps do not check the dependency relations
- Ftpproxy used as a FTP proxy
- Ftpport FTP port number specified
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
4, the query
Command format:
rpm-q (or - query) options
Parameters:
pkg1 ... pkgN: check installed packages
More options
-P (or ``-'') check the file package
-F query belongs to which package
-A check of all installed packages
- Whatprovides query a feature of the package
-G queries the packages belonging to group
- Whatrequires check the package all the necessary functions
Information Options
Show all packages identification
-I display a summary of the information package
-L display list of files that the package
-C show a list of configuration files
-D displays the document file list
-S Display the package list of files and display the status of each file
- Scripts show install, uninstall, verify script
- Queryformat (or - qf) is displayed to the user specified query information
- Dump display each file all the parity information
- Provides display package provides the functionality
- Requires (or-R) shows the functionality required package
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
5, check the installed package
Command format:
rpm-V (or - verify, or-y) options
Parameter
pkg1 ... pkgN going to check the package name
Package Options
-P Verify against package file
-F check their packages
-A Verify check all packages
-G checking all packages belonging to group
More options
- Noscripts script does not run check
- Nodeps do not check dependencies
- Nofiles not verify file attributes
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
6, check the paper package
Syntax:
rpm-K (or - checksig) options file1.rpm ... fileN.rpm
Parameters:
file1.rpm ... fileN.rpm package file name
Checksig - more options
- Nopgp not verify PGP signature
General Options
-V Display additional information
-Vv display debugging information
- Rcfile file set rpmrc
7, other RPM options
- Rebuilddb rebuilding RPM database
- Initdb to create a new RPM database
- Quiet reduce output as much as possible
- Help Show help file
- Version display the current version of RPM
# Rpm-ivh
2. Upgrade a package
# Rpm-Uvh
3. Remove a package
# Rpm-e
4. Installation Parameters
- Force even if the cover package of documents belonging to others forced to install
- Nodeps if the RPM package installation depends on other packages, even if no other packages installed, but also to force installation.
5. Check whether a package is installed
# Rpm-q
6. Get the information package to be installed
# Rpm-qi
7. Out of the package in which files
# Rpm-ql
8. Listed on a file server to which they belong RPM package
# Rpm-qf
9. Can be integrated with the use of several parameters
# Rpm-qil
10. Lists all installed rpm package
# Rpm-qa
11. Listed are not installed into the system an RPM package file which contains files?
# Rpm-qilp
<
First, install the
Command format:
rpm-i (or - install) options file1.rpm ... fileN.rpm
Parameters:
file1.rpm ... fileN.rpm will be installed RPM package file name
More options:
-H (or - hash) hash mark (``#'') installed output
- Test only to test the installation, not the actual installation.
- Percent in the form of output as a percentage of the progress of installation.
- Excludedocs not install packages in the document file
- Includedocs installation documentation
- Replacepkgs forced to re-install already installed package
- Replacefiles replacement documents belonging to other packages
- Force Ignore package and file conflicts
- Noscripts not run pre-installation and post-installation script
- Prefix the package installed by the specified path
- Ignorearch do not check the structure of package
- Ignoreos run the operating system does not check package
- Nodeps do not check the dependency relations
- Ftpproxy used as a FTP proxy
- Ftpport FTP port number specified
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so that after pre-installation procedures and safety
Installation program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
Second, delete
Command format:
rpm-e (or - erase) options pkg1 ... pkgN
Parameter
pkg1 ... pkgN: To remove the package
More options
- Test only delete the test implementation
- Noscripts not run pre-installation and post-installation script
- Nodeps Do not check dependencies
General Options
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup
Program will be installed to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
Third, upgrade
Command format
rpm-U (or - upgrade) options file1.rpm ... fileN.rpm
Parameter
file1.rpm ... fileN.rpm package name
More options
-H (or - hash) hash mark (``#'') installed output
- Oldpackage allow the "upgrade" to an old version of the
- Test only upgrade testing
- Excludedocs not install packages in the document file
- Includedocs installation documentation
- Replacepkgs forced to re-install already installed package
- Replacefiles replacement documents belonging to other packages
- Force Ignore package and file conflicts
- Percent in the form of output as a percentage of the progress of installation.
- Noscripts not run pre-installation and post-installation script
- Prefix the package installed by the specified path
- Ignorearch do not check the structure of package
- Ignoreos run the operating system does not check package
- Nodeps do not check the dependency relations
- Ftpproxy used as a FTP proxy
- Ftpport FTP port number specified
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
4, the query
Command format:
rpm-q (or - query) options
Parameters:
pkg1 ... pkgN: check installed packages
More options
-P (or ``-'') check the file package
-F query belongs to which package
-A check of all installed packages
- Whatprovides query a feature of the package
-G queries the packages belonging to group
- Whatrequires check the package all the necessary functions
Information Options
Show all packages identification
-I display a summary of the information package
-L display list of files that the package
-C show a list of configuration files
-D displays the document file list
-S Display the package list of files and display the status of each file
- Scripts show install, uninstall, verify script
- Queryformat (or - qf) is displayed to the user specified query information
- Dump display each file all the parity information
- Provides display package provides the functionality
- Requires (or-R) shows the functionality required package
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
5, check the installed package
Command format:
rpm-V (or - verify, or-y) options
Parameter
pkg1 ... pkgN going to check the package name
Package Options
-P Verify against package file
-F check their packages
-A Verify check all packages
-G checking all packages belonging to group
More options
- Noscripts script does not run check
- Nodeps do not check dependencies
- Nofiles not verify file attributes
General Options
-V Display additional information
-Vv display debugging information
- Root for the specified path as the RPM will be the "root directory", so pre-and post-installation setup program will install to this directory
- Rcfile file set rpmrc
- Dbpath RPM information to set the path where inventory
6, check the paper package
Syntax:
rpm-K (or - checksig) options file1.rpm ... fileN.rpm
Parameters:
file1.rpm ... fileN.rpm package file name
Checksig - more options
- Nopgp not verify PGP signature
General Options
-V Display additional information
-Vv display debugging information
- Rcfile file set rpmrc
7, other RPM options
- Rebuilddb rebuilding RPM database
- Initdb to create a new RPM database
- Quiet reduce output as much as possible
- Help Show help file
- Version display the current version of RPM
2010年8月14日星期六
CentOS operating system commonly used commands
A: Using CentOS common command to see cpu
more / proc / cpuinfo | grep "model name"
grep "model name" / proc / cpuinfo
[Root @ localhost /] # grep "CPU" / proc / cpuinfo
model name: Intel (R) Pentium (R) Dual CPU E2180@2.00GHz
model name: Intel (R) Pentium (R) Dual CPU E2180@2.00GHz
If you feel the need to see a more comfortable
grep "model name" / proc / cpuinfo | cut-f2-d:
2: Using CentOS common command to see memory
grep MemTotal / proc / meminfo grep MemTotal / proc / meminfo | cut-f2-d: free-m | grep "Mem" | awk '(print $ 2)'
3: Using CentOS common command to see cpu is 32-bit or 64-bit
View CPU digits (32 or 64)
getconf LONG_BIT
4: Using CentOS common command to see the current version of linux
more / etc / redhat-release
cat / etc / redhat-release
5: Use common command to see the kernel version of CentOS
uname-r
uname-a
6: Using CentOS common command to see the current time
The above date has been how to synchronize time
7: Using CentOS common command to see the hard disk and partition
df-h
fdisk-l
You can also view partition
du-sh
You can see all the space occupied by the
du / etc-sh
You can see the size of this directory
8: Using CentOS common command to see the installed packages
View the system when the installation package to install
cat-n / root / install.log
more / root / install.log | wc-l
See who is already installed package
rpm-qa
rpm-qa | wc-l
yum list installed | wc-l
But very strange, I passed the rpm, and yum install the package in two ways the query, the number not the same. Did not know the cause.
9: Using CentOS common command to see the keyboard layout
cat / etc / sysconfig / keyboard
cat / etc / sysconfig / keyboard | grep KEYTABLE | cut-f2-d =
10: Using CentOS common command to see selinux case
sestatus
sestatus | cut-f2-d:
cat / etc / sysconfig / selinux
11: Using CentOS common command to see the ip, mac address
In ifcfg-eth0 file, you can see mac, gateway and other information. ifconfig cat / etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR cat / etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut-f2-d = ifconfig eth0 | grep "inet addr:" | awk '(print $ 2)' | cut-c 6 - ifconfig | grep 'inet addr:' | grep-v '127 .0.0.1 '| cut-d:-f2 | awk' (print $ 1) 'View the gateway cat / etc / sysconfig / network view dns cat / etc / resolv.conf 12: Using CentOS common command to see the default language
echo $ LANG $ LANGUAGE
cat / etc/sysconfig/i18n
12: Using CentOS common command to see whether the use of their time zone and UTC time
cat / etc / sysconfig / clock
13: Using CentOS common command to see the host name
hostname
cat / etc / sysconfig / network
Modify the host name is to modify this file, while at best the host file also changes.
14: Using CentOS common command to see the boot running time
uptime
09:44:45 up 67 days, 23:32, ...
Segment seems to have really the problem, my machine is 67 days before the boot.
# System resource usage
vmstat 1-S m procs ----------- memory ---------- --- swap - ----- io ---- - system - - ---- cpu ------ rb swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 233 199 778 0 0 4 25 1 1 3 0 96 0 0 0 0 0 233 199 778 0 0 0,010,298,561,318,600
more / proc / cpuinfo | grep "model name"
grep "model name" / proc / cpuinfo
[Root @ localhost /] # grep "CPU" / proc / cpuinfo
model name: Intel (R) Pentium (R) Dual CPU E2180@2.00GHz
model name: Intel (R) Pentium (R) Dual CPU E2180@2.00GHz
If you feel the need to see a more comfortable
grep "model name" / proc / cpuinfo | cut-f2-d:
2: Using CentOS common command to see memory
grep MemTotal / proc / meminfo grep MemTotal / proc / meminfo | cut-f2-d: free-m | grep "Mem" | awk '(print $ 2)'
3: Using CentOS common command to see cpu is 32-bit or 64-bit
View CPU digits (32 or 64)
getconf LONG_BIT
4: Using CentOS common command to see the current version of linux
more / etc / redhat-release
cat / etc / redhat-release
5: Use common command to see the kernel version of CentOS
uname-r
uname-a
6: Using CentOS common command to see the current time
The above date has been how to synchronize time
7: Using CentOS common command to see the hard disk and partition
df-h
fdisk-l
You can also view partition
du-sh
You can see all the space occupied by the
du / etc-sh
You can see the size of this directory
8: Using CentOS common command to see the installed packages
View the system when the installation package to install
cat-n / root / install.log
more / root / install.log | wc-l
See who is already installed package
rpm-qa
rpm-qa | wc-l
yum list installed | wc-l
But very strange, I passed the rpm, and yum install the package in two ways the query, the number not the same. Did not know the cause.
9: Using CentOS common command to see the keyboard layout
cat / etc / sysconfig / keyboard
cat / etc / sysconfig / keyboard | grep KEYTABLE | cut-f2-d =
10: Using CentOS common command to see selinux case
sestatus
sestatus | cut-f2-d:
cat / etc / sysconfig / selinux
11: Using CentOS common command to see the ip, mac address
In ifcfg-eth0 file, you can see mac, gateway and other information. ifconfig cat / etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR cat / etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut-f2-d = ifconfig eth0 | grep "inet addr:" | awk '(print $ 2)' | cut-c 6 - ifconfig | grep 'inet addr:' | grep-v '127 .0.0.1 '| cut-d:-f2 | awk' (print $ 1) 'View the gateway cat / etc / sysconfig / network view dns cat / etc / resolv.conf 12: Using CentOS common command to see the default language
echo $ LANG $ LANGUAGE
cat / etc/sysconfig/i18n
12: Using CentOS common command to see whether the use of their time zone and UTC time
cat / etc / sysconfig / clock
13: Using CentOS common command to see the host name
hostname
cat / etc / sysconfig / network
Modify the host name is to modify this file, while at best the host file also changes.
14: Using CentOS common command to see the boot running time
uptime
09:44:45 up 67 days, 23:32, ...
Segment seems to have really the problem, my machine is 67 days before the boot.
# System resource usage
vmstat 1-S m procs ----------- memory ---------- --- swap - ----- io ---- - system - - ---- cpu ------ rb swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 233 199 778 0 0 4 25 1 1 3 0 96 0 0 0 0 0 233 199 778 0 0 0,010,298,561,318,600
2010年8月11日星期三
Uptime Usage of the command - system operation and guidance
REVIEW: uptime command displays the system has been running for how long, information display were: the time now, the system has been running for how long, the current number of login users, the system in the last 1 minute, 5 minutes and within 15 minutes average load.
uptime command usage is very simple: you can directly enter the uptime.
There is also a parameter-V, is used to query version. (Note the capital letter v)
[Linux @ localhost] $ uptime-V
procps version 3.2.7
[Linux @ localhost] $ uptime
Display results:
10:19:04 up 257 days, 18:56, 12 users, load average: 2.10, 2.10,2.09
Display shows:
10:19:04 / / system current time
up 257 days, 18:56 / / host has run time, time became, indicating that the more stable your machine.
12 user / / user connection, the total number of connections, not users
load average / / the system load average, statistics recently 1,5,15-minute system load average
So what is the average system load it? Average system load is run at a specific time interval, the average number of processes in the queue. If each CPU core, the number of currently active process, not more than 3, then the system performance is good. If the number of tasks for each CPU core is greater than 5, then the performance of this machine have a serious problem. If your linux host is 1 if dual-core CPU, when the Load Average note 6, when the machine has been fully used.
In addition, the following code shows how this kind of start-up time method of computing systems:
#include
#include
struct sysinfo s_info;
long uptime;
int d,h,m,s;
int main()
{
if(0==sysinfo(&s_info))
{
uptime=s_info.uptime;
d=uptime/(3600*24);
h=(uptime/3600)%24;
m=(uptime%3600)/60;
s=(uptime%3600)%60;
printf("d=%d:h=%d:m=%d:s=%d",d,h,m,s);
return 0;
}
return -1;
}
Run Results:
[xxx@wireless time]$ gcc -o uptime uptime.c
[xxx@wireless time]$ ./uptime
d=19:h=0:m=4:s=52
[xxx@wireless time]$
uptime command usage is very simple: you can directly enter the uptime.
There is also a parameter-V, is used to query version. (Note the capital letter v)
[Linux @ localhost] $ uptime-V
procps version 3.2.7
[Linux @ localhost] $ uptime
Display results:
10:19:04 up 257 days, 18:56, 12 users, load average: 2.10, 2.10,2.09
Display shows:
10:19:04 / / system current time
up 257 days, 18:56 / / host has run time, time became, indicating that the more stable your machine.
12 user / / user connection, the total number of connections, not users
load average / / the system load average, statistics recently 1,5,15-minute system load average
So what is the average system load it? Average system load is run at a specific time interval, the average number of processes in the queue. If each CPU core, the number of currently active process, not more than 3, then the system performance is good. If the number of tasks for each CPU core is greater than 5, then the performance of this machine have a serious problem. If your linux host is 1 if dual-core CPU, when the Load Average note 6, when the machine has been fully used.
In addition, the following code shows how this kind of start-up time method of computing systems:
#include
#include
struct sysinfo s_info;
long uptime;
int d,h,m,s;
int main()
{
if(0==sysinfo(&s_info))
{
uptime=s_info.uptime;
d=uptime/(3600*24);
h=(uptime/3600)%24;
m=(uptime%3600)/60;
s=(uptime%3600)%60;
printf("d=%d:h=%d:m=%d:s=%d",d,h,m,s);
return 0;
}
return -1;
}
Run Results:
[xxx@wireless time]$ gcc -o uptime uptime.c
[xxx@wireless time]$ ./uptime
d=19:h=0:m=4:s=52
[xxx@wireless time]$
WindowsXP system, how to retrieve forgotten passwords
1, restart the computer, immediately after the startup screen appears, press the F8 key, select "Safe Mode with Command line."
2, run the end of the process, the system lists the system super user "administrator" and the local user "zhangbq" option menu, mouse click "administrator", enter the command line mode.
3, type the command: "net user zhangbq 123456 / add", forced to "zhangbq" user's password changed to "123456." To this add a new user (such as: user name is abcdef, password is 123456), please type "net user abcdef 123456 / add", add the following can be "net localgroup administrators abcdef / add" command will upgrade the system user Management group "administrators" of the user, and it has super rights.
4, restart the computer, select the normal mode, you can use to change the password after the "123456" Login "zhangbq" Users of the.
Use "administrator"
We know that in the process of installing Windows XP, the first work "administrator" default login will then ask create a new account, Yibianjinru Windows XP, use this Xinjian account login, and login screen in Windows XP only Chuxian created in Ye This user account does not appear "administrator", but in fact the "administrator" account still exists, and the password is blank.
When we understand this then, if forget the password, then the login screen, hold down the Ctrl + Alt key, then press and hold the Del key twice, you can appear classic logon screen, then type the user name "administrator", password is blank entry, and then modify the "zhangbp" password can be.
2, run the end of the process, the system lists the system super user "administrator" and the local user "zhangbq" option menu, mouse click "administrator", enter the command line mode.
3, type the command: "net user zhangbq 123456 / add", forced to "zhangbq" user's password changed to "123456." To this add a new user (such as: user name is abcdef, password is 123456), please type "net user abcdef 123456 / add", add the following can be "net localgroup administrators abcdef / add" command will upgrade the system user Management group "administrators" of the user, and it has super rights.
4, restart the computer, select the normal mode, you can use to change the password after the "123456" Login "zhangbq" Users of the.
Use "administrator"
We know that in the process of installing Windows XP, the first work "administrator" default login will then ask create a new account, Yibianjinru Windows XP, use this Xinjian account login, and login screen in Windows XP only Chuxian created in Ye This user account does not appear "administrator", but in fact the "administrator" account still exists, and the password is blank.
When we understand this then, if forget the password, then the login screen, hold down the Ctrl + Alt key, then press and hold the Del key twice, you can appear classic logon screen, then type the user name "administrator", password is blank entry, and then modify the "zhangbp" password can be.
Analysis of common shell commands under Win7
Windows 7 Vista system upgrade is relatively large, stability, compatibility, humanity and others have more. The Windows 7 in the shell command line, it is found that many users do not have another major update, Windows 7 shell is the Windows 7 system console. For those who are familiar with the command line, the caller using the keyboard than the mouse faster and more effort. Users can use the "Shell:" Command to deploy all available resources to the project manager to open a complete many steps needed to complete the task, and use the syntax is simple. But many users do not know what shell commands, and the operation can be realized, then the next we will Win7 common shell commands under the comprehensive analysis, to help users understand the new order under the new system.
shell: Profile
This command can open the user's total catalog. In the case of conventional installation, the location is c: \ users \ username. You can also click on the Start menu system, the user name to access. The system can also visit the% userprofile% environment variable.
shell: Personal
This command can open the current user's Documents folder. You can also click the Start menu to access my documents.
shell: SendTo
This command can access the system "Send to" folder. If you access your personal folder, you will find this folder is hidden, if you try to double-click the entry, it will display an error message, through the shell command, you can normally access. This is because the shortcut is actually a jump entry, created for backward compatibility. The real SendTo folder is hidden folder in AppData number of sub-folders.
shell: Public
This command can open public shared folder. If you use a family group function, this command can be a window within the first information.
shell: Common Startup and shell: Startup
This command can show which programs start automatically when the system starts. Sometimes, when installed in the boot menu will automatically create a shortcut.
shell: ConnectionsFolder
This command displays the current network connection. This command should be to view the current network connection was the most efficient way. The usual method is to click the Network and Sharing Center, then select Change Adapter Set View.
shell: programs and the shell: Common Programs
These two commands can access the current user and the system user in the Start menu program list.
shell: AppData and the shell: Local AppData
These two commands can open Roaming Application Data (roaming application data folder) Local Application Data (the local application data folder). The two folders are not used in everyday applications that you can find, like Firefox application like this folder to store configuration information.
shell: Cookies and the shell: cache
These two commands is to check the Internet Explorer the most efficient way to store information.
shell: Profile
The root directory of the current logged-on user
shell: UsersFilesFolder
And shell: profile the same
shell: Personal
Currently logged on user's "My Documents" folder
shell: My Music
Currently logged on user's "My Music" folder
shell: My Pictures
Currently logged on user's "My Pictures" folder
shell: My Video
Currently logged on user's "My Videos" folder
shell: Contacts
Currently logged on user's Contacts folder
shell: Desktop
Currently logged on user's Desktop folder
shell: Downloads
Currently logged on user's download folder
shell: Favorites
Currently logged on user's Internet Explorer browser favorites
shell: Searches
Currently logged on user's search folders, saved search results have been stored
shell: Links
Links to the current logged-on user folder, save the Internet Explorer browser navigation panel
shell: Public
Users to access shared folders
shell: Common Desktop
Desktop Sharing Users
shell: Common Documents
Share user My Documents
shell: CommonDownloads
Shared download folder
shell: CommonMusic
Shared user's folder
shell: CommonPictures
User Pictures folder sharing
shell: Profile
This command can open the user's total catalog. In the case of conventional installation, the location is c: \ users \ username. You can also click on the Start menu system, the user name to access. The system can also visit the% userprofile% environment variable.
shell: Personal
This command can open the current user's Documents folder. You can also click the Start menu to access my documents.
shell: SendTo
This command can access the system "Send to" folder. If you access your personal folder, you will find this folder is hidden, if you try to double-click the entry, it will display an error message, through the shell command, you can normally access. This is because the shortcut is actually a jump entry, created for backward compatibility. The real SendTo folder is hidden folder in AppData number of sub-folders.
shell: Public
This command can open public shared folder. If you use a family group function, this command can be a window within the first information.
shell: Common Startup and shell: Startup
This command can show which programs start automatically when the system starts. Sometimes, when installed in the boot menu will automatically create a shortcut.
shell: ConnectionsFolder
This command displays the current network connection. This command should be to view the current network connection was the most efficient way. The usual method is to click the Network and Sharing Center, then select Change Adapter Set View.
shell: programs and the shell: Common Programs
These two commands can access the current user and the system user in the Start menu program list.
shell: AppData and the shell: Local AppData
These two commands can open Roaming Application Data (roaming application data folder) Local Application Data (the local application data folder). The two folders are not used in everyday applications that you can find, like Firefox application like this folder to store configuration information.
shell: Cookies and the shell: cache
These two commands is to check the Internet Explorer the most efficient way to store information.
shell: Profile
The root directory of the current logged-on user
shell: UsersFilesFolder
And shell: profile the same
shell: Personal
Currently logged on user's "My Documents" folder
shell: My Music
Currently logged on user's "My Music" folder
shell: My Pictures
Currently logged on user's "My Pictures" folder
shell: My Video
Currently logged on user's "My Videos" folder
shell: Contacts
Currently logged on user's Contacts folder
shell: Desktop
Currently logged on user's Desktop folder
shell: Downloads
Currently logged on user's download folder
shell: Favorites
Currently logged on user's Internet Explorer browser favorites
shell: Searches
Currently logged on user's search folders, saved search results have been stored
shell: Links
Links to the current logged-on user folder, save the Internet Explorer browser navigation panel
shell: Public
Users to access shared folders
shell: Common Desktop
Desktop Sharing Users
shell: Common Documents
Share user My Documents
shell: CommonDownloads
Shared download folder
shell: CommonMusic
Shared user's folder
shell: CommonPictures
User Pictures folder sharing
2010年8月10日星期二
windows xp system commands Daquan
winver --------- check the Windows version
wmimgmt.msc---- open the windows management architecture
wupdmgr -------- windows update
winver --------- check the Windows version
wmimgmt.msc---- open the windows management architecture
wupdmgr -------- windows update
wscript -------- windows scripting host
write ---------- tablet winmsd ----- System Information
wiaacmgr ------- Scanner and Camera Wizard
winchat -------- XP comes with LAN chat
mem.exe-------- Display memory usage
Msconfig.exe-- System Configuration Utility
mplayer2 ------- Simple widnows media player
mspaint -------- drawing board
mstsc ---------- Remote Desktop Connection
mplayer2 ------- media player
magnify -------- Magnifier utility
mmc ------------ Open the Control Panel
mobsync -------- synchronization command
Check DirectX dxdiag --------- Information
drwtsn32 ------ System of a doctor
devmgmt.msc-- Device Manager
dfrg.msc------- Disk Defragmenter
diskmgmt.msc-- the Disk Management utility
dcomcnfg ------- Open the System Component Services
ddeshare ------- set to open DDE Share
dvdplay -------- DVD Players
net stop messenger ----- Stop Messenger Service
net start messenger ---- Start messenger service
Open Notepad notepad --------
nslookup ------- network management tools to guide
ntbackup ------- system backup and restore
narrator ------- screen "about people"
ntmsmgr.msc---- Removable Storage Manager
ntmsoprq.msc-- Removable Storage Manager operation requests
netstat-an ---- (TC) command checks Interface
syncapp -------- create a briefcase
sysedit -------- System Configuration Editor
sigverif ------- File Signature Verification procedures
sndrec32 ------- recorder
shrpubw -------- create shared folders
secpol.msc----- Local Security Policy
syskey --------- system encryption, encryption can not be solved soon, the dual system of protection of windows xp password
services.msc-- local service settings
Sndvol32 ------- Volume Control program
sfc.exe-------- System File Checker
sfc / scannow --- windows file protection
tsshutdn ------- 60 seconds step shutdown command
About tourstart ------ xp (installed xp after the roaming procedure)
Task Manager taskmgr --------
eventvwr ------- Event Viewer
eudcedit ------- Characters and procedures
explorer ------- Open the Explorer
Object Packager packager -------
perfmon.msc---- computer performance monitoring procedures
progman -------- Program Manager
regedit.exe---- Registry
rsop.msc------- Group Policy Resultant Set of
regedt32 ------- Registry Editor
rononce-p ---- 15 Second off
regsvr32 / u *. dll ---- stop running dll files
regsvr32 / u zipfldr.dll------ cancel ZIP support
cmd.exe-------- CMD command prompt
chkdsk.exe----- Chkdsk disk check
certmgr.msc---- Certificate Management Utility
calc ----------- Start Calculator
Start Character Map charmap --------
cliconfg ------- SQL SERVER Client Network Utility
Clipbrd -------- Clipboard Viewer
conf ----------- start netmeeting
compmgmt.msc-- Computer Management
cleanmgr ------- ** order
ciadv.msc------ indexing service program
Open Screen Keyboard osk ------------
odbcad32 ------- ODBC Data Source Administrator
oobe / msoobe / a ---- check whether the activation XP
lusrmgr.msc---- Local Users and Groups
logoff --------- cancellation of orders
iexpress ------- Trojans bundled tools, the system comes
Nslookup ------- IP address detector
fsmgmt.msc----- Shared Folder Manager
utilman -------- Utility Manager
gpedit.msc----- Group Policy
wmimgmt.msc---- open the windows management architecture
wupdmgr -------- windows update
winver --------- check the Windows version
wmimgmt.msc---- open the windows management architecture
wupdmgr -------- windows update
wscript -------- windows scripting host
write ---------- tablet winmsd ----- System Information
wiaacmgr ------- Scanner and Camera Wizard
winchat -------- XP comes with LAN chat
mem.exe-------- Display memory usage
Msconfig.exe-- System Configuration Utility
mplayer2 ------- Simple widnows media player
mspaint -------- drawing board
mstsc ---------- Remote Desktop Connection
mplayer2 ------- media player
magnify -------- Magnifier utility
mmc ------------ Open the Control Panel
mobsync -------- synchronization command
Check DirectX dxdiag --------- Information
drwtsn32 ------ System of a doctor
devmgmt.msc-- Device Manager
dfrg.msc------- Disk Defragmenter
diskmgmt.msc-- the Disk Management utility
dcomcnfg ------- Open the System Component Services
ddeshare ------- set to open DDE Share
dvdplay -------- DVD Players
net stop messenger ----- Stop Messenger Service
net start messenger ---- Start messenger service
Open Notepad notepad --------
nslookup ------- network management tools to guide
ntbackup ------- system backup and restore
narrator ------- screen "about people"
ntmsmgr.msc---- Removable Storage Manager
ntmsoprq.msc-- Removable Storage Manager operation requests
netstat-an ---- (TC) command checks Interface
syncapp -------- create a briefcase
sysedit -------- System Configuration Editor
sigverif ------- File Signature Verification procedures
sndrec32 ------- recorder
shrpubw -------- create shared folders
secpol.msc----- Local Security Policy
syskey --------- system encryption, encryption can not be solved soon, the dual system of protection of windows xp password
services.msc-- local service settings
Sndvol32 ------- Volume Control program
sfc.exe-------- System File Checker
sfc / scannow --- windows file protection
tsshutdn ------- 60 seconds step shutdown command
About tourstart ------ xp (installed xp after the roaming procedure)
Task Manager taskmgr --------
eventvwr ------- Event Viewer
eudcedit ------- Characters and procedures
explorer ------- Open the Explorer
Object Packager packager -------
perfmon.msc---- computer performance monitoring procedures
progman -------- Program Manager
regedit.exe---- Registry
rsop.msc------- Group Policy Resultant Set of
regedt32 ------- Registry Editor
rononce-p ---- 15 Second off
regsvr32 / u *. dll ---- stop running dll files
regsvr32 / u zipfldr.dll------ cancel ZIP support
cmd.exe-------- CMD command prompt
chkdsk.exe----- Chkdsk disk check
certmgr.msc---- Certificate Management Utility
calc ----------- Start Calculator
Start Character Map charmap --------
cliconfg ------- SQL SERVER Client Network Utility
Clipbrd -------- Clipboard Viewer
conf ----------- start netmeeting
compmgmt.msc-- Computer Management
cleanmgr ------- ** order
ciadv.msc------ indexing service program
Open Screen Keyboard osk ------------
odbcad32 ------- ODBC Data Source Administrator
oobe / msoobe / a ---- check whether the activation XP
lusrmgr.msc---- Local Users and Groups
logoff --------- cancellation of orders
iexpress ------- Trojans bundled tools, the system comes
Nslookup ------- IP address detector
fsmgmt.msc----- Shared Folder Manager
utilman -------- Utility Manager
gpedit.msc----- Group Policy
Vbs script shielded ports
Code:
'On Error Resume Next
Const ALLOW_ALL = 0
Port = Array("4900", "5000", "5100", "5500", "5600", "6000", "7000", "7100", "7200", "7300", "7400","3389","80")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard In colNetCards
arrPermittedTCPPorts = Port
arrPermittedUDPPorts = Array(ALLOW_ALL)
arrPermittedIPProtocols = Array(ALLOW_ALL)
objNetCard.EnableIPSec arrPermittedTCPPorts, arrPermittedUDPPorts, arrPermittedIPProtocols
Next
After implementation, to
Network Neighborhood - "Right -" attribute - "Local Area Connection -" General - "Internet Protocol (TCP / IP) -> Properties -" Advanced - "Options -" TCP / IP filtering - - "Properties -" Only.
'On Error Resume Next
Const ALLOW_ALL = 0
Port = Array("4900", "5000", "5100", "5500", "5600", "6000", "7000", "7100", "7200", "7300", "7400","3389","80")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard In colNetCards
arrPermittedTCPPorts = Port
arrPermittedUDPPorts = Array(ALLOW_ALL)
arrPermittedIPProtocols = Array(ALLOW_ALL)
objNetCard.EnableIPSec arrPermittedTCPPorts, arrPermittedUDPPorts, arrPermittedIPProtocols
Next
After implementation, to
Network Neighborhood - "Right -" attribute - "Local Area Connection -" General - "Internet Protocol (TCP / IP) -> Properties -" Advanced - "Options -" TCP / IP filtering - - "Properties -" Only.
Linux systems with PHP scripts to read the text input and
As a Linux system command line Perl script to explain the language of choice for the day is over. Today, we have more options, including Python, Ruby and PHP. If you write PHP code for the Web site, and familiar with the language, you will find the command line to use PHP's speed, the effect of a good surprise.
In the script, any script language, one of the biggest function is to manipulate files and obtain user input. PHP deal with as much grace as any other scripting language.
For example, the use of PHP in the script to read user input during the processing, use:
#! / Usr / bin / php
function read_input ()
(
$ Fp = fopen ("/ dev / stdin", "r");
$ Input = trim (fgets ($ fp, 255));
fclose ($ fp);
return $ input;
)
printf ("Please supply your name:");
$ Name = read_input ();
printf ("Hello, $ name.");
?>
Defined above read_input () function is extracted from the STDIN input, stored in the $ input variable in order to guide and followed all the blank space, and then return.
The same principle can also be used in standard documents read and operate; remember, for Linux, STDIN is just another file it (accordingly, the above example the opening / dev / stdin is true).
#! / Usr / bin / php
if (file_exists ($ argv [1]))
(
$ File = $ argv [1];
) Else (
printf ("ERROR: File '$ file' does not exist!");
exit 1;
)
$ Data = file ($ file);
$ C = 1;
foreach ($ data as $ line)
(
printf (sprintf ("[% s]:% s", $ c, $ line));
$ C + +;
)
In the example above, PHP script will read the file passed to the command line, each line, and follow the current lines of its output. If the file does not exist, the script will print an error and return code 1 and exit (1 for error; in normal operation, the script will return exit code 0). file () function is used here, it reads the file per line, an array (in this case, the array as $ data), then for foreach () statement, in the array cycle time is in the file line.
PHP is no longer strictly Web-based programming. We can easily apply it to write command-line script, is both flexible and fast. Similarly, almost all Web script you can use to operate, for example, database operations, can easily apply PHP's command-line script to complete.
In the script, any script language, one of the biggest function is to manipulate files and obtain user input. PHP deal with as much grace as any other scripting language.
For example, the use of PHP in the script to read user input during the processing, use:
#! / Usr / bin / php
function read_input ()
(
$ Fp = fopen ("/ dev / stdin", "r");
$ Input = trim (fgets ($ fp, 255));
fclose ($ fp);
return $ input;
)
printf ("Please supply your name:");
$ Name = read_input ();
printf ("Hello, $ name.");
?>
Defined above read_input () function is extracted from the STDIN input, stored in the $ input variable in order to guide and followed all the blank space, and then return.
The same principle can also be used in standard documents read and operate; remember, for Linux, STDIN is just another file it (accordingly, the above example the opening / dev / stdin is true).
#! / Usr / bin / php
if (file_exists ($ argv [1]))
(
$ File = $ argv [1];
) Else (
printf ("ERROR: File '$ file' does not exist!");
exit 1;
)
$ Data = file ($ file);
$ C = 1;
foreach ($ data as $ line)
(
printf (sprintf ("[% s]:% s", $ c, $ line));
$ C + +;
)
In the example above, PHP script will read the file passed to the command line, each line, and follow the current lines of its output. If the file does not exist, the script will print an error and return code 1 and exit (1 for error; in normal operation, the script will return exit code 0). file () function is used here, it reads the file per line, an array (in this case, the array as $ data), then for foreach () statement, in the array cycle time is in the file line.
PHP is no longer strictly Web-based programming. We can easily apply it to write command-line script, is both flexible and fast. Similarly, almost all Web script you can use to operate, for example, database operations, can easily apply PHP's command-line script to complete.
Linux directory to create and delete command
mkdir command
Function: Create a directory (similar to the md command under MSDOS).
Syntax: mkdir [options] dir-name
Description: This command creates the directory named dir-name. Create a directory of the user requirements in the current directory (dir-name of the parent directory) has write permissions, and dirname can not be the current directory has a directory or file name.
Command in the meaning of each option are:
- M to set access permissions on the new directory. Can also use the chmod command to set.
- P can be a path name. At this point, if some of the directory path does not exist, add this option, the system will automatically build a good directory that does not exist, that one can create multiple directories.
rmdir command
Function: delete empty directories.
Syntax: rmdir [options] dir-name
Description: dir-name that the directory name. The command to delete a directory from one or more directory entries. Needs special attention is required before a directory is deleted is empty. rm - r dir command instead of rmdir, but dangerous. Delete a directory must have write permissions on the parent directory.
Command in the meaning of each option are:
- P recursively remove the directory dirname, parent directory when the directory is empty after deletion, we also deleted together. If the path is deleted or retained part of the path for some reason, the system displayed in the standard output the appropriate information.
cd command
Function: to change the working directory.
Syntax: cd [directory]
Description: This command will change the current directory to the directory specified directory. If not specified directory, then back to the user's home directory. In order to change to a specified directory, the user must have the implementation of the specified directory and read access.
The command can use a wildcard (wildcard meaning, see Chapter X).
pwd command
Hierarchical directory structure in Linux, the user can be authorized in any directory using mkdir command to create a new directory can also use the cd command to change from one directory to another directory. However, there is no prompt to tell the user which is currently in a directory. To know the current directory in which you can use the pwd command, which displays the entire path name.
Syntax: pwd
Description: This command shows the absolute path of the current working directory.
ls command
ls is a list of abbreviated English words, their functions are listed in the directory contents. This is the user one of the most commonly used as a command, because the users need from time to time to view the contents of a directory. Under the command similar to the DOS dir command.
Syntax: ls [options] [directory or file]
For each directory, the command will list all the subdirectories and files them. For each file, ls will output the file name and other information requested. By default, the output entries alphabetically. When not given a directory name or file name, to display the current directory information.
Command in the various options mean the following:
- A show all subdirectories under the specified directory and files, including hidden files.
- A show all subdirectories under the specified directory and files, including hidden files. But do not list "." And ".."。
- B on the file name in the non-display characters with octal escape character display.
- C sort by file modification time.
- C into the multi-column display.
- D if the argument is a directory, instead display only shows the name of the file under it. Often used in conjunction with the l option to obtain directory information.
- F do not sort. This option will lts options fail, and to aU option effective.
- F behind the tag name in the directory "/" executable behind the mark "*" sign behind the link marked "@", pipe (or FIFO) behind the tag "|", socket file back marked "=."
- I in the output of the first column shows the file i node number.
- L for long format to display the file details. This option is most commonly used.
The information listed in each line are: file type and file permissions are a few links to the main document file size is set the time to create or modify the name of the recent
For the symbolic link file, the file name displayed after the "->" and the reference file path name.
For device files, the "file size" field shows the main, the minor device number, not the file size.
The total number of blocks in the directory displayed in the beginning of a long list of formats, including indirect blocks.
- L if the specified name is a symbolic link file, it shows the link points to a file.
- M output by character stream format, the file inter-page display, separated by commas.
- N l option with the same output format, but is in the output file is a group of owners is the appropriate UID and GID numbers to represent numbers, not the actual name.
- O l option with the same, just do not show the owner information.
- P in the directory later add a "/."
- Q will not be displayed in the file name characters with "?" Instead.
- R reverse order or in alphabetical order of first priority display output.
- R recursive directory displays all subdirectories in the specified file.
- S for each directory entry is given the number of blocks used, including indirect blocks.
- T is displayed by modification time (most recent first) instead of sorting by name. If the file is modified the same time, according to the dictionary order. Modified depends on whether u choose to use the c or the top. The default time is the last modification time mark.
- U is displayed by file last access time (latest first) instead of sorting by name. -T time to mark the forthcoming revised last visit time.
- X by line item shows the sort of information.
Using ls - l command to display the message, at the beginning of a 10-character string, the first of a character file type, it can be one of the following types:
- Regular file
d directory
l symbolic link
b block device file
c character device file
9 behind the characters that the file access, divided into 3 groups 3.
The first group that documents the rights owner, the second group of said groups of users with permissions, the third group that the other user permissions. Each group of three characters, respectively, of the document read, write and execute permissions.
The permissions are as follows:
r read
w write
x implementation. For the catalog, said access privileges.
s when the file is executed, the UID or GID of the file given to the implementation process UID (user ID) or GID (group ID).
t set the flag (left in memory, not swapped out). If the file is a directory, files in the directory can only be super-user, the directory owner, or file owner to delete. If it is an executable file, the file is executed, a pointer pointing to the body of the paragraph remained in the memory. This re-execute it, the system will be able to quickly load the file.
Function: Create a directory (similar to the md command under MSDOS).
Syntax: mkdir [options] dir-name
Description: This command creates the directory named dir-name. Create a directory of the user requirements in the current directory (dir-name of the parent directory) has write permissions, and dirname can not be the current directory has a directory or file name.
Command in the meaning of each option are:
- M to set access permissions on the new directory. Can also use the chmod command to set.
- P can be a path name. At this point, if some of the directory path does not exist, add this option, the system will automatically build a good directory that does not exist, that one can create multiple directories.
rmdir command
Function: delete empty directories.
Syntax: rmdir [options] dir-name
Description: dir-name that the directory name. The command to delete a directory from one or more directory entries. Needs special attention is required before a directory is deleted is empty. rm - r dir command instead of rmdir, but dangerous. Delete a directory must have write permissions on the parent directory.
Command in the meaning of each option are:
- P recursively remove the directory dirname, parent directory when the directory is empty after deletion, we also deleted together. If the path is deleted or retained part of the path for some reason, the system displayed in the standard output the appropriate information.
cd command
Function: to change the working directory.
Syntax: cd [directory]
Description: This command will change the current directory to the directory specified directory. If not specified directory, then back to the user's home directory. In order to change to a specified directory, the user must have the implementation of the specified directory and read access.
The command can use a wildcard (wildcard meaning, see Chapter X).
pwd command
Hierarchical directory structure in Linux, the user can be authorized in any directory using mkdir command to create a new directory can also use the cd command to change from one directory to another directory. However, there is no prompt to tell the user which is currently in a directory. To know the current directory in which you can use the pwd command, which displays the entire path name.
Syntax: pwd
Description: This command shows the absolute path of the current working directory.
ls command
ls is a list of abbreviated English words, their functions are listed in the directory contents. This is the user one of the most commonly used as a command, because the users need from time to time to view the contents of a directory. Under the command similar to the DOS dir command.
Syntax: ls [options] [directory or file]
For each directory, the command will list all the subdirectories and files them. For each file, ls will output the file name and other information requested. By default, the output entries alphabetically. When not given a directory name or file name, to display the current directory information.
Command in the various options mean the following:
- A show all subdirectories under the specified directory and files, including hidden files.
- A show all subdirectories under the specified directory and files, including hidden files. But do not list "." And ".."。
- B on the file name in the non-display characters with octal escape character display.
- C sort by file modification time.
- C into the multi-column display.
- D if the argument is a directory, instead display only shows the name of the file under it. Often used in conjunction with the l option to obtain directory information.
- F do not sort. This option will lts options fail, and to aU option effective.
- F behind the tag name in the directory "/" executable behind the mark "*" sign behind the link marked "@", pipe (or FIFO) behind the tag "|", socket file back marked "=."
- I in the output of the first column shows the file i node number.
- L for long format to display the file details. This option is most commonly used.
The information listed in each line are: file type and file permissions are a few links to the main document file size is set the time to create or modify the name of the recent
For the symbolic link file, the file name displayed after the "->" and the reference file path name.
For device files, the "file size" field shows the main, the minor device number, not the file size.
The total number of blocks in the directory displayed in the beginning of a long list of formats, including indirect blocks.
- L if the specified name is a symbolic link file, it shows the link points to a file.
- M output by character stream format, the file inter-page display, separated by commas.
- N l option with the same output format, but is in the output file is a group of owners is the appropriate UID and GID numbers to represent numbers, not the actual name.
- O l option with the same, just do not show the owner information.
- P in the directory later add a "/."
- Q will not be displayed in the file name characters with "?" Instead.
- R reverse order or in alphabetical order of first priority display output.
- R recursive directory displays all subdirectories in the specified file.
- S for each directory entry is given the number of blocks used, including indirect blocks.
- T is displayed by modification time (most recent first) instead of sorting by name. If the file is modified the same time, according to the dictionary order. Modified depends on whether u choose to use the c or the top. The default time is the last modification time mark.
- U is displayed by file last access time (latest first) instead of sorting by name. -T time to mark the forthcoming revised last visit time.
- X by line item shows the sort of information.
Using ls - l command to display the message, at the beginning of a 10-character string, the first of a character file type, it can be one of the following types:
- Regular file
d directory
l symbolic link
b block device file
c character device file
9 behind the characters that the file access, divided into 3 groups 3.
The first group that documents the rights owner, the second group of said groups of users with permissions, the third group that the other user permissions. Each group of three characters, respectively, of the document read, write and execute permissions.
The permissions are as follows:
r read
w write
x implementation. For the catalog, said access privileges.
s when the file is executed, the UID or GID of the file given to the implementation process UID (user ID) or GID (group ID).
t set the flag (left in memory, not swapped out). If the file is a directory, files in the directory can only be super-user, the directory owner, or file owner to delete. If it is an executable file, the file is executed, a pointer pointing to the body of the paragraph remained in the memory. This re-execute it, the system will be able to quickly load the file.
Linux entry and exit system
Into the Linux system:
Enter the user account must be in the system installation process can create the following two accounts:
1. root - super user account (system administrator), use this account can do anything in the system.
2. Ordinary users - that account for ordinary users, the operation can be limited.
Linux users in general are ordinary users, system administrators generally use super-user account to complete some administrative work. If you only need to complete some of the general account will be able to accomplish, it is recommended not to use super user account, so as not to inadvertently damage the system. Affect the normal operation of the system.
User log in two steps: first, enter the user's login name, the system recognizes the user under the login name; the second step, enter the user's password, the password is user set a string of other users is confidential when the system is used in the login user's keywords to distinguish between true and false.
When the user correctly enter a user name and password, the system will be able to legally enter. Screen Display:
[Root @ loclhost / root] #
Then you can do various operations on the system has. Note that super-user prompt is "#", other users of the prompt is "$."
Modify password
In order to better protect the security of user account, Linux allows users to modify their own password at any time, modify the password of the command is passwd, it will prompt the user to enter the old password and new password, and then also require the user to confirm the new password again to avoid user intention press the wrong button. If the user forget the password, you can apply to the system administrator to re-set for themselves a.
Virtual Console
Linux is a true multi-user operating system, it can also accept multiple users log on. Linux also allows a user to repeatedly log on, because, like Linux and UNIX, providing a virtual console access method that allows users at one time several times from the console log. Virtual Console could be selected by pressing the Alt key and a function key to achieve, often using F1-F6, for example, users log in, click Alt-F2 keys, users can also see the "login:" prompt, the user see the second virtual console. Then just press Alt-F1 key, you can return to the first virtual console. A newly installed Linux system default allows the user to use Alt-F1 to Alt-F6 key to access the first six virtual consoles. Virtual Console allows users to work simultaneously on multiple consoles, truly reflect the characteristics of multi-user Linux systems. Users can conduct a virtual console before the end of the work, switch to another virtual console start another job.
Exit System
Whether super-user, or the ordinary user, need to exit system, in the shell prompt, type exit command can be.
Enter the user account must be in the system installation process can create the following two accounts:
1. root - super user account (system administrator), use this account can do anything in the system.
2. Ordinary users - that account for ordinary users, the operation can be limited.
Linux users in general are ordinary users, system administrators generally use super-user account to complete some administrative work. If you only need to complete some of the general account will be able to accomplish, it is recommended not to use super user account, so as not to inadvertently damage the system. Affect the normal operation of the system.
User log in two steps: first, enter the user's login name, the system recognizes the user under the login name; the second step, enter the user's password, the password is user set a string of other users is confidential when the system is used in the login user's keywords to distinguish between true and false.
When the user correctly enter a user name and password, the system will be able to legally enter. Screen Display:
[Root @ loclhost / root] #
Then you can do various operations on the system has. Note that super-user prompt is "#", other users of the prompt is "$."
Modify password
In order to better protect the security of user account, Linux allows users to modify their own password at any time, modify the password of the command is passwd, it will prompt the user to enter the old password and new password, and then also require the user to confirm the new password again to avoid user intention press the wrong button. If the user forget the password, you can apply to the system administrator to re-set for themselves a.
Virtual Console
Linux is a true multi-user operating system, it can also accept multiple users log on. Linux also allows a user to repeatedly log on, because, like Linux and UNIX, providing a virtual console access method that allows users at one time several times from the console log. Virtual Console could be selected by pressing the Alt key and a function key to achieve, often using F1-F6, for example, users log in, click Alt-F2 keys, users can also see the "login:" prompt, the user see the second virtual console. Then just press Alt-F1 key, you can return to the first virtual console. A newly installed Linux system default allows the user to use Alt-F1 to Alt-F6 key to access the first six virtual consoles. Virtual Console allows users to work simultaneously on multiple consoles, truly reflect the characteristics of multi-user Linux systems. Users can conduct a virtual console before the end of the work, switch to another virtual console start another job.
Exit System
Whether super-user, or the ordinary user, need to exit system, in the shell prompt, type exit command can be.
2010年8月8日星期日
Ntsd.exe order details
Ntsd.exe is used to end the process, beginning from 2000, the system comes with user mode debugging tools. By the debugger attached (attach) the process will exit together with the debugger, it can be used to terminate the process at the command line. Use ntsd automatic permission to access the debug, which can kill most of the process (in theory only System, SMSS.EXE and CSRSS.EXE three process can not be the end of the first two are pure kernel mode, and the last that is the Win32 sub- system, ntsd itself needs it).
Ntsd.exe usage:
ntsd-c q-p PID
Or
ntsd-c q pn ImageName
- C is that implementation of the debug command, q that after the implementation of exit (quit),-p that is followed is the process you want to end the corresponding PID,-pn that is followed is that you want to end the process name (process_name. exe For example: QQ.exe, explorer.exe, etc. It is noteworthy that the suffix name. exe can not be omitted, otherwise the system will tell you "do not support this interface")
View pid and process name, we can see in Task Manager, in exceptional circumstances, you can use the tasklist command.
For instance, we want to end a process pid to 3212 maxthon.exe
Then we can at the command prompt, type:
ntsd-c q-p 3212
Or
ntsd-c q-pn maxthon.exe
Ntsd.exe usage:
ntsd-c q-p PID
Or
ntsd-c q pn ImageName
- C is that implementation of the debug command, q that after the implementation of exit (quit),-p that is followed is the process you want to end the corresponding PID,-pn that is followed is that you want to end the process name (process_name. exe For example: QQ.exe, explorer.exe, etc. It is noteworthy that the suffix name. exe can not be omitted, otherwise the system will tell you "do not support this interface")
View pid and process name, we can see in Task Manager, in exceptional circumstances, you can use the tasklist command.
For instance, we want to end a process pid to 3212 maxthon.exe
Then we can at the command prompt, type:
ntsd-c q-p 3212
Or
ntsd-c q-pn maxthon.exe
Summary tab key skills
For tab masters, strongly recommend to see "quick rename" and "at the command prompt," these two! These two parts in the published version of the invisible!
Tab key on the keyboard in case key (Caps Lock) of the above, it is more of a familiar, does not know a hidden world of magic button.
Tab key is short for tabulator key, which means "for the table were, tab machines (typewriter used for the tab) Tab key." It is the most basic usage is the form used to draw no borders. Following figure, the interval between words are pressing the Tab key once to achieve. It generally is equal to eight spaces in length, when it's in front of a word when the word length together and just be divisible by 8, as shown in the last line.
Why not call for the tab key Tab key then? Because the Tab key to not only be used to watch, and it has many practical uses, far beyond the scope of watchmaking.
Basic Usage
1, changing the focus
Focus to the next button, input box or links. For example, the closure of a notebook is not saved, a prompt will pop up (below), this time, "Yes" button has a dotted line, if you press space or carriage return is equivalent to use the mouse to click the "Yes" button. Want to use the keyboard to "click" "No" button, press the Tab key, the dotted line will be transferred to the "No" on, then press space on it.
There is also a very common usage, QQ in forums or when the log, enter the complete account number, do not need to re-use mouse to click the password box, simply press the Tab key you can locate the cursor to the password box. If you want to turn location, the press the key combination Shift + Tab.
2, rapid re-named
In Vista or Windows Server 2008 under, Tab key and a wonderful use: select an icon on the desktop, press F2 to enter rename state, renamed after, and then press the Tab key will enter the next file to rename state. Would like to turn to rename a file, you can press the key combination Shift + Tab. Rename multiple files at a time when very convenient. (Thanks to dofy test.)
3, switching window
Veterans who often use Alt + Tab key combination to quickly switch between windows. The first press the key combination Alt key and press the Tab key, you can quickly switch to the previous window. Hold down the Alt keys in the case, press the Tab key will appear once the current open windows icon, then press the Tab key you can switch between each icon. Alt + Shift + Tab key combination is the reverse switch. Release the Alt key will switch the window. In Vista, press this key combination still appears thumbnail window.
4, tab, or label switching
Ctrl + Tab: Switch to next tab or browser tabs.
Ctrl + Shift + Tab: reverse switch.
Firefox users can install this extension, Ctrl-Tab to achieve with a preview of the label switching. By the way, press Ctrl + Shift + A key combination can preview all the labels, you can immediately enter in the search box to filter the tag. Extension installation address is: http://en.design-noir.de/mozilla/ctrl-tab/
Advanced Usage
1, at the command prompt
At the command prompt, Tab key is very useful, it can automatically populate the names of files and folders (if a bit strange call is automatically populated). Some readers may already know, but there is another part of this little-known techniques a secret. First look at a presentation picture, may be a bit dizzy, sparking the cursor disappear when the time is pressing the tab of the moment:
The following example is explained in detail below:
Suppose "D: \ cfan" path, there are folders: a, ab, a file: abc.txt, ac.txt. Click "Start → Run," enter "cmd", press Enter to open a command prompt. Input "D:", carriage return after the switch to the D drive, enter "cd cfan" command into the "D: \ cfan" this folder. In the "D: \ cfan>" behind the importation of "dir" (Note that there is a space behind dir):
① Automatically populate a folder or file name: Press the Tab key can be directly filled circle the names of folders and files, use Shift + Tab can fill a.
② automatically populate a specific letter at the beginning of the folder or file name: enter "a", then press the Tab key, you can turn a folder filled with "a" and documents "abc.txt". Enter the name of a very long time a folder or file is useful.
③ automatically populate a specific file extension name: Enter "*. txt", then press the Tab key, you can turn populate file "abc.txt", "ac.txt". At the command prompt, the asterisk on behalf of any character.
④ automatically populate the second letter to a specific folder and file name: enter "? B *", then press the Tab key, you can turn a folder filled with "ab" and documents "abc.txt". Question mark represents a character in here.
⑤ automatically populate the file name specified length of file name: Enter "???. txt ", then press the Tab key, you can turn populate file" abc.txt "and" ac.txt ".
2, the input methods
Google Pinyin input method in the middle, Tab key is the back flip. Shift + Tab is a forward flip. Sogou Pinyin input method in the middle, press the Tab key to enter the stroke screening model. Use is to enter a word or multiple word spelling, press the tab key, then h (cross), s (vertical), p (write), n (strokes), z (discount) enter the first word in turn The order of strokes, has been to find the word so far. In this mode, the Separation of Chinese secondary code can also be used, for example, to enter a Chinese character "han" is on the list but could not find, then input "xian", then press the Tab key, then enter the "han" two parts " Female "," leisure "and the initials" nx ", you can see only a" han "word has.
3, where in Photoshop
After pressing the Tab key will hide the toolbar and the panel, only the menu bar. This shortcut key combination of regular full-screen shortcut "f" to use.
4, under the EmEditor and EditPlus
In EmEditor and EidtPlus when writing code under the program, select multiple lines, press the Tab key to quickly select multiple rows for the indentation. Shift + Tab key combination is the reverse indentation.
5, in the browser
Some time back to support the Forum with the key combination "Ctrl + Enter" to quickly submit, but this combination of keys does not necessarily support each browser. I used to use the Tab + Enter key combination to quickly submit, with the Tab key to move the focus to "submit" button (a small number of cases need to press the Tab key several times), press the Enter key. "Ctrl + Enter" key combination you need to call Javascript script to achieve, even if the page with the author this method does not use scripts can be quickly submitted.
6, replacement Tab key
Opening when the Tab key that can generate a tab, if want to replace tabs, how do? Very simple, in Word, press the key combination Ctrl + H, in the "Find what" type "^ t", "replaced by" do not fill in, click Replace All to quickly remove tabs. In EmEditor, the same press the key combination Ctrl + H, in the "Find", type "\ t", "replaced by" do not fill in, and check "Use the escape sequence", click "Replace All" button.
Tab key on the keyboard in case key (Caps Lock) of the above, it is more of a familiar, does not know a hidden world of magic button.
Tab key is short for tabulator key, which means "for the table were, tab machines (typewriter used for the tab) Tab key." It is the most basic usage is the form used to draw no borders. Following figure, the interval between words are pressing the Tab key once to achieve. It generally is equal to eight spaces in length, when it's in front of a word when the word length together and just be divisible by 8, as shown in the last line.
Why not call for the tab key Tab key then? Because the Tab key to not only be used to watch, and it has many practical uses, far beyond the scope of watchmaking.
Basic Usage
1, changing the focus
Focus to the next button, input box or links. For example, the closure of a notebook is not saved, a prompt will pop up (below), this time, "Yes" button has a dotted line, if you press space or carriage return is equivalent to use the mouse to click the "Yes" button. Want to use the keyboard to "click" "No" button, press the Tab key, the dotted line will be transferred to the "No" on, then press space on it.
There is also a very common usage, QQ in forums or when the log, enter the complete account number, do not need to re-use mouse to click the password box, simply press the Tab key you can locate the cursor to the password box. If you want to turn location, the press the key combination Shift + Tab.
2, rapid re-named
In Vista or Windows Server 2008 under, Tab key and a wonderful use: select an icon on the desktop, press F2 to enter rename state, renamed after, and then press the Tab key will enter the next file to rename state. Would like to turn to rename a file, you can press the key combination Shift + Tab. Rename multiple files at a time when very convenient. (Thanks to dofy test.)
3, switching window
Veterans who often use Alt + Tab key combination to quickly switch between windows. The first press the key combination Alt key and press the Tab key, you can quickly switch to the previous window. Hold down the Alt keys in the case, press the Tab key will appear once the current open windows icon, then press the Tab key you can switch between each icon. Alt + Shift + Tab key combination is the reverse switch. Release the Alt key will switch the window. In Vista, press this key combination still appears thumbnail window.
4, tab, or label switching
Ctrl + Tab: Switch to next tab or browser tabs.
Ctrl + Shift + Tab: reverse switch.
Firefox users can install this extension, Ctrl-Tab to achieve with a preview of the label switching. By the way, press Ctrl + Shift + A key combination can preview all the labels, you can immediately enter in the search box to filter the tag. Extension installation address is: http://en.design-noir.de/mozilla/ctrl-tab/
Advanced Usage
1, at the command prompt
At the command prompt, Tab key is very useful, it can automatically populate the names of files and folders (if a bit strange call is automatically populated). Some readers may already know, but there is another part of this little-known techniques a secret. First look at a presentation picture, may be a bit dizzy, sparking the cursor disappear when the time is pressing the tab of the moment:
The following example is explained in detail below:
Suppose "D: \ cfan" path, there are folders: a, ab, a file: abc.txt, ac.txt. Click "Start → Run," enter "cmd", press Enter to open a command prompt. Input "D:", carriage return after the switch to the D drive, enter "cd cfan" command into the "D: \ cfan" this folder. In the "D: \ cfan>" behind the importation of "dir" (Note that there is a space behind dir):
① Automatically populate a folder or file name: Press the Tab key can be directly filled circle the names of folders and files, use Shift + Tab can fill a.
② automatically populate a specific letter at the beginning of the folder or file name: enter "a", then press the Tab key, you can turn a folder filled with "a" and documents "abc.txt". Enter the name of a very long time a folder or file is useful.
③ automatically populate a specific file extension name: Enter "*. txt", then press the Tab key, you can turn populate file "abc.txt", "ac.txt". At the command prompt, the asterisk on behalf of any character.
④ automatically populate the second letter to a specific folder and file name: enter "? B *", then press the Tab key, you can turn a folder filled with "ab" and documents "abc.txt". Question mark represents a character in here.
⑤ automatically populate the file name specified length of file name: Enter "???. txt ", then press the Tab key, you can turn populate file" abc.txt "and" ac.txt ".
2, the input methods
Google Pinyin input method in the middle, Tab key is the back flip. Shift + Tab is a forward flip. Sogou Pinyin input method in the middle, press the Tab key to enter the stroke screening model. Use is to enter a word or multiple word spelling, press the tab key, then h (cross), s (vertical), p (write), n (strokes), z (discount) enter the first word in turn The order of strokes, has been to find the word so far. In this mode, the Separation of Chinese secondary code can also be used, for example, to enter a Chinese character "han" is on the list but could not find, then input "xian", then press the Tab key, then enter the "han" two parts " Female "," leisure "and the initials" nx ", you can see only a" han "word has.
3, where in Photoshop
After pressing the Tab key will hide the toolbar and the panel, only the menu bar. This shortcut key combination of regular full-screen shortcut "f" to use.
4, under the EmEditor and EditPlus
In EmEditor and EidtPlus when writing code under the program, select multiple lines, press the Tab key to quickly select multiple rows for the indentation. Shift + Tab key combination is the reverse indentation.
5, in the browser
Some time back to support the Forum with the key combination "Ctrl + Enter" to quickly submit, but this combination of keys does not necessarily support each browser. I used to use the Tab + Enter key combination to quickly submit, with the Tab key to move the focus to "submit" button (a small number of cases need to press the Tab key several times), press the Enter key. "Ctrl + Enter" key combination you need to call Javascript script to achieve, even if the page with the author this method does not use scripts can be quickly submitted.
6, replacement Tab key
Opening when the Tab key that can generate a tab, if want to replace tabs, how do? Very simple, in Word, press the key combination Ctrl + H, in the "Find what" type "^ t", "replaced by" do not fill in, click Replace All to quickly remove tabs. In EmEditor, the same press the key combination Ctrl + H, in the "Find", type "\ t", "replaced by" do not fill in, and check "Use the escape sequence", click "Replace All" button.
Using DOS commands to see one through the system quickly
As long as a DOS command on the system can touch one of these conditions clear.
The first step: Click "Start → Run" to open the Run dialog box, enter "cmd" (without quotation marks, the same below) and press the Enter key, open a command prompt window.
Step Two: At the command prompt, enter "systeminfo> c: \ sysInfo.txt", press the Enter key implementation. Haha, this time in the root directory on C will create a sysInfo.txt file that contains your host name, operating system details, product ID, processor type, memory, BIOS version, system directory path, virtual memory details , the patch installation conditions and LAN connections and other detailed reports.
Step Three: If you bother to call the resource manager and then step by step into the C drive directory go to open sysInfo.txt, directly at the command prompt and enter "start c: \ sysInfo.txt", you can quickly open the report file.
Tip:
★ "systeminfo" is the XP system, view system information carried by a command line tool, it can take some special parameters to specify the connection the remote system, specify the display format of the results, the specific can enter "systeminfo /?" Command to see ; ">" is a DOS redirect command, other commands can export the results shown to a text file, which is specified later in the export file name. "Start" is under a DOS start command, its role is similar to our Explorer double-click a file.
The first step: Click "Start → Run" to open the Run dialog box, enter "cmd" (without quotation marks, the same below) and press the Enter key, open a command prompt window.
Step Two: At the command prompt, enter "systeminfo> c: \ sysInfo.txt", press the Enter key implementation. Haha, this time in the root directory on C will create a sysInfo.txt file that contains your host name, operating system details, product ID, processor type, memory, BIOS version, system directory path, virtual memory details , the patch installation conditions and LAN connections and other detailed reports.
Step Three: If you bother to call the resource manager and then step by step into the C drive directory go to open sysInfo.txt, directly at the command prompt and enter "start c: \ sysInfo.txt", you can quickly open the report file.
Tip:
★ "systeminfo" is the XP system, view system information carried by a command line tool, it can take some special parameters to specify the connection the remote system, specify the display format of the results, the specific can enter "systeminfo /?" Command to see ; ">" is a DOS redirect command, other commands can export the results shown to a text file, which is specified later in the export file name. "Start" is under a DOS start command, its role is similar to our Explorer double-click a file.
Very difficult to solve computer way to delete files
In such cases: Computer Mou There is a folder on the hard disk After many ways for Chang Shi Du Wufashanchu, in resource management device which will remove the time "Can not delete file: can not read the source file or disk" error suggested, In the console with the following rd (rmdir) command to delete when it says "system can not find the file specified" try unixutil the unlink and rm all else fails it. Even tried to check the file system for problems, but still not found the problem. The existence of this folder is simply a scourge, want to get rid.
Below to Windows XP as an example, delete this folder and effective method:
You first need to understand and are familiar with the operation of the command:
If you want to delete the folder or file is a hidden attribute, deletion of the command is:
rd / a folder
del / a File
Hypothesis can not afford to delete the folder in the "g: \ delete" directory the following, the operation is as follows:
1, "start" "" "Run" in the "Run" dialog box, type: cmd
2, at the command prompt, type:
g: - Enter
cd \ delete - Enter
Manually switch to the current position "g: \ delete" directory.
If the command is successful in front of the flashing cursor will appear "g: \ delete>" prompt.
3, type "dir / x" command, then press Enter to run the command. Window displays the directory delete all the files, folders, information, information in the columns displayed in the penultimate as "8.3" format short name. Truncated name will generally be a "~ 1" at the end.
4, choose you need to delete the file or folder where the line, see the penultimate line of the column to its files, folders, copy down the name, then "g: \ delete>" command prompt and enter :
If it is delete the folder on the input: rd folder (copy) - Enter
If you delete the file, enter: del files (copy) - Enter
At this point, should be able to successfully remove such a file or folder it!
However, it is difficult to remove the folder, there is one thing we should borrow, is to use it to store useful information without fear of being easily removed!
Below to Windows XP as an example, delete this folder and effective method:
You first need to understand and are familiar with the operation of the command:
If you want to delete the folder or file is a hidden attribute, deletion of the command is:
rd / a folder
del / a File
Hypothesis can not afford to delete the folder in the "g: \ delete" directory the following, the operation is as follows:
1, "start" "" "Run" in the "Run" dialog box, type: cmd
2, at the command prompt, type:
g: - Enter
cd \ delete - Enter
Manually switch to the current position "g: \ delete" directory.
If the command is successful in front of the flashing cursor will appear "g: \ delete>" prompt.
3, type "dir / x" command, then press Enter to run the command. Window displays the directory delete all the files, folders, information, information in the columns displayed in the penultimate as "8.3" format short name. Truncated name will generally be a "~ 1" at the end.
4, choose you need to delete the file or folder where the line, see the penultimate line of the column to its files, folders, copy down the name, then "g: \ delete>" command prompt and enter :
If it is delete the folder on the input: rd folder (copy) - Enter
If you delete the file, enter: del files (copy) - Enter
At this point, should be able to successfully remove such a file or folder it!
However, it is difficult to remove the folder, there is one thing we should borrow, is to use it to store useful information without fear of being easily removed!
linux more command: read files by page
Description:
more command and command similar to cat, cat command is the entire contents of a file to standard output, and more orders are displayed as a page file, user-friendly read.
Syntax:
more [-dlfpcsu] [-num] [+ / pattern] [+ num] [fileNames ..]
Options description:
-D: prompt the user, the screen shown below [Press space to continue, q to quit.], If the user pressed the wrong button, it will show [Press h for instructions.] Instead of beeps;
-L: Cancel meet the special characters ^ L (feed characters) will be suspended during the function;
-F: When calculating the number of rows to the number of rows in fact, rather than wrap the line after the number of (some single words too long will be extended to more than two lines or two lines);
-P: no way to scroll display on each page, but first clear the screen after the display;
-C: with the-p similar, except that the first display and then clear the other old data;
-S: When faced with two lines or more consecutive blank line, the substitution for the line of blank lines;
-U: do not display the next quote (according to the specified terminal environment variable TERM vary);
+ /: Search for each file before displaying the string (pattern), and then start from the string after the show;
-Num: Display to num lines;
+ Num: num lines from the beginning to show;
Implementation of the example:
01 $ more text
02 test.sh
03 link
04 123
05 $ more -2 text
06 test.sh
07 link
08 --More--(76%)
09 $ more +2 text
10 link
11 123
12 $ ls -l | more
Extended reading:
more interactive command options:
Press the spacebar (space) next page;
Press b button will back a display;
Press q to exit;
/ Pattern: search forward from the current location of a specified pattern of characters specified location
more command and command similar to cat, cat command is the entire contents of a file to standard output, and more orders are displayed as a page file, user-friendly read.
Syntax:
more [-dlfpcsu] [-num] [+ / pattern] [+ num] [fileNames ..]
Options description:
-D: prompt the user, the screen shown below [Press space to continue, q to quit.], If the user pressed the wrong button, it will show [Press h for instructions.] Instead of beeps;
-L: Cancel meet the special characters ^ L (feed characters) will be suspended during the function;
-F: When calculating the number of rows to the number of rows in fact, rather than wrap the line after the number of (some single words too long will be extended to more than two lines or two lines);
-P: no way to scroll display on each page, but first clear the screen after the display;
-C: with the-p similar, except that the first display and then clear the other old data;
-S: When faced with two lines or more consecutive blank line, the substitution for the line of blank lines;
-U: do not display the next quote (according to the specified terminal environment variable TERM vary);
+ /: Search for each file before displaying the string (pattern), and then start from the string after the show;
-Num: Display to num lines;
+ Num: num lines from the beginning to show;
Implementation of the example:
01 $ more text
02 test.sh
03 link
04 123
05 $ more -2 text
06 test.sh
07 link
08 --More--(76%)
09 $ more +2 text
10 link
11 123
12 $ ls -l | more
Extended reading:
more interactive command options:
Press the spacebar (space) next page;
Press b button will back a display;
Press q to exit;
/ Pattern: search forward from the current location of a specified pattern of characters specified location
linux mv command: move a file or rename
Basic operation for:
mv command to rename a file or directory, or file into another location.
Syntax:
mv [-if] the source file target file # file rename
mv [-if] file ... directory # the file (one or more) moved to the specified directory
Options description:
-I: If the specified directory has the same title, is first asked to overwrite the old file;
-F: the mv operation to cover an existing target file does not give any instructions;
Implementation of the example:
view sourceprint? 1 $ mv text.txt text.log # files will be renamed as text.log text.txt
2 $ mv text.log yesterday.log logs # will text.log and yesterday.log into the logs directory
3 $ mv info / logs # the info into the logs directory directory. Note that if the logs directory does not exist, then the command info renamed logs.
#After No. Description.
mv command to rename a file or directory, or file into another location.
Syntax:
mv [-if] the source file target file # file rename
mv [-if] file ... directory # the file (one or more) moved to the specified directory
Options description:
-I: If the specified directory has the same title, is first asked to overwrite the old file;
-F: the mv operation to cover an existing target file does not give any instructions;
Implementation of the example:
view sourceprint? 1 $ mv text.txt text.log # files will be renamed as text.log text.txt
2 $ mv text.log yesterday.log logs # will text.log and yesterday.log into the logs directory
3 $ mv info / logs # the info into the logs directory directory. Note that if the logs directory does not exist, then the command info renamed logs.
#After No. Description.
订阅:
评论 (Atom)