Skip to main content

Questions tagged [command-line-arguments]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
259 votes
12 answers
392k views

How do I start Chrome using a specified "user profile"?

I use the new built-in "Users" feature of Chrome to switch between Home/Work accounts easily. However, Chrome remembers the "last" user profile you had selected when launching new windows. This is a ...
Danny Tuppeny's user avatar
140 votes
8 answers
234k views

How do I find out command line arguments of a running program?

I'm looking for a tool or method to find out what command line parameters have been passed to a program, for example when it was run by another program (launcher-application scenario).
Gepard's user avatar
  • 1,807
127 votes
4 answers
437k views

How to add command line options to shortcut?

How can I add command line options to an executable in a shortcut in Windows XP? For example in the shortcut properties in target I have: "c:\path\to\exe\pogram.exe" I want to add some options: "c:...
Karl Voigtland's user avatar
89 votes
5 answers
18k views

Why does "cd.." work in the Windows command line?

When typing cd.. without a space between cd and .. the Windows command prompt will happily switch to the parent folder. Is there an explanation for this behaviour? The command does not follow the ...
Jonas Köritz's user avatar
82 votes
2 answers
80k views

How do I pass command line arguments to Dock items?

I'm attempting to follow the instructions for pinning startup tabs in Chrome. On OS X how do I add command line arguments to items that persist in my dock?
sudoer's user avatar
  • 921
46 votes
2 answers
432k views

How to start a program with command line arguments on Windows' cmd with 'start' command?

I need to start a program (virtual machine) in the background with a start command on Windows' 7 command line. Normally you would do this like that: start /b cmd yourprogram But I need to pass some ...
Patryk's user avatar
  • 1,259
37 votes
3 answers
14k views

Why are there short and long alternatives for command line options?

Most unixoid commands feature short and long alternatives for command line options, like ls -a and ls --all, or ls -A and ls --almost-all. Why do those two ways exist? One is shorter to type, the ...
ygoe's user avatar
  • 2,328
36 votes
1 answer
11k views

Bash: optionally passing arguments to a command

I'm trying to add arguments to a command call depend on another variable. Please look at the shell scripting code: curl \ $([ -z "${title}" ] || echo --data-urlencode title=${title}) \ http://...
shouya's user avatar
  • 2,657
35 votes
2 answers
7k views

How can I get a specific argument from a previous command in bash?

In bash, you can use !* to get all the arguments from the previous command. As an example, if you did cp /some/path /some/other/path and then did mv !*, the second command would be expanded to mv /...
Wuffers's user avatar
  • 19.3k
32 votes
12 answers
101k views

Nslookup command line with A record IP as sole output

I've found the following command to get your current public IP that works well from command line: nslookup myip.opendns.com resolver1.opendns.com I want to be able to run a command though that JUST ...
BondUniverse's user avatar
32 votes
5 answers
61k views

Passing two arguments to a command using pipes

Usually, we only need to pass one argument: echo abc | cat echo abc | cat some_file - echo abc | cat - some_file Is there a way to pass two arguments? Something like {echo abc , echo xyz} | cat cat ...
goweon's user avatar
  • 1,753
29 votes
4 answers
3k views

How to create a file which is named like a command line argument?

I was wondering how to make a file named as a flag, e.g., if I wanted to make a folder named -a, what commands would do the trick? I tried mkdir '-a', mkdir \-a, and neither worked. I'm on Ubuntu.
MYV's user avatar
  • 1,203
22 votes
3 answers
117k views

What is the significance of the /admin switch in mstsc.exe?

What benefits/risks does the /admin switch for mstsc.exe confer? How is this different from logging in with an Administrator account, without the switch?
Iszi's user avatar
  • 13.9k
22 votes
8 answers
28k views

How can I use two parameters at once with xargs?

I need to convert videos, but I don't know where are they, so I need to find them. How can I give the result and an output file name to FFmpeg with xargs? I already found out that I can construct the ...
kissgyorgy's user avatar
21 votes
3 answers
158k views

How can I write space in Terminal on OS X?

I have a folder name with a space between words. I tried to use cd to move into that folder but it didn't work. How can I write space in Terminal on OS X? I tried following MacBook-Pro:TestDrop ...
Alexander Khitev's user avatar
21 votes
2 answers
24k views

FFMPEG cut for time range

I am using the below command for having 15sec - 45 sec range of music but sample.m4a file is starting from 15 sec to 60 sec. Am I using the wrong syntax or why it is so? ffmpeg -ss 00:00:15 -t 00:00:...
Freshblood's user avatar
21 votes
5 answers
31k views

Linux "top -c" to show full command

What parameter can help me to display the full command using top -c? For example, I have one of the oupput from top -c 5073 mysql 20 0 298m 12m 4668 S 0 0.0 29:27.46 /usr/sbin/mysqld -...
user200340's user avatar
20 votes
2 answers
14k views

