Ten real-world exercises using ls, cat, grep, find, and awk, driven from Python with subprocess. Difficulty goes from easy to medium.
Rules for every exercise
- Use the list form (
["grep", "-c", "ERROR", path]), nevershell=True. - Use
text=Trueandcapture_output=Trueunless the exercise says otherwise. - First try the command in the terminal, then write the Python version.