Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6176

Take the "Head" of every file in a directory?

$
0
0

I am working with large files, and my question here is two-fold.

  1. Bash - For testing purposes, I would like to iterate over every file in a given directory, taking the Head of each file (say Head10000), and be left with a cut-down version of each. Either in thesame directory or another it doesn't matter a whole lot, though Isuppose the same would be preferred.

  2. Python3 - How can I do this programmatically? I imagine I need to use the os module?


Viewing all articles
Browse latest Browse all 6176

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>