There are 100 log files, each of which is approximately 1G, and each log starts with a "h:i:s" time format, such as:
05:02:04 XXX yyy zzz
Because it is a log file, so certainly in the order of time, it is now possible to determine that there is a file in a 01:02:03 this point of time about XXX log, to find out, how to do?
For f in *; Do awk '/^01:02:03/{}/^01:1/{exit} ' $f |grep xxx; Done
That way, there's not a single file that scans only a few parts.
Three ways to query the last restart time of a Linux system
method One: Lastreboot
Method Two: Who-b
Method Three: Uptime command
[Email protected]/]# rsync-azvr/home/aloft//backuphomedir
The rsync command above uses-Z to enable compression,-V is a visualization, and-R is recursive. The above is synchronized between local/home/aloft/and/backuphomedir Local.
-A option that retains everyone and owning groups, timestamps, soft links, permissions, and runs in recursive mode.
Example: 3-synchronizing local to remote host
[Email protected]/]# rsync-avz/home/aloft/[email protected]:192.168.1.4:/share/rsysnctest/
CHPASSWD commands are simple to use [email protected]_221-81 ~]# echo "qa:1234" | chpasswd
Awk,rsync, restart