Command line arguments and program input are not at all equivalent. They do not travel through the same route and they are interpreted differently.
The command cut
interprets arguments that starts with -
as options and others as input file names (like many other commands).
Arguments are passed to a program through the execve
system call. The environment is passed next to it. The program can read its arguments from a certain location in memory; programming languages usually provide a variable or function to access the arguments, such as the argv
parameter to main
in C.
Standard input is file descriptor 0. This is, by convention, a pre-opened file that programs can read from. When you run a command on a terminal without redirecting its input, the standard input comes from a terminal (it's what you type). When you redirect the input from a file with mycommand <input_file
, the standard input is connected to that file. When you run a command in a pipeline command1 | command2
, the standard input of command2
is connected to the standard input of command2
.