The command line (also command-line interface, CLI) is a method of interacting with computer programs. They’re often the input/output for programs like the shell (i.e., Bash), or other programs that make use of standard IO.
Programming with the command line
In C, we sometimes see our main
function declaration include two arguments:
argc
is the argument count. The zeroth argument is the name of the file/executable itself, and any subsequent spaces separates the arguments. argv
is an array of length argc
, and it saves the command line arguments that we pass in. This extends the functionality of our programs by quite a bit.
In Python, when we open the interpreter, we can similarly run functions in the command line without needing to create a separate file. This leads to a bit of a different point than C’s command line.