Linux Learning _ Extract multiple files in chronological order to search for content in a file

Source: Internet
Author: User

The results of LS are sorted by time data, then 5 files at the end, and then the TAR command is called.

ls-1 | Sort-u | Tail-5 |xargs-n1 Tar xzvf

  

Use the grep command to search from a file.

Grep-s Findstr/path/name.csv

  

Extended Learning

ls Command detailed

Https://www.cnblogs.com/westoslinux/p/6400867.html

The sort command is detailed

Https://www.cnblogs.com/zhangsubai/p/6861697.html

Tail command explanation

Https://www.cnblogs.com/fps2tao/p/7698224.html

A detailed description of the tar command

Https://www.cnblogs.com/xiaochina/p/5801959.html

The grep command is detailed

Http://man.linuxde.net/grep

Linux Learning _ Extract multiple files in chronological order to search for content in a file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.