提高效率

  printenv

  set

  echo

  alias

设置常用命令的快捷键

0-查询已有  alias -p

1-回家 cd ~

2-bash文件,找到定义的脚本

  

[root@hadoop1 ~]# ll -as
总用量 3519796
4 dr-xr-x---. 20 root root 4096 12月 6 08:45 .
4 dr-xr-xr-x. 18 root root 4096 12月 6 08:44 ..
4 drwxr-xr-x 22 hadoop hadoop 4096 11月 20 19:46 anaconda3
4 -rw-------. 1 root root 1017 9月 8 20:30 anaconda-ks.cfg
0 drwxr-xr-x 3 root root 19 11月 22 22:11 .astropy
16 -rw-------. 1 root root 15533 12月 5 10:09 .bash_history
4 -rw-r--r--. 1 root root 18 12月 29 2013 .bash_logout
4 -rw-r--r--. 1 root root 176 12月 29 2013 .bash_profile
4 -rw-r--r--. 1 root root 176 12月 29 2013 .bashrc
0 drwxr-xr-x 3 root root 40 11月 24 22:32 bin

【注意 在等号左右处,避免空格】

[root@hadoop1 ~]# cat .bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias xlpy='ps -aux|grep python|grep ^grep'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

效率  找到后直接删除 

find  -action

查找链接,修改python2.7为python3.6

find / -type l  | grep python

 Linux 升级 Python 至 3.x - CSDN博客 https://blog.csdn.net/liang19890820/article/details/51079633

过滤日志结果 按大小 按时间  排序

 ll -as | grep tmp | sort -k 1n

 ll -as | grep tmp | sort -k 9n

[root@hadoop1 log]# ll -as | grep tmp
232 -rw-r--r-- 1 root root 234260 12月 11 19:00 20171206chk_url_status_tmpb.py.log
68 -rw-r--r-- 1 root root 67360 12月 11 18:58 20171206chk_url_status_tmp.py.log
72 -rw-r--r-- 1 root root 73084 12月 11 18:58 chk_url_status_update_tmp_error.py20171211_112818
0 -rw-r--r-- 1 root root 0 12月 11 18:58 chk_url_status_update_tmp_error.py20171211_112818seleniumlog
72 -rw-r--r-- 1 root root 70606 12月 11 18:59 chk_url_status_update_tmp_error.py20171211_113210

[root@hadoop1 log]# ll -as | grep tmp | sort -k 1n
0 -rw-r--r-- 1 root root 0 12月 11 18:58 chk_url_status_update_tmp_error.py20171211_112818seleniumlog
0 -rw-r--r-- 1 root root 0 12月 11 18:58 chk_url_status_update_tmp_error.py20171211_135609
0 -rw-r--r-- 1 root root 0 12月 11 18:58 chk_url_status_update_tmp_error.py20171211_153411seleniumlog
0 -rw-r--r-- 1 root root 0 12月 11 18:59 chk_url_status_update_tmp_error.py20171211_115310seleniumlog
0 -rw-r--r-- 1 root root 0 12月 11 18:59 chk_url_status_update_tmp_error.py20171211_153058seleniumlog
0 -rw-r--r-- 1 root root 0 12月 11 19:00 chk_url_status_update_tmp_error.py20171211_153043seleniumlog
0 -rw-r--r-- 1 root root 0 12月 11 19:00 chk_url_status_update_tmp_error.py20171211_153245seleniumlog
4 -rw-r--r-- 1 root root 123 12月 11 18:58 chk_url_status_update_tmp_error.py20171211_124826
4 -rw-r--r-- 1 root root 123 12月 11 18:58 chk_url_status_update_tmp_error.py20171211_133459

[root@hadoop1 log]# ll -as | grep tmp | sort -k 9n
21688 -rw-r--r-- 1 root root 22202669 12月 12 02:58 chk_url_status_update_tmp_error.py20171211_191501
4 -rw-r--r-- 1 root root 2120 12月 12 02:55 chk_url_status_update_tmp_error.py20171211_191501seleniumlog
4 -rw-r--r-- 1 root root 423 12月 12 03:16 chk_url_status_update_tmp_error.py20171212_031601
23148 -rw-r--r-- 1 root root 23697325 12月 12 04:12 chk_url_status_update_tmp_error.py20171211_191601
4 -rw-r--r-- 1 root root 2120 12月 12 04:12 chk_url_status_update_tmp_error.py20171211_191601seleniumlog
23636 -rw-r--r-- 1 root root 24199053 12月 12 06:54 chk_url_status_update_tmp_error.py20171211_201601
4 -rw-r--r-- 1 root root 1481 12月 12 06:58 chk_url_status_update_tmp_error.py20171211_211602seleniumlog
4 -rw-r--r-- 1 root root 1489 12月 12 06:53 chk_url_status_update_tmp_error.py20171211_201601seleniumlog
21168 -rw-r--r-- 1 root root 21674810 12月 12 07:00 chk_url_status_update_tmp_error.py20171211_211602