Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common configurations of linux?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

variable values

echo $USERecho $? echo $PS1echo $PATH

Configuration file modifications:

[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 definitionsif [ -f /etc/bashrc ]; then . /etc/bashrcfialias cdnet='cd /etc/sysconfig/network-scripts/' [root@centos6 ~]#. .bashrc[root@node4~]#cat ~/.vimrcset nuset culset ai set pasteset icset ai centos6 firewall: service iptables stop chconfig iptables off centos7: firewall: systemctl stop firewall systemctl disable firewall

Log cleanup section:

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

Script section:

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 " " -f3192.168.137.47[root@centos6 ~]#ifconfig eth0 |head -n2 |tail -n1 |cut -d ":" -f2 |cut -d " " -f1192.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 random access 3[root@node4/app]#cut -d: -f1,3 /etc/passwd| sort -t: -k2 -nroot:0bin:1daemon:2adm:3lp: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 -n129[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/syncshutdown:x:6:0:shutdown:/sbin:/sbin/shutdownhalt: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 -n17 grouping: \(\) Bundles one or more characters together and treats them as a whole, e.g.\(root\)\+ grouping The matched contents of the pattern in parentheses are recorded by the regular expression engine in internal variables named: \1, \2, \3,... \1 indicates the character matched by the pattern between the first left parenthesis from the left and the matching right parenthesis

Modify the password part;

Password part: [root@centos6 /app]#openssl rand -base64 100| tr -dc "[:alnum:]"| head -c124oa9aPP1tr9I[root@centos6 /app]#cut -d : -f 1,3 /etc/passwd [root@centos6 /app]#df |tr -s " " "%" |cut -d % -f 5

Variable:

[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 address:

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

root:/bin/bash

sun:/bin/bash

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report