The following shell is used under CentOS.
Get version of a compressed package
[Email protected]:/work/lnmp$ ll-a php.tar.gz-rw-rw-r--1 huwei huwei 18355694 March 14:32 php.tar.gz[email protected]:/ work/lnmp$ tar-ztf php.tar.gz|tail-1|awk-f '/' {print $} ' php-5.6.19
Random passwords, for MySQL, not easy to use underscores and special symbols, using mysqldump backup will fail.
Passvar= ' Cat/dev/urandom | TR-DC "A-za-z0-9" | Fold-w |head-n 1 '
Check if there is a MySQL user, if there is no side created
ID MySQL if [$?-ne 0] then Useradd mysql-s/sbin/nologin/usr/sbin/useradd Mysql-s/sbin/nologin fi
Find large files with the Find command
[Email protected]:~$ sudo find/home/huwei/-type f-size +6g-ls20319458 6479992-rw-------1 Huwei huwei 6637486 080 March 2 14:15/home/huwei/virtualbox\ VMS/TEST50/SNAPSHOTS/{644BADC2-A908-4E74-A2EC-A03F52B21578}.VDI
Through the Find
This article is from the "bottom 20,000" blog, please be sure to keep this source http://huwei555.blog.51cto.com/1347480/1751310
Some Linux shells