What does "robocopy /NOOFFLOAD" do?

The windows tool robocopy has a command line switch /NOOFFLOAD. What does this switch actually do, and under what circumstances would I use it? The documentation for the switch says /NOOFFLOAD :: copy ...
HugoRune's user avatar
  • 748
18 votes
1 answer
4k views

How to set a flag as default on an *.EXE file?

When I open Sumatra I need inverted colors by default. But even though I changed the shortcuts to: "/sumatraPDF.exe" -invert-colors the program runs without the flag when I double click a PDF file at ...
Coolwater's user avatar
  • 354
17 votes
2 answers
22k views

Is there a difference between a command line flag and a command line option?

I am hearing these two terms interchangeably and I am wondering if there is any difference between them, like flags are for one letter options or flags are after a single dash.
yoyo_fun's user avatar
  • 1,863
16 votes
3 answers
42k views

taskmgr.exe called with an argument by Windows 7

I noticed when I press Ctrl+Alt+Del and click Task Manager, Windows calls taskmgr.exe /3 as the command. Several websites claim the Task Manager has no command line arguments. Why does Windows attach ...
Martin Braun's user avatar
15 votes
2 answers
7k views

Is there a 'Restore session' command-line argument for Firefox?

I would like to make a batch script for Firefox that restores my last session upon launching the script. I found that I could do this rather easily in Chrome with the --restore-last-session argument. ...
Mr. Mendelli's user avatar
  • 1,269
14 votes
1 answer
7k views

How to Retrieve Command Line Arguments

How can I view what command line arguments are passed to a running process on Mac OS X?
bot47's user avatar
  • 1,862
13 votes
2 answers
109k views

List files with path using Windows command line

My folder structure in a drive is like this (in Windows): Folder 1 Fd1 Fd2 Fd3 Fd4 Fd5 Folder 2 Fd1 Fd2 Fd3 Fd4 Fd5 This arrangement continues for 100s of folders. Inside Fd1 of each ...
Chethan S.'s user avatar
  • 1,057
11 votes
4 answers
6k views

Multiple directories: Powershell equivalent of "mkdir dir{1..9}"?

What is the syntax to create multiple directories with PowerShells md (or mkdir, New-Item...) equivalent to the 'nix command mkdir ch{1..9} i.e. ~/parent_dir/ ch1/ ch2/ ch3/ ch4/ ch5/ ch6/...
MmmHmm's user avatar
  • 758
11 votes
4 answers
4k views

Unix tools: what if a file is named minus something?

I'm always wondering: most GNU/Unix tools take options in the form "minus something", sometimes followed by an argument. What if you got a file named minus something? $ ls -f $ rm -f $ ls -f $ mv -f ...
user avatar
11 votes
3 answers
19k views

How to pass a filename by drag-and-drop to a shortcut in Windows

I have a program program.exe and a document document.txt, and to open the document, I can drag document.txt onto program.exe. So far so good. Now I want to call it with a command-line parameter -param ...
Kendall Frey's user avatar
10 votes
2 answers
10k views

Passing command-line arguments to a windows batch script

I need to create a windows batch script where I need to pass a few command-line arguments. These arguments may appear in in any order, but the script should pick them up properly based on the argument ...
Dhiwakar Ravikumar's user avatar
10 votes
4 answers
18k views

(How) can I change the time until the screensaver kicks in from the command line?

As the title asks (Windows 7). (How) can I change the time until the screensaver kicks in from the command line? Is it even possible? Normally I am happy with a 5 minute setting, but occasionally I ...
Mawg's user avatar
  • 4,465
10 votes
1 answer
7k views

How do you open mailx to read old mail when you have no new mail and view a list of old emails?

If you type mailx at the command line when you have new mail, it nicely shows you headers of your new mail and leaves you at a ? prompt where you can do mail commands. But if you don't have new mail ...
mring's user avatar
  • 1,057
9 votes
2 answers
30k views

What is the equivalent to --help or man page in Windows?

If I want to know what my options are for a Linux program then I'll do man program or program --help to find out. How do you do that on Windows? I was reading about how to run a screensaver from the ...
beardedlinuxgeek's user avatar
9 votes
1 answer
11k views

Is it possible to run multiple instances of OBS on Mac OS X?

I've read that using the -multi command will allow you to open multiple instances of OBS (Open Broadcaster Software) simultaneously. I tried adding the parameter via the command line, but it only ...
SavoryBytes's user avatar
9 votes
3 answers
61k views

Command line argument for running as another user on Windows?

Under windows .msi installer, if you specify a custom action to be run at an application's installation time, it will get run under the "SYSTEM" user. Can I trick it by passing a command line ...
kellogs's user avatar
  • 387
9 votes
1 answer
8k views

use FFMpeg to send BMPs to stdout

