@Arronical 답변을 단순화하기 위해 최근에 배운 깔끔한 트릭은 zcat -qf
txt 및 txt gzipped 파일을 모두 cat 하는 데 사용할 수 있다는 것 입니다.
zcat /var/log/apt/history.log.*.gz | cat - /var/log/apt/history.log | grep -Po '^Commandline: apt-get install (?!.*--reinstall)\K.*'
된다
zcat -qf /var/log/apt/history.log* | grep -Po '^Commandline: apt-get install (?!.*--reinstall)\K.*'
남자 zcat에서 :
-q --quiet
Suppress all warnings.
-f --force
Force compression or decompression even if the file has multiple links or the corre‐
sponding file already exists, or if the compressed data is read from or written to a
terminal. If the input data is not in a format recognized by gzip, and if the option
--stdout is also given, copy the input data without change to the standard output: let
zcat behave as cat. If -f is not given, and when not running in the background, gzip
prompts to verify whether an existing file should be overwritten.