The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
81 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
101 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
19 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
79 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
56 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
34 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
25 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
185 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
32 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
103 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
53 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
118 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 ...
3
votes
1answer
80 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
49 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
183 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
129 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
228 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
163 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
324 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
144 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
221 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?
6
votes
1answer
2k 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
142 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
94 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
180 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
105 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
621 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
268 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? ...
27
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
156 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
70 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
232 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
210 views

Processing shell script options with awk

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 ...
7
votes
3answers
3k 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
579 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
583 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
4k 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
218 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 ...
0
votes
1answer
311 views

How does “options” in shell scripting work?

I found some code in one of the answers here and accommodated it to my needs but now I have two questions: Q1: how can I display the options text after the code in case statement finishes? So the ...
5
votes
1answer
184 views

Handling filenames that contains a hyphen, within a script

I have few files that was incorrectly encoded, during extraction, file names now become something similar to -a -b, Now I'm trying to fix this issue with: convmv -f ENCODING -t utf8 --notest * But ...
3
votes
2answers
449 views

Is it possible to disable verbose in the middle of running?

I am running a program fls (from the Sleuth Kit) with option -v for verbose mode. However it takes too long, and the program is still running since yesterday. I guess it will run faster without ...
4
votes
1answer
1k views

What does Linux's “nointremap” option do?

Ubuntu 12.10 alpha 2 works perfectly on my new 11" 2012 Macbook Air, but only when I boot with the "nointremap" option. Supposedly this is not good to use as a permanent solution. What exactly does ...
1
vote
2answers
512 views

How to change a firefox option on a quick way (via shortcuts, command line,..)?

In Firefox we have two options at Firefox->Preferences->Preferences->Fonts and colors->Colors menu, Use system colors and Sites can use other colors. I would like keep the first one ...
6
votes
3answers
436 views

What's the purpose of `rm -P`?

I was reading the man page for rm when I came across this option: -P Overwrite regular files before deleting them. Files are overwritten three times, first with the byte pattern 0xff, then ...
3
votes
2answers
2k views

Download list of files if they don't already exist

If I have a list of URLs separated by \n, are there any options I can pass to wget to download all the URLs and save them to the current directory, but only if the files don't already exist?
2
votes
2answers
579 views

List of available command options?

I'm currently setting up my first web server without a control panel and so far things are going pretty good! I was just wondering if anyone could direct me to somewhere that explains all of the ...
4
votes
3answers
1k views

Remove many many many files from a folder

I have a folder with 137795 files in it. I need to delete all of them. When I run rm * I get -bash: /bin/rm: Argument list too long. How do I get past this error?
4
votes
1answer
121 views

If I'm logged in as root, how do I restart mysql or apache with options?

I know the commands to restart/stop/start, but when I try to pass options it doesn't seem to work! CENTOS 6, MySQL 5.14 service mysql restart service httpd restart Then I tried this: ...
3
votes
2answers
457 views

Getopts option processing, Is it possible to add a non hyphenated [FILE]?

I'm using getopts for all of my scripts that require advanced option parsing, and It's worked great with dash. I'm familiar with the standard basic getopts usage, consisting of [-x] and [-x OPTION]. ...
2
votes
1answer
544 views

How to find every symbolic link on a server?

I need to find every symbolic link on the server. The version is AIX 6.1. man find says -L Follow symbolic links But find -L is not a proper usage. Usage: find [-H | -L] Path-list ...