Easy enough with sed
:
sed -n 123,230p filename
This will output filename content, from line 123 to line 230, inclusives. Notice the p
letter after the last line number, this is what instruct sed
to print to stdout.
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
You may want to upload a 100GB file over an unstable network, or feed your scripts smaller inputs to load in RAM. In both cases, just splitting your file into smaller chunks is an easy solution.
Great news is Unix/Linux systems have the split
utility already installed. And using it is simple as pie:
Cut a binary file into chunks of X bytes:
split -b X bigfile.avi
So you hit "Fork" and now you have this repo copy on your Github account. Here is what to do to keep it up-to-date with the original repo.
1. Add the original repo as remote, here called upstream:
git remote add upstream https://github.com/author/repo.git
2. Fetch all the branches of that upstream remote: