Questions tagged [command-line-arguments]

343 questions
272
votes
12 answers

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 problem if I close down my "Home" profile last,…
153
votes
8 answers

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
  • 1,937
132
votes
4 answers

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:\path\to\exe\program.exe -option1 -option2" However…
89
votes
5 answers

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 standard format of command<space>arguments Also, why…
82
votes
2 answers

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?
47
votes
2 answers

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 arguments and when I so it like this (without /b…
Patryk
  • 1,269
40
votes
3 answers

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 other is easier to read and understand. But every…
ygoe
  • 2,550
  • 8
  • 29
  • 47
37
votes
1 answer

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://example.com In the example, if title is given not null,…
37
votes
2 answers

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 /some/path /some/other/path . Is there anything like…
Wuffers
  • 19,709
34
votes
12 answers

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 prints the resulant IP. (Right now it shows the…
32
votes
5 answers

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 `echo abc` `echo xyz` I could just store both…
28
votes
4 answers

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
  • 1,263
24
votes
2 answers

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 files without using the Windows Copy Offload…
23
votes
8 answers

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 two parameters with this command: find . -iname…
23
votes
3 answers

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
  • 14,323
1
2 3
…
22 23