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
204
votes
17 answers

Compiling/Executing a C# Source File in Command Prompt

How do you compile and execute a .cs file from a command-prompt window?
Sajal Dutta
  • 18,272
  • 11
  • 52
  • 74
204
votes
14 answers

How to create a file with a given size in Linux?

For testing purposes I have to generate a file of a certain size (to test an upload limit). What is a command to create a file of a certain size on Linux?
Grundlefleck
  • 124,925
  • 25
  • 94
  • 111
203
votes
5 answers

How to do a simple file search in cmd

I want to quickly search for a file given its name or part of its name, from the windows command line (not power shell). This is similar to opening explorer and using the search box at the top. Note: dir can search based on a string template but it…
Bogdan Gavril MSFT
  • 20,615
  • 10
  • 53
  • 74
202
votes
4 answers

Why is my command prompt freezing on Windows 10?

I'm adding this question after spending an entire day wrestling with this incredibly frustrating feature of the Windows 10 command prompt which made me think there was something wrong with my console application code. I hope it will help…
Shaun Rowan
  • 9,269
  • 4
  • 28
  • 52
198
votes
12 answers

How can I find out if I have Xcode commandline tools installed?

I need to use gdb. ps-MacBook-Air:AcoustoExport pi$ gdb -bash: gdb: command not found ps-MacBook-Air:AcoustoExport pi$ sudo find / -iname "*gdb*" Password: /usr/local/share/gdb /usr/local/Cellar/isl/0.12.1/share/gdb : and:…
P i
  • 29,020
  • 36
  • 159
  • 267
198
votes
12 answers

https connection using CURL from command line

I am new to Curl and Cacerts world and facing a problem while connecting to a server. Basically, I need to test connectivity over https from one machine to another machine. I have a URL to which I need to connect from Machine A (a linux machine) I…
user1270392
  • 2,981
  • 4
  • 21
  • 25
197
votes
8 answers

How to create a database from shell command?

I'm looking for something like createdb in PostgreSQL or any other solution that would allow me to create database with a help of a shell command. Any hints?
koszikot
  • 2,243
  • 2
  • 15
  • 8
196
votes
14 answers

Windows Explorer "Command Prompt Here"

I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory. I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside…
recursive
  • 83,943
  • 34
  • 151
  • 241
196
votes
8 answers

How do I comment on the Windows command line?

In Bash, # is used to comment the following. How do I make a comment on the Windows command line?
Tim
  • 1
  • 141
  • 372
  • 590
196
votes
21 answers

Unix command to prepend text to a file

Is there a Unix command to prepend some string data to a text file? Something like: prepend "to be prepended" text.txt
One Two Three
  • 22,327
  • 24
  • 73
  • 114
195
votes
9 answers

How to resolve "gpg: command not found" error during RVM installation?

I have a new mac pro (OS X 10.9.5) that I get to set up from scratch. I want to install RVM and the first thing it says to do is: Install mpapis public key (might need gpg2 and or sudo) gpg --keyserver hkp://keys.gnupg.net --recv-keys…
JDillon522
  • 19,046
  • 15
  • 47
  • 81
191
votes
9 answers

How to find directory of some command?

I know that when you are on shell, the only commands that can be used are the ones that can be found on some directory set on PATH. Even I don't know how to see what dirs are on my PATH variable (and this is another good question that could be…
Gabriel L. Oliveira
  • 3,922
  • 6
  • 31
  • 40
191
votes
13 answers

How can I access command line parameters in Rust?

The Rust tutorial does not explain how to take parameters from the command line. fn main() is only shown with an empty parameter list in all examples. What is the correct way of accessing command line parameters from main?
shutefan
  • 6,156
  • 8
  • 23
  • 23
190
votes
6 answers

How can I execute PHP code from the command line?

I would like to execute a single PHP statement like if(function_exists("my_func")) echo 'function exists'; directly with the command line without having to use a separate PHP file. How is it possible?
Stephane
  • 4,978
  • 9
  • 51
  • 86
188
votes
26 answers

Flutter command not found

Apparently, none of the Flutter commands are working in the terminal of Android Studio which I believe I am trying to run it at the root of my project. Output: bash: flutter: command not found
heyr
  • 5,514
  • 11
  • 34
  • 55