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:

9693 questions
152
votes
3 answers

How to locate the vimrc file used by vim editor?

Is there a command in the vim editor to find the .vimrc file location?
niting112
  • 2,188
  • 2
  • 14
  • 17
149
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
  • 169,974
  • 95
  • 213
  • 200
148
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
  • 7,958
  • 9
  • 46
  • 60
147
votes
9 answers

How to store a command in a variable in a shell script?

I would like to store a command to use at a later period 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,198
  • 5
  • 18
  • 19
140
votes
4 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
  • 4,092
  • 4
  • 25
  • 23
134
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
  • 266,361
  • 143
  • 616
  • 705
120
votes
8 answers

How to sort a file, based on its numerical values for a field?

Example file.txt: 100 foo 2 bar 300 tuu When using sort -k 1,1 file.txt, the order of lines will not change, though we are expecting : 2 bar 100 foo 300 tuu How to sort a field consisting of numbers based on the absolute numerical…
lukmac
  • 4,067
  • 8
  • 30
  • 34
120
votes
24 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,251
  • 3
  • 10
  • 6
119
votes
7 answers

How to move all files including hidden files into parent directory via *

Its must be a popular question but I could not find an answer. How to move all files via * including hidden files as well to parent directory like this: mv /path/subfolder/* /path/ This will move all files to parent directory like expected but will…
TroodoN-Mike
  • 14,537
  • 12
  • 50
  • 77
118
votes
9 answers

How To Launch Git Bash from DOS 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 DOS batch file. Here is what I tried so far: Launched Git Bash from Win 7 Start button Used CTRL+ALT+DEL to…
116
votes
3 answers

How can I turn off Visual Studio 2013 Preview?

When I want to search files I use Ctrl+,. The search box pops up and then I start typing. But the built-in preview just grabs whatever I have typed and opens the file. Even though I am still typing. I am trying to open a file called report_vaccine,…
DeadlyChambers
  • 4,627
  • 3
  • 39
  • 56
114
votes
6 answers

ruby system command check exit code

I have a bunch of system calls in ruby such as the following and I want to check their exit codes simultaneously so that my script exits out if that command fails. system("VBoxManage createvm --name test1") system("ruby test.rb") I want something…
user1530318
  • 19,347
  • 13
  • 31
  • 46
109
votes
1 answer

Transform hexadecimal information to binary using a Linux command

I have this binary file on my Linux system... udit@udit-Dabba ~ $ cat file.enc Salted__s�bO��<0�F���Jw!���]�:`C�LKȆ�l Using the hexdump command, I see its information like this: udit@udit-Dabba ~ $ hexdump -C file.enc 00000000 53 61 6c 74 65…
Udit Gupta
  • 2,772
  • 11
  • 38
  • 68
106
votes
13 answers

Why number 9 in kill -9 command in unix?

I understand it's off topic, I couldn't find anywhere online and I was thinking maybe programming gurus in the community might know this. I usually use kill -9 pid to kill the job. I always wondered the origin of 9. I looked it up online, and it…
Alby
  • 4,910
  • 6
  • 36
  • 48
105
votes
11 answers

Linux - Replacing spaces in the file names

I have a number of files in a folder, and I want to replace every space character in all file names with underscores. How can I achieve this?
Mithun Sreedharan
  • 45,549
  • 69
  • 171
  • 232