Python Equivalent of Shell Commands
| Shell Command | Alternative | Python |
|---|---|---|
| which git | shutil.which("git") | shutil |
| mkdir -p /path/to/file | Path("path/to/some/file").mkdir(exist_ok=True) | pathlib |
| os.makedirs("/path/to/file", exist_ok=True) | os | |
| !mkdir -p /path/to/file | IPython | |
| mkdir -p /path/to/file | xonsh | |
| cp … |