Linux if command
No matter what programming language, conditional judgment is indispensable. SHELL is no exception.If listThenDo somethingHereElif listThenDo another thingHere
ElseDo something else hereFi
#! /Bin/sh
SYSTEM = 'uname-S' # obtain the
Create directory mkdir file name mkdir/var/www/testThe cp command is used to copy files from one location to another. If the destination file exists, the file will be overwritten; If the destination directory exists, the file will be copied to this
Vi editor usageThe vi editor is a standard editor for all Unix and Linux systems. It is not inferior to any of the latest text editors. Here we just briefly describe its usage andA small part of commands. The vi editor is identical for any version
Enter the centos graphical interfaceTo directly access the Console interface when Linux is started, you can use vi to edit the/etc/inittab file. Find the line id: 3: initdefault: and change it to id: 5: initdefault: And then restart the system. We
In windows, you can log out of an online user through the task manager.There is also a similar method in linux, that is, using the pkill command, the steps are as follows:1. Use the w command to view the users currently logged on to the system:[Root
Some useful things have been merged in the East and West, which can be pasted in the nginx configuration file,
Complicated functions, anti-leech protection, anti-injection protection, etc.
location = /robots.txt { access_log off; log_not_found off; }
Find is a commonly used Linux Command, but we generally look for it not only, but also further operations. At this time, the role of exec becomes apparent.Example:Find./-name "*. txt"-exec ls-l "{}"\;Find the TXT file of the current directory and
# How to partition a linux system in a production scenario?# Date: 2011-07-31# Author: Old Boy# QQ: 31333741 MAIL: oldboy521@hotmail.com# QQ group: 45039636# Blog: http://oldboy.blog.51cto.com# Psite: http://oldboy.cc (coming soon)# Pblog:
I downloaded wine last night. It was quite uncomfortable to use it. I planned to uninstall it. After I used yum remove wine, I found that many wine related programs were not uninstalled. The rest is made by using the following methods:
1. Run rpm-aq
Which command
Function Description: The which command is used to search for the location of a system command in the PATH specified by the PATH variable and return the first search result. That is to say, you can use the which command to check
Ln
Name: ln-make links between files
Function Description: there is a so-called link in the linxu system. There are two types of links:
==========================================================
Iptables is an extremely flexible firewall tool designed for Linux operating systems. Iptables is useful for Linux geeks and system administrators. This article will show you how to configure the most common Linux firewall.About iptables
Iptables is
First display: related commands ls, pwd
Ls commands are very powerful and commonly used, but they are hard to remember.
1-1. For non-Internal commands (such as ls, rm, and mkdir), you cannot use help to view help.
1-2, ll = ls-l // display in long
After Linux completes Kernel boot, the/etc/inittab configuration file will be called by the init initialization process(Ps-aux | less, init process number is always 1, is the starting point of all system processes, init process also has a parent
1. Modify the user name, user group, and home directory in the/etc/passwd file;2. Modify the username and user group in the/etc/group file, and rewrite/etc/gshadow;3. Modify the username in the/etc/shadow file. If this parameter is not changed, you
You can view it through ps, and through parameter-o.
Example: ps-eo pid, tty, user, comm, lstart, etime | grep init
Parameter description:
Pid: process ID
Tty: Terminal
User: user
Comm: process name
Lstart: Start Time
Etime: running time
Shutdown: shutdown-h now
Restart: reboot
Network Settings: vi/etc/sysconfig/network-sripts/ifcfg-eth0 # Set network connection type, IP, gateway, subnet mask
Vi/etc/sysconfig/network # Set the Host Name
Vi/etc/resolv. conf # Set DNS
Service
Use ls-l to view the number of hard links of a document:
[Root @ localhost tmp] # ls-liTotal 1042291_drwxr-xr-x2root root 4096 Dec 11 etc7-rw-r -- r -- 2 root 1602 Oct 30 hl_passwd
Use the following statement to view the hard links of a file.
By default, linux does not allow the root user to log on to the linux host through telnet. To allow the root user to log on, you can use one of the following three methods:
1. Modify the login file
Remote Logon Restrictions in RedHat are reflected
Common performance analysis tools.
1. vmstat commandVmstat is short for Virtual Meomory Statistics (Virtual Memory Statistics). This command tool is installed by default in many linux releases, the vmstat command can be used to monitor the memory
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service