The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
3answers
131 views

Interactive command usage reference: do you generally have that on Unix?

The question of why some commands rely on manpages whereas others rely on something like the --help flag for providing command usage reference is not new. There is usually a difference in scope ...
8
votes
1answer
136 views

How to append multiple lines to a file with bash, with “--” in front of string

Question very similar to How to append multiple lines to a file with bash but I want to start the file with --, and also append to the file, if possible. printf ...
27
votes
6answers
3k views

Is `-` used only with cd?

cd - can switch between current dir and previous dir. It seems that I have seen - used as arguments to other commands before, though I don't remember if - means the same as with cd. I found that - ...
4
votes
1answer
35 views

Is it possible for bash completion to cycle through the alternatives?

When using bash completion and an a number of characters have been entered, tabbing ceases to work then the prefix you have typed is matched by more than one of the possibilities. Is there a way to ...
1
vote
2answers
24 views

Shell is option given

I have a couple of arguments inside a list (array, e.g. $@) and I'd like to know if the option -v is in the list. In Python I would simply do: verbose = "-v" in sys.argv How do I achieve that in ...
1
vote
1answer
110 views

Debian + Linux kernel 3.12.22: “Kernel module loader” option is not available

The Debian guide for compiling a kernel says: Do not forget to select “Kernel module loader” in “Loadable module support” (it is not selected by default). If not included, your Debian installation ...
1
vote
1answer
17 views

Can't search for flags in qalter's man page?

I was trying to find out what qalter's -r flag does, but I can't search for -r when viewing the man page for it (pattern not found). Yet it's clearly there. If you scroll down a bit you'll see it. Why ...
4
votes
1answer
40 views

POSIX usage standards for requiring at least one optional arg

So, I'm writing a CLI for an API, and I ran into a point where one of the commands support has two optional arguments, id and fields I want to know how to show that these arguments are optional, BUT, ...
0
votes
1answer
25 views

Is there a command which displays options like `errexit` and `braceexpand` other than `help set`?

If you type help set, then - among other things - a list of shell options is displayed. But these options are not the same as those displayed with shopt. And different also from those displayed with ...
2
votes
1answer
18 views

Correct way to document variable length options in man pages

Sometimes I see usage information like some_utility [arg [arg [...]]] or some_utility [arg[, arg[...]]] that indicates that you can pass more than one of the same argument. I've also seen it ...
2
votes
2answers
127 views

Arguments, options and dashes

Why do console applications get the arguments started with either: a) one dash (myapp -arg1 123; ls -al) b) two dashes (myapp --arg1 123; git push origin master --force) c) without dashes at all ...
3
votes
2answers
164 views

Passing arguments to su-provided shell

man su says: You can use the -- argument to separate su options from the arguments supplied to the shell. man bash says: -- A -- signals the end of options and disables further option ...
2
votes
4answers
444 views

Parsing process command-line arguments from pargs in a shell script

I get list of PIDs in my bash scripts (Java processes) and have to analyze their command-line arguments to determine which instance of server each PID corresponds to. At the moment I do it that way ...
1
vote
1answer
129 views

bash control statment for when an option flag is used

I trying to make control statement to check on a option flag is used or not? For -o output.file if is used I would like to make equal to variable OUTPUTSUM = OUTPUTFILE and if there no -o option use ...
2
votes
2answers
121 views

Privileged mode in bash

I've used bash for years but I 've stuck with the"privileged mode" that it can be configure with the set command. For example: set -p I've read the bash man page but it's somewhat obscure. For ...
2
votes
2answers
80 views

Parsing of command line options

