Sometimes I want to delete all pip libraries,
pip freeze > u.txt
pip uninstall -r u.txt -y
Since it is troublesome to do, I thought about how to delete the library of one line pip.
pip uninstall -r <(pip freeze) -y
[Concept of process substitution](https://shellscript.sunone.me/input_output.html#%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E7%BD% I referred to AE% E6% 8F% 9B-) (1).
Based on this idea, we were able to shorten the temporary file u.txt
to one line by rewriting it as `<(pip freeze)`
.
It's fun to be able to put simple commands that you use each time on one line, which will improve your work efficiency and give you some tips on how to use the commands.
(1) [UNIX & Linux Command / Shell Script Reference](https://shellscript.sunone.me/input_output.html#%E3%83%97%E3%83%AD%E3%82%BB%E3%82] % B9% E7% BD% AE% E6% 8F% 9B-)
Recommended Posts