Questions tagged [options]

Passing options like -l or --word to commands, or parsing them in scripts.

Filter by
Sorted by
Tagged with
0
votes
1answer
33 views

What does “-plow” option do in dpkg-reconfigure

I stumbled upon the following answer on Unix stackexchange, where the -plow option is used with dpkg-reconfigure, but I can't find anything about it in the dpkg or dpkg-reconfigure manpages: http://...
0
votes
2answers
80 views

What do letters for symlink options (-P -L -H) stand for?

I've summarized a list of commands that accepts symbolic link options according to SUSv4-2018ed: cd chgrp chown chmod cp find ln ls pax rm The full list also includes their defaults and other ...
0
votes
1answer
43 views

What does the parenthesis around a use flag means?

I want to build my curl with the quiche support. I have enabled the use flag in the package.use file, but it does not take effect. I noticed there are a pair of parenthesis around the use flag. What ...
0
votes
0answers
64 views

The printers and settings in `.cups/lpoptions` are not read by `lpstat -a`

I set my printers/setting in ~/.cups/lpoptions as follows, and it was working well and I could select among different printers: Default RICOH fit-to-page=true Resolution=1200 sides=two-sided-long-...
0
votes
0answers
13 views

Select an action with a key

I would like to have something like a dmenu. But I don't want to type and then press return to select an action but just select the action with a single key press. It should be a simple application ...
0
votes
1answer
44 views

What happened to the “-4” option for command line FTP?

It used to be that you could force command line FTP to use IPv4 like so: ftp -4 ftp.example.com However, at some point in the relatively recent past the "-4" (and for that matter, the "-6") option ...
0
votes
0answers
67 views

How ls -lh round off the actual sizes in human readable form?

I was using the command ls -lh to see the long list of files and their sizes in human readable form but i was unable to understand one thing that how the human readable form round off the actual sizes....
1
vote
1answer
115 views

What does “ln -t” do [duplicate]

What does ln -T do? I know the flag does not exist in the BSD version of ln, and it only exists in the GNU version, and I have read the documentation that it will make ln "treat LINK_NAME as a normal ...
0
votes
0answers
21 views

rsync only folders that exist in target

Trying to use rsync to move some directories around, and I'm a bit stumped. Using the --existing argument copies the files only if they exist in the target directory, but that's not quite what I'm ...
-1
votes
2answers
80 views

-y in Linux for example dnf -y install samba [duplicate]

what does the -y mean in linux. this symbol is always used after a command for example dnf -y install httpd. Everywhere I have looked I cannot find a definite answer. Please help
2
votes
2answers
88 views

Does the order of command line options matter in Perl?

The following command works as expected: perl -lne 'print $1 if /install\(TARGETS (.*) RUNTIME DESTINATION bin\)/' CMakeLists.txt This one works as well: perl -nle 'print $1 if /install\(TARGETS (.*...
-1
votes
1answer
89 views

apt-get man page weird flag

I just looked up the man page of apt-get via man apt-get and it shows me a weird flag in the synopsis section. It's the first one. Each x is a capitalized/uncapitalized character. SYNOPSIS apt-...
0
votes
2answers
145 views

Understand -exec command? [duplicate]

This works find ./ -iname '*.c' -o -name '*.h' -o -name '*.l' -exec grep -irn test1 {} \; If I combine -exec with ls then it tells me that is improper option. #ls -exec touch {} \; ls: invalid ...
-2
votes
1answer
72 views

Difference between GNU tar's --transform and --xform options

What is the main difference between GNU tar --transform to --xform? From reading the GNU tar manual, I assume they might be the same and the latter is a "sugar syntax".
0
votes
1answer
38 views

aliasing command options

Is there any way to alias the options of a command? For instance, I often use the options -mindepth and -maxdepth with find, but these are quite long at 9 characters apiece, and don't have ...
1
vote
1answer
109 views

What is the use of n option in cut command?

I'm learning about the cut command. In the man page of cut, they show the -n option like: -n (ignored) But I didn't understand the usage of the n option or when we would use it. Can anyone ...
0
votes
2answers
46 views

correct order while combining different options of a command