For I school project, I have to implement a shell/terminal app. But I am wondering how are command line options parsed, because it appears abit weird to be. For example for the command paste (and I ...
1
vote
1answer
66 views

Is there a simple way to get array of all arguments that do not begin with a hyphen?

zsh includes a powerful utility for parsing command-line options zparseopts, but for quick shell scripts and shell functions, but is there an easy way to extract the array of all command-line ...
3
votes
1answer
36 views

“mke2fs -r fs-revision-level” - how is this used?

mke2fs -r offers Set the filesystem revision for the new filesystem. Note that 1.2 kernels only support revision 0 filesystems. The default is to create revision 1 filesystems. Trying to ...
1
vote
2answers
436 views

fdisk (expert mode) options

On GNU/Linux with fdisk (util-linux 2.20.1), when using, say fdisk /dev/sda3 there are quite some options and the and even an "expert mode" (x). Most of these are explained through the m option. But ...
0
votes
1answer
34 views

w command: same output with(out) -u option?

According to the manpage for w: -u   Ignores the username while figuring out the current process and cpu times. To demonstrate this, do a "su" and do a "w" and a "w -u". I've tried this ...
2
votes
1answer
202 views

Automatically start an application with a modifed LD_PRELOAD?

I have an application that needs a modified LD_PRELOAD. I want to start the application using the originally provided rc script, so I can benefit from an automatically updated rc script on an update ...
5
votes
1answer
56 views

how to input this command line

hume@linux-o1dm:~> gnomesu -u legum java -jar '/home/legum/frem/frem.jar' Unknown option -jar I want -u for gnomesu and -jar for java, but the openSUSE treat -u -jar only for gnomesu. What is ...
2
votes
2answers
278 views

Passing options to subcommands in bash

I'm scripting a sequence of commands I used to enter by hand. The rough outline goes something like this $ echo ${FILENAME_ARGS} | some | big | pipeline | sort -options | etc >temp $ gs ...
2
votes
1answer
103 views

diff --git unknown option

when I try to run diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c I get unknown option (I have installed git via apt-get install git)
3
votes
1answer
85 views

What is “userdel --root?” supposed to do

On a GNU/Linux system, I found the following, (for me very confusing seeming entry) about an option for userdel in the German version of its man page: I'm truly sorry, but I can't really provide ...
0
votes
1answer
71 views

How to make options mandatory in KSH script

Here is the skeleton to catch arguments in my script : # fMain(){ while getopts "d:e:h" _OPTION; do case $_OPTION in d) ...
3
votes
3answers
293 views

What is a “non-option argument”?

I am trying to understand info who but completly fail at the term »non-option argument«. Can someone please explain this term to me in simple words or an example? UPDATE: from ' info who' ...
3
votes
2answers
209 views

cp -L vs. cp -H

Problem When copying files with cp -H or cp -L, I get the same results: $ ls -l fileA fileA -> fileB $ cp fileA somewhere/ -H $ ls -l somewhere/ fileA # fileA is a copy of fileB, only ...
4
votes
3answers
2k views

convert soft- to hardlinks with cp

The cp command's infopage offers on the option --preserve= the following: links Preserve in the destination files any links between corresponding source files. Note that with -L' ...
0
votes
2answers
662 views

The -cp option to the java command [closed]

java -cp FILE.jar FILE.Main inputfile What does the -cp option mean? For that matter, what a negative sign in front mean? I've searched everywhere and couldn't find the answer.
2
votes
3answers
546 views

Restrict standard users to run a command with a specific argument

I know how to restrict standard users to run a command by removing execute permissions for that command. But it's possible restrict standard users to run a command with a specific option/argument? ...
5
votes
3answers
164 views

What's the real point of the -f option on rm?

By reading the GNU coreutils man page for rm, one of the options is -f, which according to the manual, -f, --force ignore nonexistent files and arguments, never prompt Now, I made some ...
0
votes
1answer
263 views

Does SerNet compile Samba 4 with CUPS support? (How to tell in general?)

I have SerNet Samba 4.0.9 installed on CentOS 6.4. How can I tell if it was compiled with CUPS support?
10
votes
1answer
5k views

How can I execute local script on remote machine and include arguments?

I have written a script that runs fine when executed locally: ./sysMole -time Aug 18 18 The arguments "-time", "Aug", "18", and "18" are successfully passed on to the script. Now, this script is ...
3
votes
1answer
171 views

mount --no-canonicalize?

Neither man nor info page provide more information on this than: mount --no-canonicalize Don't canonicalize paths. The mount command canonicalizes all paths (from command line or fstab) ...
1
vote
1answer
126 views

useradd --no-log-init [comprehension question]

TLDR: How is useradd --no-log-init actually used [in GNU/Linux [Debian]? I read the command's man and info page about this option as: »user will not be listed in the lastlog and faillog files ...
2
votes
1answer
211 views

difference between useradd -b and useradd -d

Can somebody please explain to me the exact differences between useradd -b and useradd -d in [Debian] Linux? Both seem to work quite similar to me, but then I spot differences that confuse me.
0
votes
1answer
108 views

wc - setting a terminating character

I've got that far: wc --files0-from=FILE lets one get the word count of a list of files. Each entry in this list mus be terminated with an ASCII NUL character. Question: A way to set a terminating ...
2
votes
2answers
2k views

syntax of ls --hide= and ls --ignore=

ls --hide and ls --ignore provides the possibility leave out files defined through regular expressions set after the --ignore= part. The latter makes sure that this option isn't turned off via -a, -A. ...
0
votes
1answer
317 views

How to autologin with XDM?

How to autologin a specified user with xdm? I know it's possible with other display managers but I wasn't able to figure out how xdm has to be configured to autologin a certain user. Is it possible? ...
29
votes
7answers
3k views

why does ls -d also list files, and where is it documented?

when specifying ls --directory a* it should list only directories starting with a* BUT it lists files AND directories starting with a Questions: where might I find some documentation on this, ...
3
votes
1answer
197 views

Understanding grep --label=

I am looking for an explanation how grep --label=LABEL works: Maybe somebody can give me an example [or two] on what --label= is for. I understand what grep and zgrep are supposed to do – the ...
1
vote
2answers
81 views

mount defaults and various filesystems

I read on the man page defaults Use default options: rw, suid, dev, exec, auto, nouser, async, and relatime. Do the options set depend on a mounted filesystem or not?
1
vote
1answer
349 views

mplayer -msglevel all=-1 doesn't make it completely silent!

I'm trying to open mplayer to play video without any terminal output using this: mplayer -msglevel all=-1 /path/to/video also: mplayer -really-quiet /path/to/video but it doesn't make it ...
2
votes
1answer
243 views

Simpler processing of shell script options

I'm looking for way to process shell script arguments that is cleaner and more "self documenting" than getopt/getopts. It would need to provide... Full support of long options with or without a ...
8
votes
3answers
5k views

getopt, getopts or manual parsing - what to use when I want to support both short and long options?

Currently I'm writing a Bash script which has the following requirements: it should run on a wide variety of Unix/Linux platforms it should support both short and (GNU) long options I know that ...
5
votes
1answer
654 views

In the usage string of my custom shell script, shall I also display --help and --version?

I'm currently developing a shell script, called up, which shows a usage string on the commandline when called with --help. The output looks like this: $ up --help usage: up [-n ...
20
votes
2answers
605 views

What is `--` called?

Recently I got to know of -- that is double-hyphen which is used to tell a command that the option list has ended and what follows should not be considered as a option. So, grep -- 'search_word' * ...
4
votes
2answers
6k views

How can I detect that no options were passed with getopts?

I have this code - #getoptDemo.sh usage() { echo "usage: <command> options:<w|l|h>" } while getopts wlh: option do case $option in (w) name='1';; ...
1
vote
1answer
265 views

What is the canonical way to implement order independent options in bash scripts? [duplicate]

Possible Duplicate: How do I handle switches in a shell script? Most common shell commands allow the user to specify options in any random order. Positional Parameters like $1 as commonly ...