Questions tagged [command-line]

A command line is a string given to a command interpreter that tells it actions to take, such as running programs or copying files. The interpreter processes command lines with escapes and substitutions.

A command-line interface () is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks. This text-only interface contrasts with the use of a mouse pointer with a graphical user interface (GUI) to click on options, or menus on a text user interface (TUI) to select options.

This method of instructing a computer to perform a given task is referred to as entering a command. The system waits for the user to conclude the submitting of the text command by pressing the Enter key (a descendant of the carriage return key of a typewriter keyboard). A command-line interpreter then receives, parses, and executes the requested user command. The command-line interpreter may be run in a text terminal or in a terminal emulator window as a remote shell client such as .

Upon completion, the command usually returns output to the user in the form of text lines on the CLI.

Related tag:

See also: Wikipedia Command-line_interface.

23435 questions
223
votes
4 answers

maven command line how to point to a specific settings.xml for a single command?

Is it possible to point to a specific settings file in order to override the default settings.xml being used by maven for a single command? Example: mvn clean install -Dparam # -> pass specific settings file path as param to override default…
guilhebl
  • 8,330
  • 10
  • 47
  • 66
219
votes
8 answers

How can I show lines in common (reverse diff)?

I have a series of text files for which I'd like to know the lines in common rather than the lines which are different between them. Command line Unix or Windows is fine. File foo: linux-vdso.so.1 => (0x00007fffccffe000) libvlc.so.2 =>…
matt wilkie
  • 17,268
  • 24
  • 80
  • 115
217
votes
16 answers

How to execute shell command in Javascript

I want to write a JavaScript function which will execute the system shell commands (ls for example) and return the value. How do I achieve this?
Sunil Kumar Sahoo
  • 53,011
  • 55
  • 178
  • 243
216
votes
11 answers

How to trigger XDebug profiler for a command line PHP script?

XDebug offers the configuration directive xdebug.profiler_enable_trigger that allows to activate profiling by passing the GET or POST parameter "XDEBUG_PROFILE" when calling a script via HTTP. This is handy if you don't want profiling for ALL of…
selfawaresoup
  • 15,473
  • 7
  • 36
  • 47
215
votes
15 answers

Making iTerm to translate 'meta-key' in the same way as in other OSes

In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key is mapped to Alt key on Windows and Linux. However, in iTerm, I could not…
ejel
  • 4,135
  • 9
  • 32
  • 39
214
votes
7 answers

How to loop through files matching wildcard in batch file

I have a set of base filenames, for each name 'f' there are exactly two files, 'f.in' and 'f.out'. I want to write a batch file (in Windows XP) which goes through all the filenames, for each one it should: Display the base name 'f' Perform an…
Luke Halliwell
  • 7,312
  • 6
  • 31
  • 31
214
votes
11 answers

How to run .sh on Windows Command Prompt?

How can I run .sh on Windows 7 Command Prompt? I always get this error when I try to run this line in it, app/build/build.sh error, 'app' is not recognized... or, bash app/build/build.sh error, 'bash' is not recognized... Any ideas what have I…
Run
  • 54,938
  • 169
  • 450
  • 748
214
votes
7 answers

How do you run a single query through mysql from the command line?

I'm looking to be able to run a single query on a remote server in a scripted task. For example, intuitively, I would imagine it would go something like: mysql -uroot -p -hslavedb.mydomain.com mydb_production "select * from users;"
Matthew
  • 5,435
  • 6
  • 25
  • 29
209
votes
12 answers

How to change Git log date formats

I am trying to display the last commit within Git, but I need the date in a special format. I know that the log pretty format %ad respects the --date format, but the only --date format I can find is "short". I want to know the others, and whether I…
ar3
  • 3,883
  • 3
  • 21
  • 22
209
votes
8 answers

How to find the mysql data directory from command line in windows

In linux I could find the mysql installation directory with the command which mysql. But I could not find any in windows. I tried echo %path% and it resulted many paths along with path to mysql bin. I wanted to find the mysql data directory from…
Prabhu
  • 5,296
  • 4
  • 37
  • 45
208
votes
9 answers

How do I install cygwin components from the command line?

Is there a tool in the Cygwin package similar to apt-get on Debian or yum on redhat that allows me to install components from the command line?
vy32
  • 28,461
  • 37
  • 122
  • 246
208
votes
5 answers

Run class in Jar file

If you have a jar file called myJar.jar located in /myfolder and you want to use the class called myClass from it, how do you go about doing it from the command line? I thought it would be to go into the directory and say java -cp myJar.jar.myClass…
jim
  • 2,155
  • 2
  • 14
  • 6
208
votes
6 answers

Delete .DS_STORE files in current folder and all subfolders from command line on Mac

I understand I can use find . -name ".DS_Store" to find all the .DS_Store files in the current folder and all subfolders. But how could I delete them from command line simultaneously? I found it's really annoying to switch back and forth to all…
SixSigma
  • 2,808
  • 2
  • 18
  • 21
206
votes
15 answers

How to create a React app directly in the current folder

I know I've done it before but I can't seem to find the answer anywhere. I want to run create-react-app without creating a whole other folder within the folder I'm already in. I believe it is just an additional flag appended to the command.
Niko Roberts
  • 2,091
  • 2
  • 8
  • 5
206
votes
28 answers

How to call VS Code Editor from terminal / command line

The question says it all. How can I open VS Code editor from windows cmd linux and mac terminal e.g. for notepad++ I write > start notepad++ test.txt By the way, the editor is awesome (cross-platform)! Thank you Nadella! You can download it from…
Levon
  • 10,408
  • 4
  • 47
  • 42