I usually combine options together whenever there are more than one option to be used with respect to some command. For example , if i want to create an archive using tar i will write tar -cvf archive....
4
votes
1answer
185 views

Why xargs uses -t to enable verbose mode?

Most programs use -v to enable verbose mode. Why does the GNU xargs use -t to enable verbosity?
2
votes
2answers
305 views

What is the rationale for using -f in tar [duplicate]

From man tar: -f, --file ARCHIVE use archive file or device ARCHIVE Please consider: tar -zxvf myFile.tar.gz As far as I understand, z means "gzipped tarball", x means "extract", v means "...
2
votes
1answer
59 views

What does “mount -e <device>” do?

TL;DR: What does mount -e <device> do? Overview Over ssh, mount commands are being sent by software that I need to maintain. Twice, the mount commands use an -e option. I don't know what -e is ...
0
votes
2answers
2k views

What does grep -w do?

In here grep is used with the option -w. I did man grep and grep --help to try to find what the aforementioned option does. Neither output says anything about a -w option. What does that option do? ...
1
vote
2answers
31 views

Discard “access denied” stderr natively in find

Is there an option in find that allows me to suppress the error messages that I get from it trying to access directories for which I don't have access? I know I can just discard stderr, but it seems ...
2
votes
3answers
119 views

On a Mac, how can I list contents of a non-current directory without showing backup files (ending with ~), preferably with BSD command ls?

My system: OS: MacOS / Mac OS X (Mojave 10.14.5) OS core: Darwin (18.6.0) Kernel: Darwin Kernel / XNU (18.6.0 / xnu-4903.261.4~2/RELEASE_X86_64) ls: version unknown, but man ls gives a page from the ...
0
votes
1answer
211 views

find command - how to ignore case in -path option?

when searching filename or dirname case-insensetively, we can use option -iname. but if I want to ignore case in -path option, what should I do? can I do it with only find command, without using ...
-1
votes
1answer
94 views

How can fragment packets -f/--mtu be usefull?

How can fragment packets -f/--mtu be usefull ? That is, say from a normal scan I get for a given IP and port range: 28/tcp filtered unknown no-response 29/tcp filtered msg-icp no-response 30/tcp ...
0
votes
1answer
234 views

How do I pass long-style command line options to a bash script using getopt?

I have this script that I have cobbled together from bits of lore I've gleaned from googling: #!/usr/bin/env bash usage() { declare -r script_name=$(basename "$0") echo """ Usage: "${...
2
votes
1answer
52 views

su: What does the hyphen with nothing immediately following it mean?

Written as if it were an option, e.g: > su - someuser Don’t the space breaks apart “-“ and “someuser”? I went through the manpage but didn’t notice an entry for it.
1
vote
1answer
501 views

How do I customize Nautilus / Caja file manager?

I'm using Caja and I miss several features that I had with Windows Explorer. I'm willing to tweak some configs or even develop code to get them but I wouldn't know where to start to collaborate... ...
3
votes
1answer
228 views

Why should I escape the semicolon with find?

I'm using bash on Debian. I have to write find -iname "*mp3" -exec cp {} /media/MP3Player/ \; escaping the final semicolon, or else I get an error.
5
votes
3answers
592 views

Portable way to invoke tar with a list of files from stdin

I want to create a .tgz from the content of a directory. I also want to strip the leading "./" from the tar'ed content. I had done this as follows: cd /path/to/files/ && find . -type f | cut -...
3
votes
0answers
364 views

How to pass options to ssh proxy command?

To collect some data from a bunch of hosts I use a bash script which calls scp in a loop. Most of these hosts are configured for ssh public key authentication. I may skip those which have no key ...
-1
votes
1answer
30 views

Why does adding -prune to my sync script cause rsync to do a DRY-RUN?

I'm testing a script to do a by-directional sync of two directories intelligently using rsync. Since I'm testing many of the rsync options are not applicable to the testing environment including the ...
2
votes
3answers
434 views

'rename' with expression|replacement with a leading '-' (hyphen|minus)

I have many files like xyz_123_foo.ext for which I would like to add -bar to the filenames at the end to result in xyz_123_foo-bar.ext. I tried: rename . -bar. xyz_* which resulted in: rename: ...
4
votes
1answer
1k views

