<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.linuxquestions.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=1143105428</id>
	<title>LQWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.linuxquestions.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=1143105428"/>
	<link rel="alternate" type="text/html" href="https://wiki.linuxquestions.org/wiki/Special:Contributions/1143105428"/>
	<updated>2026-04-13T07:57:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.0</generator>
	<entry>
		<id>https://wiki.linuxquestions.org/index.php?title=Command_options&amp;diff=21012</id>
		<title>Command options</title>
		<link rel="alternate" type="text/html" href="https://wiki.linuxquestions.org/index.php?title=Command_options&amp;diff=21012"/>
		<updated>2006-03-23T09:15:57Z</updated>

		<summary type="html">&lt;p&gt;1143105428: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Command-line options ('''Command options''' or flags) are parameters given to a [[command line]] program to alter the way it runs.  One of the most familiar examples of their usage is &amp;lt;tt&amp;gt;ls -l&amp;lt;/tt&amp;gt;, where ''-l'' is a flag telling &amp;lt;tt&amp;gt;ls&amp;lt;/tt&amp;gt; to use the command's &amp;quot;long&amp;quot; format.&lt;br /&gt;
&lt;br /&gt;
==Types of Options==&lt;br /&gt;
&lt;br /&gt;
* The simplest options are single-letter flags like the &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; above.  They can be combined into a single word, like &amp;lt;tt&amp;gt;ls -la&amp;lt;/tt&amp;gt; to use the '''l'''ong format and list '''a'''ll files.&lt;br /&gt;
&lt;br /&gt;
* Some command options take arguments.  Then the program knows not only that the option was given, but also gets some additional information.  An example is &amp;lt;tt&amp;gt;ssh -l myname myhost.myisp.com&amp;lt;/tt&amp;gt;, where the &amp;lt;tt&amp;gt;-l&amp;lt;/tt&amp;gt; option is given the parameter &amp;lt;tt&amp;gt;myname&amp;lt;/tt&amp;gt; to tell [[ssh]] what username to use when connecting.  These options can be combined with the first type, though they must be the last option in the word, like &amp;lt;tt&amp;gt;ssh -Xl myname myhost.myisp.com&amp;lt;/tt&amp;gt;, where the &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; tells ssh to try to forward X connections, and the &amp;lt;tt&amp;gt;l&amp;lt;/tt&amp;gt; is the same as before.&lt;br /&gt;
&lt;br /&gt;
* long options of the X type use a single &amp;lt;tt&amp;gt;-&amp;lt;/tt&amp;gt; and consist of more than one letter.  They can take arguments or not.  For example, &amp;lt;tt&amp;gt;emacs -geometry +0-0&amp;lt;/tt&amp;gt; uses the &amp;lt;tt&amp;gt;geometry&amp;lt;/tt&amp;gt; option to tell [[emacs]] to place itself in the corner of the screen.&lt;br /&gt;
&lt;br /&gt;
* long options of the GNU type use the double &amp;lt;tt&amp;gt;--&amp;lt;/tt&amp;gt;.  &amp;lt;tt&amp;gt;ls --all&amp;lt;/tt&amp;gt; is the same as &amp;lt;tt&amp;gt;ls -a&amp;lt;/tt&amp;gt;.  Long and single-letter arguments can be mixed on the same commandline, but not in the same word.  Long options of this type that take arguments sometimes use an equals sign instead of a space to separate the option name from its argument.&lt;br /&gt;
&lt;br /&gt;
* When running a program on a data file that may be mistaken for an option, the -- option can be helpful. This option shows that the option listing is over, and the next input will be a datafile. (Example: rm -- -f would delete the file &amp;quot;-f&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==How to write programs that take options==&lt;br /&gt;
&lt;br /&gt;
* [[C]] programs can use the &amp;lt;tt&amp;gt;getopt()&amp;lt;/tt&amp;gt; function to interpret single-letter command options.  &amp;lt;tt&amp;gt;getopt_long()&amp;lt;/tt&amp;gt; finds long options with '&amp;lt;tt&amp;gt;--&amp;lt;/tt&amp;gt;' before them, while &amp;lt;tt&amp;gt;getopt_long_only()&amp;lt;/tt&amp;gt; can find long options with either '&amp;lt;tt&amp;gt;--&amp;lt;/tt&amp;gt;' or '&amp;lt;tt&amp;gt;-&amp;lt;/tt&amp;gt;'.  All of these are described in the getopt() [[man]] page, or read the [[info]] page wich has other alternatives as well as getopt(), read &amp;lt;tt&amp;gt;info libc&amp;lt;/tt&amp;gt; (see External links below).&lt;br /&gt;
* [[Shell scripts]] can use the &amp;lt;tt&amp;gt;getopt&amp;lt;/tt&amp;gt; program.&lt;br /&gt;
* [[bash]] scripts can use the &amp;lt;tt&amp;gt;getopts&amp;lt;/tt&amp;gt; [[builtin]] command.&lt;br /&gt;
* [[Perl]] scripts can use the Getopt::Std or Getopt::Long module.&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
&lt;br /&gt;
* [http://man.linuxquestions.org/index.php?query=getopt&amp;amp;section=1&amp;amp;type=2 getopt man page] - for shell scripts (including bash)&lt;br /&gt;
* [http://man.linuxquestions.org/index.php?query=getopt&amp;amp;section=3&amp;amp;type=2 getopt() man page] - for C programs&lt;br /&gt;
* [http://man.linuxquestions.org/index.php?query=bash&amp;amp;section=0&amp;amp;type=2 bash man page] - for bash scripts&lt;br /&gt;
* [http://man.linuxquestions.org/index.php?query=Getopt%3A%3ALong&amp;amp;section=0&amp;amp;type=2 Getopt::Long] and [http://man.linuxquestions.org/index.php?query=Getopt%3A%3AStd&amp;amp;section=0&amp;amp;type=2 Getopt::Std] - for perl&lt;br /&gt;
&lt;br /&gt;
:''This section is a [[LQWiki:stub articles|stub]] and needs to be finished. [[LQWiki:plunging forward|plunge forward]] and [[LQWiki:How to edit a page|help it grow]]!''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
[l_sp]&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://test.com&amp;quot;&amp;gt; test&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>1143105428</name></author>
	</entry>
	<entry>
		<id>https://wiki.linuxquestions.org/index.php?title=Xinit&amp;diff=21011</id>
		<title>Xinit</title>
		<link rel="alternate" type="text/html" href="https://wiki.linuxquestions.org/index.php?title=Xinit&amp;diff=21011"/>
		<updated>2006-03-23T09:15:48Z</updated>

		<summary type="html">&lt;p&gt;1143105428: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The xinit program is used to start the X Window System server and a first client program on systems that cannot start X directly from /etc/init or in environments that use multiple window systems. When this first client exits, xinit will kill the X server and then terminate.&lt;br /&gt;
&lt;br /&gt;
If no specific client program is given on the command line, xinit will look for a file in the user's home directory called .xinitrc to run as a shell script to start up client programs. If no such file exists, xinit will use the following as a default:&lt;br /&gt;
&lt;br /&gt;
        xterm -geometry +1+1 -n login -display :0&lt;br /&gt;
&lt;br /&gt;
If no specific server program is given on the command line, xinit will look for a file in the user's home directory called .xserverrc to run as a shell script to start up the server. If no such file exists, xinit will use the following as a default:&lt;br /&gt;
&lt;br /&gt;
        X :0&lt;br /&gt;
&lt;br /&gt;
Note that this assumes that there is a program named X in the current search path. However, servers are usually named Xdisplaytype where displaytype is the type of graphics display which is driven by this server. The site administrator should, therefore, make a link to the appropriate type of server on the machine, or create a shell script that runs xinit with the appropriate server.&lt;br /&gt;
&lt;br /&gt;
Note, when using a .xserverrc script be sure to ``exec'' the real X server. Failing to do this can make the X server slow to start and exit. For example:&lt;br /&gt;
&lt;br /&gt;
        exec Xdisplaytype&lt;br /&gt;
&lt;br /&gt;
An important point is that programs which are run by .xinitrc should be run in the background if they do not exit right away, so that they don't prevent other programs from starting up. However, the last long-lived program started (usually a window manager or terminal emulator) should be left in the foreground so that the script won't exit (which indicates that the user is done and that xinit should exit).&lt;br /&gt;
&lt;br /&gt;
An alternate client and/or server may be specified on the command line. The desired client program and its arguments should be given as the first command line arguments to xinit. To specify a particular server command line, append a double dash (--) to the xinit command line (after any client and arguments) followed by the desired server command.&lt;br /&gt;
&lt;br /&gt;
Both the client program name and the server program name must begin with a slash (/) or a period (.). Otherwise, they are treated as an arguments to be appended to their respective startup lines. This makes it possible to add arguments (for example, foreground and background colors) without having to retype the whole command line.&lt;br /&gt;
&lt;br /&gt;
If an explicit server name is not given and the first argument following the double dash (--) is a colon followed by a digit, xinit will use that number as the display number instead of zero. All remaining arguments are appended to the server command line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
[l_sp]&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://test.com&amp;quot;&amp;gt; test&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>1143105428</name></author>
	</entry>
	<entry>
		<id>https://wiki.linuxquestions.org/index.php?title=Apt-file&amp;diff=21010</id>
		<title>Apt-file</title>
		<link rel="alternate" type="text/html" href="https://wiki.linuxquestions.org/index.php?title=Apt-file&amp;diff=21010"/>
		<updated>2006-03-23T09:15:40Z</updated>

		<summary type="html">&lt;p&gt;1143105428: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''apt-file''' is an application to search for files in the [[Debian]] repository. Its use is similar to [[apt-get]], for example:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the package contents:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;apt-file update&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search some some file:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;apt-file search /path/to/some.file&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the package content files:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;apt-file purge&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
[l_sp]&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://test.com&amp;quot;&amp;gt; test&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>1143105428</name></author>
	</entry>
</feed>