Home » Softwares » Linux General » GNU Linux Command Line Conventions
GNU Linux Command Line Conventions
1082
Category : Softwares » Linux General
. list contains the entire command line, including the name . GNU/Linux programs obey some conventions about how command-line arguments are interpreted. .
Download File Free PDF eBooks Download Softwares Linux General
Command-Line Arguments Systems Programming Page: 1/2 Compiled & Edited by Muhammad Nadeem Khokhar http://www.brain.com.pk/~mnk/ For Digital Research Labs, Islamabad www.drl.com.pk SZABIST, Islamabad www.szabist-isb.edu.pk GIKI, Topi www.giki.edu.pk You run a program from a shell prompt by typing the name of the program. Optionally, you can supply additional information to the program by typing one or more words after the program name, separated by spaces. These are called command-line arguments. You can also include an argument that contains a space, by enclosing the argument in quotes. More generally, this is referred to as the program’s argument list because it need not originate from a shell command line.
When a program is invoked from the shell, the argument list contains the entire command line, including the name of the program and any command-line arguments that may have been provided. Suppose, for example, that you invoke the ls command in your shell to display the contents of the root directory and corresponding file sizes with the command line ls -s /. The argument list that the ls program receives has three elements. The first one is the name of the program itself, as specified on the command line, namely ls. The second and third elements of the argument list are the two command-line arguments, -s and /. The main function of your program can access the argument list via the argc and argv parameters to main. The first parameter, argc, is an integer that is set to the number of items in the argument list. The second parameter, argv, is an array of character pointers. The size of the array is argc, and the array elements point to the elements of the argument list, as NUL-terminated character strings.
Favorite Linux General PDF File
1141
The Linux Installation HowTo
category Softwares » Linux General
1014
Linux Installation and Getting Started
category Softwares » Linux General
836
Andy Melton XAMPP Server Installation Tutorial
category Softwares » Linux General
1726
Linux HA Release 2 Tutorial
category Softwares » Linux General
998

