Using find command in bash script

Welcome to bash. It’s an old, dark and mysterious thing, capable of great magic. 🙂 The option you’re asking about is for the find command though, not for bash. From your command line, you can man find to see the options. The one you’re looking for is -o for “or”: That said … Don’t do this. Storage like this may work for simple … Read more

sudo: apt-get: command not found

I am really struggling to get my head around terminal i keep getting commands not found what am i doing wrong? I am trying to install ruby on the mac using this tutorial. http://www.ruby-lang.org/en/downloads/ but i keep getting the error sudo: apt-get: command not found Can some please help me or give me an option to … Read more

How to execute a program or call a system command?

Use the subprocess module in the standard library: The advantage of subprocess.run over os.system is that it is more flexible (you can get the stdout, stderr, the “real” status code, better error handling, etc…). Even the documentation for os.system recommends using subprocess instead: The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. See the Replacing Older Functions with … Read more