Questions tagged [command-line-arguments]
332 questions
245
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,…
Danny Tuppeny
- 3,059
- 4
- 18
- 16
131
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,707
- 3
- 14
- 16
122
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…
Karl Voigtland
- 1,351
- 2
- 8
- 6
87
votes
4 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 commandarguments
Also, why…
Jonas Köritz
- 968
- 1
- 6
- 18
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?
sudoer
- 921
- 1
- 7
- 3
45
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,249
- 6
- 24
- 32
36
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,178
- 7
- 27
- 39
34
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…
shouya
- 2,287
- 4
- 23
- 25
34
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,020
- 17
- 95
- 126
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…
goweon
- 1,693
- 2
- 19
- 21
29
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…
BondUniverse
- 823
- 5
- 14
- 27
29
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,163
- 3
- 14
- 22
22
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…
kissgyorgy
- 729
- 3
- 9
- 21
21
votes
5 answers
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 --basedir=/usr --datadir=/var/lib/mysql…
user200340
- 313
- 1
- 2
- 4
20
votes
3 answers
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 Alexsander$ cd October Fall
-bash: cd: October: No such…
Alexander Khitev
- 303
- 1
- 2
- 10