常用命令集合

# dd  if=/dev/zero  of=/dev/null                             zero源源不斷的產生數據到黑洞null
# dd  if=/dev/zero  of=/data/a.tgz  bs=1M  count=100         zero產生100M的數據到/data/a.tgz
Shift trl T                                                  打開新的終端頁面
# echo  123 |  passwd  --stdin  root                         開機默認修改root密碼
# cat  /etc/services  |  less                                查看端口號
# convmv  -f  GB2312  -t  utf8  -r  --notest   目錄           亂碼轉換工具convmv
# cp  /etc/vsftpd/vsftpd.conf{,.bak}                         快速備份
# cp  /etc/vsftpd/vsftpd.conf{.bak,}                          備份覆蓋
# yum  search  elinks  //  # yum  provides  "*/elinks"        查詢軟件包名
# ps  aux  |  grep  httpd                                     查看進程
最小安裝rhel圖形界面:
# yum -y groupinstall "Desktop" "Fort" "General Purpose Desktop" "Input Methods" "X Window System" "Desktop Platform" "Chinese Support"   
# vim /etc/services                                            查看默認協議端口
# vim /etc/sysconfig/i18n                                      修改系統語言
# uuidgen                                                      自動生成UUID
# > /etc/udev/rules.d/70-persistent-net.rules        #reboot   清空網卡命名規則
# du -sh /opt                                                  查看文件大小
# cat /proc/cpuinfo     # top          # uptime                查看CPU信息,平均負載
[ -f /var/run/httpd/httpd.pid ]        echo $?                 判斷http服務是否在運行
# /usr/share/doc/*                                             軟件的使用說明目錄
# vim  /etc/ld.so.conf          # ldconfig                     系統讀取的庫文件目錄設置
# ab  -c 100  -n 1000  http://1.1.1.1/                         模擬100個人訪問服務器1000次
# vim /etc/security/limits.conf          # ulimit -a           系統內核的一些限制數目,                                        修改完後需重啓reboot
# data -d ‘@1421242424’                                        時間戳轉換
# yum -y groupinstall "X Window System"  "Desktop"             安裝桌面環境
# cat /etc/redhat-release     uname -a                         查看系統版本
# yum -y install bash-completion                               參數補全
# egrep -v“^$|^#” /etc/login.defs |wc -l                       去除#和空行的配置文件
# awk '/[a-z]|^\[/{print}'  chrony.conf
# awk '!/^#|^$/{i++}END{print i}' chrony.conf 
# awk '!/#|^$/{print}' conf/nginx.conf
# vim /etc/resolv.conf   nameserver 114.114.114.114 
# for i in * ; do docker load <${i} ; done
# for i in `docker images | grep -v REPOSITORY |  awk '{print $1}' ` ;do docker push $i;done
# doceker rm $(docker ps -aq)
# cat >centos.repo <<EOF
[CENTOS]
Name=centos
EOF
http://IP:5000/v2/_catalog
cp  ifcfg-{eth0,br-ex}
# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# yum -y install epel-release (rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm)                                    阿里雲epel源
# yum install -y centos-release-openstack-newton                安裝Openstack倉庫
# nohup ..... &                                                 放在後臺運行
# cat -n /etc/passwd | head -15 | tail -5                       打印第11行到15行
# ip add | tee a.txt | grep "inet "                             輸出到a.txt並打印inet
# openssl rand -hex 10                                          生成隨機數
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章