I see lots of examples using FFMpeg to make a video file from a set of images. I can also see how to do the opposite if I want individual files. However, I want the images to be pushed to stdout. This ...
Brannon's user avatar
  • 468
8 votes
2 answers
11k views

How do I set the group and affinity of a Windows executable from the command line

I have an executable foo.exe that I need to run concurrently 6 times on a multiprocessor setup where the first 3 instances will be assigned to cores in Group 0 and the next 3 instances will be ...
Zareh's user avatar
  • 183
8 votes
4 answers
29k views

Understanding executing PowerShell inside batch with parameters

I've been digging in this for a while, but I could not understand how this works. What I need is: Be able to run a batch file The batch file should have parameters The parameters should be passed ...
The Quantum Physicist's user avatar
8 votes
2 answers
8k views

Recursive folder rename through command line

I have 500000 plus files in over 3000 directories and need to rename all folders called PHOTOS to Photos. I also need to Rename any Folders call Photos blah blah blah to be called just Photos. It ...
Jinx's user avatar
  • 81
8 votes
1 answer
3k views

Chrome: How to refresh tab if open, otherwise open new tab?

I'm opening a .pdf file from the command line in Chrome (Windows 7 64 bit). Every time the pdf file changes open the pdf to view it, but I don't want Chrome to open it in a new tab every time. Is ...
Todd Davies's user avatar
7 votes
2 answers
18k views

Pass parameters to program started with Runas

I am trying to start Performance monitor as different user. I found runas.exe but syntax for program arguments makes me go crazy. The following syntax works: C:\Windows\System32\runas.exe /user:domain\...
JIV's user avatar
  • 185
7 votes
1 answer
6k views

How to capture command line parameters for new processes? [duplicate]

I'm trying to capture the video conversion parameters passed onto the codecs in MediaCoder to learn how codecs pass streams onto other codecs. Is there a program that captures the command-line ...
chaz's user avatar
  • 322
7 votes
1 answer
10k views

How to preserve white space in Bash arguments

I use the command: cm1 cm2 arg1 arg2 'argument 3' It first goes to cm1, which will then redirect arg1 arg2 'argument 3' to another file. /usr/bin/cm1: #! /bin/bash # some script here shift cm2 $@ ...
François ッ Vespa ت's user avatar
7 votes
2 answers
3k views

How can I tell Emacs TRAMP to use specific arguments to ssh?

I'm trying to set up my Emacs TRAMP to access remote files via ssh, and I would like to add some additional arguments to the ssh command that tramp uses for connecting. Is there a way to do this? I ...
Ryan C. Thompson's user avatar
6 votes
5 answers
11k views

tabcal.exe command line switches

There is a utility on Windows 7 that allows you to do touch calibration, if you have a supported touch screen. The executable is tabcal.exe and it's located in: C:\Windows\System32 I'm look for a ...
ScottN's user avatar
  • 287
6 votes
2 answers
850 views

Differences in bash scripts between $@ and $*

Which are the differences between $@ and $* ? For example I see no differences here: #! /bin/bash echo with star: $* echo with at sign: $@
Alberto's user avatar
  • 385
6 votes
3 answers
16k views

What's Linux test -a command test for?

Please take a look at the following code, snap=snapshot.file touch snapshot.file-1 $ [ -a $snap-1 ] && echo yes yes What does the test -a command tests for here? I tried info ...
xpt's user avatar
  • 8,821
6 votes
1 answer
66k views

Pass a path with space to a batch file as a parameter

In first.bat, I use var5=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\ CALL scripts\vc64.bat %var5% And in scripts\vc64.bat, I use SET var6=%1vcvarsx86_amd64.bat CALL %var6% ...
user565739's user avatar
6 votes
1 answer
20k views

Passing Command Line Args to `open` on Mac

I am using the open command from the Terminal to open an app bundle and would like to pass a command line argument through to the underlying executable. Is this possible with the open command? The ...
dtlussier's user avatar
  • 2,175
6 votes
3 answers
9k views

Is it possible to open a new tab in a specific container when using Firefox Containers?

I'm using multi-account containers in Firefox to keep my tabs separate from each other. I'm looking for a way to open new tabs in specific containers. Using Cmd+T opens a new tab in a default ...
Matt's user avatar
  • 418
5 votes
3 answers
21k views

7zip command line options for more information when synchronizing

In the 7zip command line options, is there some argument that can make 7z output the files ignored/deleted from the archive too? (files ignored by the option -uq0) Example call: "C:\Program Files\7-...
VSP's user avatar
  • 121
5 votes
3 answers
12k views

OneNote 2016 Command-Line Open To a Page

"C:\Program Files (x86)\Microsoft Office\root\Office16\ONENOTE.EXE" /hyperlink "https://onedrive.live.com/edit.aspx/Documents/Projects?cid=......" Running the above shortcut should open the page ...
Ahmed's user avatar
  • 381

1
2 3 4 5
7