2. File operation, file view, find lookup

Source: Internet
Author: User
Tags mail exchange rsync fully qualified domain name rabbitmq egrep

Linux system download

http://vault.centos.org/

http://archive.kernel.org/centos-vault/5.10/isos/x86_64/

http://mirror.symnds.com/distributions/CentOS-vault/5.10/isos/x86_64/#下载系统URL


RPM Package Download

http://dl.fedoraproject.org/pub/epel/6/i386/


Learn

Http://www.kwx.gd/CentOSApp/CentOS-Fail2Ban.html


Python Learning

Http://edu.51cto.com/lesson/id-29673.html


Rookie Net

http://www.runoob.com/#redis, Python, MongoDB, git learning


/root//Admin home Directory

/home//general user's Directory


/boot//boot file storage location

/etc/config file


/bin//commands used by ordinary users

/sbin//Commands used by administrators


/var//Store Some information (such as logs)

/dev//device file storage location


Linux face questions

Introduction to Linux Services


TUI: Text user interface

GUI: Graphical user interface

CLI: Command Line interface


Ifconfig | Grep-po "(? <=ADDR:). * (? = bcast)" #取以addr开头和Bcast结尾的中间那一串字符


Ss-tln


echo $LANG View System Character Set


Yum List all ansible* #搜索ansible


history-d 2;history-c #分号前面删除第二行历史命令, semicolon empty polygon Clear History command

Histcontrol=ignorespace #把这条命令放在/etc/profile, do not log sensitive commands


See if the port is occupied

Lsof-i: 6379


Cal View system date


Background output

Nohup rabbitmq-server > Myout.file 2>&1 &

Nohup rabbitmq-server &>/dev/null &


IP Web site Query method

In addition, professional query export IP site has a lot. Similar to ip138 and ip.cn. But small Nithya suggested ip138 query more accurate OH www.ip138.com


One: Locate command


The locate command is used to find a file that is faster than the search command, and it requires a database that is built by a daily routine work (crontab) program. Once we have established this database, we can easily search for the required files.


Run First: UpdateDB (in that directory can be placed in the crontab) after the SLOCATE.DB database generated under/var/lib/slocate/can be quickly found. Execute the #updatedb command directly at the command prompt:


Example: Find related words issue


$ locate Issue

Egrep equivalent to Grep-e #-E is the meaning of the exhibition


ll--full-time #显示文件的全日期


View Concurrency Command Netstat-na | grep 80 | awk '/^tcp/{++s[$NF]} END {for (a in S) print A, s[a]} '

VMware vsphere http://edu.51cto.com/lesson/id-36772.html

Guangzhou 202.96.128.86 202.96.128.166

Jiangsu 114.114.114.114


Use the CRONTAB-E command to add a new task to the task plan.

echo "*/5 * * * * */usr/sbin/ntpdate x.x.x.x" > File.txt

Crontab file.txt


Uptime Last Who


Apache Traffic Server #缓存代理服务器

Cacti plug-in detailed--weathermap #这是一个绘制网络拓扑的插件

Rsync+inotify

Rsync+git


Create an ISO file using a catalog file

Mkisofs-r-o path/iso filename Directory file path

Example: Mkisofs-r-o/opt/mycd.iso/home


which

Sudo-i #切换到管理员

sudo passwd #给管理员设置密码

Tcpdump-nnn-i any host 192.168.1.233 #-i-any on any port monitoring

Tcpdump-n-I eth0 host 192.168.1.233 or 192.168.1.234 #-n convert domain name to ip-i-eth0 eth0 Port monitoring


Rsync-avz--progress abc.txt-e "ssh-p" [Email protected]:/tmp #rsync使用不同端口号发送文件


Shutdown-h now

Shutdown-h +15 "Computer shuts down after 15 minutes"


Scp-i Sshkey

Rsync-e ' Ssh-p22-i sshkey '


Touch A-' date+%f4 '

Date +%m

Date +%d

Date +%y

Crontab-l View current Tasks

Select Sleep (12);


Echo $PATH


Command aliases

/etc/bashrc


grep root/etc/passwd

Alias grep= ' grep--color '


BASENAME/ETC/PASSWD gets the file name of a path

Dirname/var/www/html/a.html Gets the directory name of a path

Cat-b/test.txt View file display lines

Watch-n 1 Route-n One second refresh


Uuidgen randomly generate UUID numbers

Wc-m View character Count

Wc-l Viewing rows

Wc-w See how many words


Seq 10 20


BLKID/DEV/SDA1 Viewing UID


echo "123" | passwd--stdin "$1_up"


Chkconfig--del MySQL

MV/ETC/INIT.D/MYSQL{,D}//rename MySQL to Mysqld

CP Ifcfg-{eth0,br0}//change Ifcfg-eth0 to Ifcfg-br0


Md5sum/etc/my.cnf

Head-1/dev/urandom | Md5sum


echo $RANDOM output Random numbers

Head-1/dev/urandom | md5sum | Cut-b-5 intercept numbers from 1 to 5


Echo-e "\e[32;43;1mok\e[0m"

32 foreground 43 background color 1m highlight 0m stop output OK


echo ' 409600/1024 ' | Bc


Under Terminal

Ctrl +u to delete the front

Ctrl +k to delete the back.


Iptables-l forward-s 202.1.1.10-p TCP--sport 80-j ACCEPT

^10^20, replace the 10 above with 20.


>/var/log/messages Empty Log



Egrep ' abc|123 ' *.txt |sort|uniq-c take the intersection of ABC and 123


ALT +. Key, enter the command that was entered last


echo "Obase=16;11" | BC//16 Binary Conversion



Yum-y Install Unix2dox//Installation

Unix2dos new.sh//conversion, drag Linux files to Windows, files are not wrapped



Yum-y Install Dox2unix//Installation

Dox2unix new.sh//conversion, drag Windows files to Linux, file without self-wrapping


Yum Info httpd//view summary information


6, $s/^/#/


Operation and Maintenance 5th, 6 days of experimental failure, RPM package production failed, MySQL Cluster management experiment failed


System-config-network

System-config-date


IPv6 128-bit


#cat/etc/services is written in a list of port-corresponding services. Common service ports


Tail-1/etc/hosts.deny >>/etc/hosts.allow


Vimdiff abc.txt abb.txt//Compare two files What's the difference?


Open relay Opening Relay

SOA Initiation Authorization

$TTL86400//Cache time 86400 represents one day

NS Name Server

A name –> IP

PTR Reverse IP-Name

MX Mail Exchange

CNAME: Aliases

fqdn= hostname. Domain name suffix

FQDN: Fully qualified domain name/fully qualified domain name/full name Domain


# watch–n 1 IPTABLES–NVL//Refresh the following commands every second

> ~/ssh


PIDOF process name View ID number


Ping-c 3 192.168.1.1


Evince nrpe.pdf Open File


Service Port Selection

Linux system port number range is 0-65535, different range has different meanings

0 Not used

1-1023 system reserved, can only be used by the root user

1024-4999 free distribution by client program

5000-65535 free distribution by server-side programs


This article is from the "Wsyht blog" blog, make sure to keep this source http://wsyht2015.blog.51cto.com/9014030/1790232

2. File operation, file view, find lookup

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.