How to distinguish between a positional parameter and an option?

Both a positional parameter ($1, $2, and so forth) and an option (and/or argument) are written directly after a command, so what is the definition or phrasing to explain how to distinct them? In ...
2
votes
1answer
978 views

Can no_console_suspend be set in runtime?

Is it possible to change this value in runtime without rebooting? I don't always have this problem, when I suspend right now I'm getting a failure and Suspending console(s) (use no_console_suspend ...
0
votes
2answers
80 views

Are `-name` and `-exec` options or non-option arguments of `find`?

Are -name and -exec options or non-option arguments of find? They look like short options, and they are called find expressions, if I am not mistaken. For example, find . -name "*.txt" -exec echo {} ...
3
votes
2answers
2k views

How to make httpd response 200 for options request?

I want to make some configuration on my centos+apache,let httpd server send 200 response when client make a options request. There is a very old post here(2011). Returning “200 OK” in Apache on ...
20
votes
1answer
2k views

Why does -a in “#!/bin/sh -a” affect sed and “set -a” doesn't?

If I run the following .sh file: #!/bin/sh -a echo "a" | sed -e 's/[\d001-\d008]//g' The result is an error: sed: -e expression #1, char 18: Invalid range end But if I run the following .sh file:...
0
votes
2answers
50 views

Display options for command at the prompt

Is there a way to script any Linux commands to prompt the user for input? For example: chage has many options Options: -d, --lastday LAST_DAY set date of last password change to LAST_DAY ...
-5
votes
2answers
310 views

Signal the end of option arguments: double dashes `--` vs single dash `-`? [duplicate]

I notice in https://unix.stackexchange.com/a/459007/674, that single dash - is used to signal the end of option arguments. Is it correct that double dashes -- can also signal the end of option ...
0
votes
1answer
108 views

Create custom parameters (options) for already existing commands?

Recently I 've been wanting to create a custom parameter for pacman. To elaborate, I have tweaked pacman.conf so that specific packages (linux, linux-firmware, and a couple more) are ignored when I ...
1
vote
0answers
88 views

Bash how does skip-completed-text work?

I use menu-complete bash function to cycle through completion when I press Tab, and I'm happy with it. But it has too often happened to me the following. Suppose I'm looking for the file ...
0
votes
1answer
907 views

What is — and -td options on ls command?

Could you please explain what each option on this ls command does: ls -td -- */? The result of such command would look like below: $ ls $ ls -al total 4 drwxr-xr-x 5 root root 68 Jun 4 09:58 . ...
1
vote
1answer
7k views

how to properly parse shell script flags and arguments using getopts

I'm using this : for example ./imgSorter.sh -d directory -f format the scripts' content is : #!/bin/bash while getopts ":d:f:" opt; do case $opt in d) echo "-d was triggered with $...
0
votes
1answer
78 views

passing options from an array to built in ls command in UNIX [closed]

I am writing a shell script that takes several args like -l -s -a -f thing ming and append only those starting with -. This is my code: arrayOfArgs=() for arg in "$@": do case arg in -*) ...
-1
votes
1answer
325 views

How shall we understand “if no arguments remain after option processing”?

Basy manual says that for the command bash: -s If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option ...
1
vote
2answers
50 views

The alternative to Option '--update' in BSD command 'mv'

I am reading a book "Linux Command Line", there's -u update option for command mv and `cp' -u, --update When moving files from one directory to another, only move files that either don't exist, ...
0
votes
1answer
29 views

How to search based on a $OPTARG that I provided in a file?

I am trying to make an executable file for search a specific text. I want to retrieve any line in my data file that include the value that I pass it. So I create a data file called .addr_book and I ...
0
votes
3answers
473 views

parsing a command option in a bash script

I wrote I ‘quick’ script, and then thought of adding a “—nomail” option that would shut off my mail switch (of which the syntax is piped in from echo). I thought this would be easy but I think, ...
1
vote
1answer
1k views

Parameters of find command

What difference does it make when using the -print and -depth parameters in find command, given that they produce the same outcome: /home/pkaramol/Desktop/testdir $ find . . ./testfile3.txt ./...

1 2 3 4 5