A value passed to a program. Abbreviated to args, but usually only in the plural. It's fairly common to specifically say "command line arguments". Arguments read from a file are often referred to as "parameters" rather than arguments. Flags (also "switches") are a type of argument, almost always prefaced by some character that tells you that: typically a "-" in Unix and Linux, and a "/" (the "switch character") in the Windows world. So, in
sort -u /tmp/file
most geekish types would say that "-u" (sort uniquely) is a flag, and /tmp/file is an argument. But remember that a flag is a type of argument; "/tmp/file" would never be a flag, but "-u" will be called an argument in some contexts.
A very few Unix programs process flags with or without the lead-in character: both "tar tvf /dev/rct0" and "tar -tvf /dev/rct0" are acceptable.
Most Unix programs will accept file arguments or read from standard input: you can "cat file | sort" or "sort file" with equal results.
Unix shells are responsible for expanding wild-cards and passing the result to the program that will use them. So when you say
cp x* /tmp
"cp" sees all the "x" files; it does not see "x*".
Sometimes you don't want the shell expansion of wildcards. Using "find -name x*" will fail if there are any files named "x*" in the current directory. You need to "find -name 'x*'" so that find gets the actual wildcard to work with.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-04-28 Tony Lawrence
There are only two hard problems in computer science: cache invalidation and naming things. (Phil Karlton)
Printer Friendly Version
args Copyright © September 2003 Tony Lawrence
Have you tried Searching this site?
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.
Contact us
Printer Friendly Version