Linux- How to check contents of .gz file


To check the contents of a .gz file in Linux, you can use the zcat command. Here is how you can do it:

zcat employee_data.csv.gz

This command will display the contents of the employee_data.csv.gz file. If you want to see only the first few lines, you can pipe the output to the head command:

zcat employee_data.csv.gz | head

This will display the first 10 lines of the file. You can adjust the number of lines displayed by using the -n option with head:

zcat employee_data.csv.gz | head -n 20

This will display the first 20 lines of the file.

References

  1. zcat Command

Similar Posts

    Sorry, no similar posts were found.

    About the Author

    Atul Rai
    I love sharing my experiments and ideas with everyone by writing articles on the latest technological trends. Read all published posts by Atul Rai.