精品专区-精品自拍9-精品自拍三级乱伦-精品自拍视频-精品自拍视频曝光-精品自拍小视频

網(wǎng)站建設(shè)資訊

NEWS

網(wǎng)站建設(shè)資訊

linux常用的配置有哪些?

變量值

創(chuàng)新互聯(lián)建站主要從事網(wǎng)站建設(shè)、成都做網(wǎng)站、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)雞西梨樹,十多年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220

echo $USER
echo $?
echo $PS1
echo $PATH

配置文件修改部分:

[root@node4~]#cp /etc/DIR_COLORS ~/dir_colors 
vim  ~/dir_colors 
 88 DIR 01;33       # directory
[root@centos6 ~]#vim ~/.bashrc 
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias grep='grep --color=auto'
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
alias cdnet='cd /etc/sysconfig/network-scripts/' 
[root@centos6 ~]#. .bashrc
[root@node4~]#cat   ~/.vimrc
set nu
set cul
set ai 
set paste
set ic
set ai

 
 
 centos6 防火墻:
 service iptables stop
 chconfig iptables off 
 centos7:防火墻:
 systemctl stop firewalld 
 systemctl disable firewalld

日志清理部分:

[root@centos6 /proc/10]#find / -mount  -type f -size +100M  |xargs -i du -sh {}|sort -nr
3.8G    /root/centos6.9.iso

腳本部分:

df |grep ^/dev/sd |sed -r "s/.*[ ]+([0-9]{1,3})%.*/\1/"
df -i  |grep ^/dev/sd |sed -r "s/.*[ ]+([0-9]{1,3})%.*/\1/"
[root@node4~]#ifconfig  eth0  |head -n2 |tail -n1 |tr -s " "  |cut -d " " -f3
192.168.137.47
[root@centos6 ~]#ifconfig  eth0  |head -n2 |tail -n1 |cut -d ":" -f2 |cut -d " " -f1
192.168.137.6
[root@centos6 /app]#df |tr -s " " "%" |cut -d % -f 5 
[root@node4/var/log/httpd]#cut -d " " -f1  access_log |sort |uniq -c|sort -nr  
      4 192.168.137.1
      2 192.168.0.118
[root@node4/var/log/httpd]#awk '{a[$1]++}END{for (i in a ){print i,a[i]}}'< /var/log/httpd/access_log

[root@node4/app]#seq 1 10 |sort -R |head -n1  隨機取數(shù)
3

[root@node4/app]#cut -d: -f1,3 /etc/passwd  |sort -t:  -k2 -n
root:0
bin:1
daemon:2
adm:3
lp:4

[root@node4/app]#cat /var/log/httpd/access_log |cut -d " " -f1  |sort |uniq -c |sort -nr 
      7 192.168.137.1
      2 192.168.0.118
      
[root@centos6 /app]#awk 'BEGIN{x=1.5;y=1024;z=85/100;printf "%0.2f\n",x*y*z}'           
1305.60

[root@node4~]#df |grep /dev/sd  |grep  -o "[0-9]\+%" |grep -o "[0-9]\+" |sort -nr |head -n1
29

[root@node4~]#egrep -v "^#|^$" /etc/fstab
[root@node4~]#grep -v -e "^#" -e "^$" /etc/fstab
[root@node4~]#grep -v -e"^[[:space:]]*$" -e "^#" /etc/fstab  

[root@node4~]#cat /etc/passwd |grep "^\(.*\):.*/\1$"
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
[root@node4~]#cat /etc/passwd |egrep "^(.*):.*/\1$" 

axy
[root@node4~]#echo axy |egrep "(a|b)xy"
axy
[root@node4~]#cat /etc/redhat-release|grep -o " [0-9]\+." |grep -o "[0-9]\+"                 
7
[root@node4~]#cat /etc/centos-release |grep -o "[0-9]\+"  |head -n1
7
分組:\(\) 將一個或多個字符捆綁在一起,當(dāng)作一個整體進行處理,如: 
\(root\)\+ 
?
分組括號中的模式匹配到的內(nèi)容會被正則表達式引擎記錄于內(nèi)部的變量中,這 
些變量的命名方式為: \1, \2, \3, ... 
?
\1 表示從左側(cè)起第一個左括號以及與之匹配右括號之間的模式所匹配到的字符 
?
示例: \(string1\+\(string2\)*\) 
 \1 :string1\+\(string2\)* 
 \2 :string2 
?
后向引用:引用前面的分組括號中的模式所匹配字符,而非模式本身 
?
或者:\| 
示例:a\|b: a或b C\|cat: C或cat \(C\|c\)at:Cat或cat

修改密碼部分;

密碼部分:
[root@centos6 /app]#openssl rand -base64 100 |tr -dc "[:alnum:]"|head -c12
4oa9aPP1tr9I

[root@centos6 /app]#cut -d : -f 1,3 /etc/passwd 

[root@centos6 /app]#df |tr -s " " "%" |cut -d % -f 5

變量:

[root@centos6 /app]# echo $[$RANDOM%80+1]
30

[root@node4~]#egrep  -w "^(root|sun)" /etc/passwd|cut -d: -f1,7 

root:/bin/bash

sun:/bin/bash

ip地址:

[root@node4~]#egrep  -w "^(root|sun)" /etc/passwd|cut -d: -f1,7 

root:/bin/bash

sun:/bin/bash


本文題目:linux常用的配置有哪些?
分享路徑:http://m.jcarcd.cn/article/ghhhsp.html
主站蜘蛛池模板: 91免费版在线观看 | 日韩一区二区在线 | 看片一区 | 国产精品视频一 | 国产午夜激情视频 | 国产综合色产在线视 | 成人激情五月天 | 91视频成人 | 日本簧片在线观 | 日韩国产码高清 | 国产疯狂伦交大片 | 日本在线在线亚洲 | 成人午夜福利看片 | 尤物视频在线网站 | 国产欧美在线视频免 | 成人免费看 | 日韩高清1区2区 | 97在线观| 中文字幕在线第一页 | 女同蕾丝一 | 国产玉足脚| 国产一区二区不 | 日韩午夜免费免费 | 国产视频精 | 国产男女爽爽 | 国产在线第一页 | 国产视频不卡一区 | 国产91在| 国产主播在线观看网 | 九九这里只有精品 | 99精品热 | 青岛猎头公司 | 日本网站成人直播 | 日本在线看免费 | 国产免费观看 | 精品免费中文字幕 | 日本午夜免费理论片 | 日本三级强在线观看 | 日韩午夜片 | 国产精品国色综 | 国产不卡在线观看 |