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
345
votes
7 answers

What is a unix command for deleting the first N characters of a line?

For example, I might want to: tail -f logfile | grep org.springframework | I was thinking that tr might have the ability to do this but I'm not sure.
les2
  • 14,093
  • 16
  • 59
  • 76
342
votes
5 answers

PHP exec() vs system() vs passthru()

What are the differences? Is there a specific situation or reason for each function? If yes, can you give some examples of those situations? PHP.net says that they are used to execute external programs. see reference From the examples I see, I don't…
codingbear
  • 14,773
  • 20
  • 48
  • 64
340
votes
6 answers

How can you run a command in bash over and over until success?

I have a script and want to ask the user for some information, but the script cannot continue until the user fills in this information. The following is my attempt at putting a command into a loop to achieve this but it doesn't work for some…
J V
  • 11,402
  • 10
  • 52
  • 72
338
votes
7 answers

Git alias with positional parameters

Basically I'm trying to alias: git files 9fa3 ...to execute the command: git diff --name-status 9fa3^ 9fa3 but git doesn't appear to pass positional parameters to the alias command. I have tried: [alias] files = "!git diff --name-status $1^…
user400575
  • 3,555
  • 2
  • 17
  • 11
323
votes
19 answers

cocoapods - 'pod install' takes forever

I was trying to update the existing pods with the pod install command, but it takes forever to run. The verbose mode shows it was stuck at the following line (forever) Updating spec repo master $ /usr/bin/git pull --no-rebase --no-commit There is…
Hai Feng Kao
  • 5,219
  • 2
  • 27
  • 38
311
votes
6 answers

Converting PKCS#12 certificate into PEM using OpenSSL

I have OpenSSL x64 on Windows 7 which I downloaded from openssl-for-windows on Google Code. I'm attempting to run: openssl pkcs12 -export -in "path.p12" -out "newfile.pem" but I get an error. unable to load private key How do I extract the…
Dean MacGregor
  • 11,847
  • 9
  • 34
  • 72
274
votes
6 answers

Command to list all files in a folder as well as sub-folders in windows

I tried searching for a command that could list all the file in a directory as well as subfolders using a command prompt command. I have read the help for "dir" command but coudn't find what I was looking for. Please help me what command could get…
user1760178
  • 6,277
  • 5
  • 27
  • 57
250
votes
7 answers

Multiple commands on same line

I've been trying to find something that will let me run multiple commands on the same line in Vim, akin to using semicolons to separate commands in *nix systems or & in Windows. Is there a way to do this?
Bub Bradlee
  • 2,905
  • 2
  • 19
  • 15
230
votes
10 answers

Perform an action in every sub-directory using Bash

I am working on a script that needs to perform an action in every sub-directory of a specific folder. What is the most efficient way to write that?
mikewilliamson
  • 24,303
  • 17
  • 59
  • 90
228
votes
19 answers

Laravel PHP command not found

I installed Laravel using Composer without problems, but when I try to run laravel in the terminal, I get the following error: -bash: laravel: command not found The docs say that I need to do the following: Make sure to place the…
chemitaxis
  • 13,889
  • 17
  • 74
  • 125
225
votes
3 answers

How to add a set path only for that batch file executing?

Basically, I know I can go through my control panel and modify the path variable. But, I'm wondering if there is a way to through batch programming have a temporary path included? That way it is only used during that batch file execution. I don't…
michael
  • 14,844
  • 28
  • 89
  • 177
217
votes
14 answers

node.js execute system command synchronously

I need in node.js function result = execSync('node -v'); that will synchronously execute the given command line and return all stdout'ed by that command text. ps. Sync is wrong. I know. Just for personal use. UPDATE Now we have mgutz's solution…
disfated
  • 10,633
  • 12
  • 39
  • 50
203
votes
5 answers

Passing an enum value as command parameter from XAML

I want to pass an enum value as command parameter in WPF, using something like this:
201
votes
9 answers

How to enter command with password for git pull?

I want to do this command in one line: git pull && [my passphrase] How to do it?
Anton Medvedev
  • 3,393
  • 3
  • 28
  • 40
193
votes
2 answers

How to delete a folder and all contents using a bat file in windows?

I want to delete a folder with all files and subfolders using a bat file. I have tried the following, but it is not working: @DEL D:\PHP_Projects\testproject\Release\testfolder*.* Can anybody help?
learner
  • 2,609
  • 4
  • 22
  • 23