Questions tagged [command]

A command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell. Use [command-pattern] for the design pattern.

A command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell.

Specifically, the term command is used in imperative computer languages. These languages are called this, because statements in these languages are usually written in a manner similar to the imperative mood used in many natural languages. If one views a statement in an imperative language as being like a sentence in a natural language, then a command is generally like a verb in such a language.

Many programs allow specially formatted arguments, known as flags, which modify the default behaviour of the command, while further arguments describe what the command acts on. Comparing to a natural language: the flags are adverbs, whilst the other arguments are objects.

More links:

10688 questions
193
votes
12 answers

How can I store a command in a variable in a shell script?

I would like to store a command to use at a later time in a variable (not the output of the command, but the command itself). I have a simple script as follows: command="ls"; echo "Command: $command"; #Output is: Command: ls b=`$command`; echo $b;…
Benjamin
  • 2,718
  • 5
  • 21
  • 20
187
votes
3 answers

Command substitution: backticks or dollar sign / paren enclosed?

What's the preferred way to do command substitution in bash? I've always done it like this: echo "Hello, `whoami`." But recently, I've often seen it written like this: echo "Hello, $(whoami)." What's the preferred syntax, and why? Or are they…
Dagg Nabbit
  • 75,346
  • 19
  • 113
  • 141
182
votes
8 answers

How do I read the source code of shell commands?

I would like to read the actual source code which the linux commands are written with. I've gained some experience using them and now I think it's time to interact with my machine at a deeper level. I've found some commands here…
Luigi Tiburzi
  • 4,265
  • 7
  • 32
  • 43
181
votes
4 answers

How to locate the vimrc file used by Vim?

Is there a command in the Vim editor to find the .vimrc file location?
niting112
  • 2,498
  • 2
  • 16
  • 18
177
votes
6 answers

Passing two command parameters using a WPF binding

I have a command which I am executing from my XAML file using the following standard syntax:
JasonD
  • 7,472
  • 5
  • 31
  • 31
175
votes
34 answers

How do I duplicate a whole line in Emacs?

I saw this same question for VIM and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?
Ray
  • 187,153
  • 97
  • 222
  • 204
173
votes
8 answers

How to create an alias for a command in Vim?

Vim is my preferred text editor when I program, and thus I always run into a particularly annoying issue. Frequently, when I quickly need to save the buffer and continue on to some other miscellaneous task, I do the typical :w However, I always —…
Sean
  • 5,233
  • 5
  • 22
  • 26
158
votes
6 answers

How do I create a directory from within Emacs?

How exactly can I create a new directory using Emacs? What commands do I use? (If possible, please provide an example)
Ray
  • 187,153
  • 97
  • 222
  • 204
156
votes
5 answers

How to execute an external program from within Node.js?

Is it possible to execute an external program from within node.js? Is there an equivalent to Python's os.system() or any library that adds this functionality?
Michael Bylstra
  • 5,042
  • 4
  • 28
  • 24
152
votes
12 answers

How To Launch Git Bash from Windows Command Line?

I've got what I'm hoping is a simple question, but I haven't been able to find the answer yet. I would like to launch Git Bash from a Windows batch file. Here is what I tried so far: Launched Git Bash from Win 7 Start button Used CTRL+ALT+DEL to…
151
votes
4 answers

Why doesn't "total" from ls -l add up to total file sizes listed?

Why is the total in the output of ls -l printed as 64 and not 26078 which is the total of all files listed? $ ls -l ~/test/ls total 64 -rw-r--r-- 1 root root 15276 Oct 5 2004 a2ps.cfg -rw-r--r-- 1 root root 2562 Oct 5 …
Sanket Sahu
  • 8,468
  • 10
  • 51
  • 65
147
votes
31 answers

How to open an elevated cmd using command line for Windows?

How do I open a elevated command prompt using command lines on a normal cmd? For example, I use runas /username:admin cmd but the cmd that was opened does not seem to be elevated! Any solutions?
user2633882
  • 1,551
  • 3
  • 11
  • 6
141
votes
25 answers

Python command not working in command prompt

When I type python into the command line, the command prompt says python is not recognized as an internal or external command, operable program, or batch file. What should I do? Note: I have Python 2.7 and Python 3.2 installed on my computer.
Rohit Rayudu
  • 3,765
  • 6
  • 21
  • 21
140
votes
12 answers

Php artisan make:auth command is not defined

I'm trying to run this command in Laravel 5.2 but it's not working: php artisan make:auth And prompts with these statements: [InvalidArgumentException] Command "make:auth" is not defined Did you mean one of these? make:test …
naan
  • 1,481
  • 2
  • 11
  • 12
139
votes
6 answers

WPF - How to force a Command to re-evaluate 'CanExecute' via its CommandBindings

I have a Menu where each MenuItem in the hierarchy has its Command property set to a RoutedCommand I've defined. The associated CommandBinding provides a callback for the evaluation of CanExecute which controls the enabled state of each…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742