Open bingooyong opened 5 years ago
for SQL in *.sql; do mysql -h ip -uroot -p"password" < $SQL; done
yum install --downloadonly --downloaddir=/root nginx
ls -t|awk '{if(NR>1){print $1}}' | xargs rm -rf {};
例如我想得到根目录下所有目录或文件的占用空间大小,并且想要排除名字中包含 proc 的文件或目录,可以使用如下命令
du -sh /* --exclude="proc"
或使用 模糊匹配 都行
du -sh /* --exclude="*proc*"
扩展内容,想要排除多个文件或文件夹,且只想看到空间大于 G 的结果
du -sh /* \
--exclude="proc" \
--exclude="cgroup" \
--exclude="selinux" \
--exclude="*bin" \
--exclude="lib*" \
--exclude="etc" \
--exclude="sys" \
--exclude="boot" \
--exclude="data*" | grep G
du -sh * | sort -rh
[footstone@trace01-192-168-29-27 ~]$ du -sh * | sort -rh
1.2G otter
281M bingoohuang
174M apache-skywalking-apm-bin
135M apache-skywalking-apm-bin.zip
61M logs
39M 2927_otter_manager1117_bak.tar.gz
14M apm-demo
12M hebe.linux.bin
12M hebe
6.1M hebe.linux.bin.tar.gz
1.8M es_clean_cron.log
16K trace-buffer
8.0K mesh-buffer
8.0K application.yml
4.0K webapp.yml
4.0K test.txt
4.0K id_rsa.pub
4.0K clean.sh
➜ ~ ssh 10.211.55.27
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:otUwBKeh79nBguE8P0amYAymuNVKYYHDc1qmTn5zK+M.
Please contact your system administrator.
Add correct host key in /Users/bingooyong/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/bingooyong/.ssh/known_hosts2:725
Host key for 10.211.55.27 has changed and you have requested strict checking.
Host key verification failed.
使用 ssh-keygen -R hostname
来清除
ssh-keygen -R 10.211.55.27
ssh-keygen -R 10.211.55.27 -f /Users/bingooyong/.ssh/known_hosts2
How to append multiple lines to a file
cat
printf
tee