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
597
votes
14 answers

Debugging with command-line parameters in Visual Studio

I'm developing a C++ command-line application in Visual Studio and need to debug it with command-line arguments. At the moment I just run the generated EXE file with the arguments I need (like this program.exe -file.txt) , but this way I can't…
Maciej Gryka
  • 8,181
  • 4
  • 34
  • 30
576
votes
8 answers

How can I pass an argument to a PowerShell script?

There's a PowerShell script named itunesForward.ps1 that makes iTunes fast forward 30 seconds: $iTunes = New-Object -ComObject iTunes.Application if ($iTunes.playerstate -eq 1) { $iTunes.PlayerPosition = $iTunes.PlayerPosition + 30 } It is…
Boris Pavlović
  • 63,078
  • 28
  • 122
  • 148
556
votes
18 answers

Run function from the command line

I have this code: def hello(): return 'Hi :)' How would I run this directly from the command line?
Steven
  • 5,633
  • 3
  • 15
  • 5
526
votes
17 answers

How To: Execute command line in C#, get STD OUT results

How do I execute a command-line program from C# and get back the STD OUT results? Specifically, I want to execute DIFF on two files that are programmatically selected and write the results to a text box.
Wing
  • 5,988
  • 3
  • 21
  • 12
525
votes
31 answers

Restore a postgres backup file using the command line?

Locally, I use pgadmin3. On the remote server, however, I have no such luxury. I've already created the backup of the database and copied it over, but is there a way to restore a backup from the command line? I only see things related to GUI or to…
TwixxyKit
  • 9,953
  • 9
  • 31
  • 32
516
votes
14 answers

Command prompt won't change directory to another drive

I'm trying to compile some java (learning java currently), and to do so I need to change command-prompt's directory. C:\...\Admin> cd D:\Docs\Java C:\...\Admin> cd C:\...\Admin It doesn't change the directory. I try again using…
nebuch
  • 6,475
  • 4
  • 20
  • 39
511
votes
18 answers

List of Stored Procedures/Functions Mysql Command Line

How can I see the list of the stored procedures or stored functions in mysql command line like show tables; or show databases; commands.
systemsfault
  • 15,207
  • 12
  • 59
  • 66
481
votes
20 answers

Peak memory usage of a linux/unix process

Is there a tool that will run a command-line and report the peak RAM usage total? I'm imagining something analogous to /usr/bin/time
jes5199
  • 18,324
  • 12
  • 36
  • 40
476
votes
31 answers

How do I launch the Android emulator from the command line?

I'm on Mac, working on Android development from the terminal. I have successfully created the HelloWorld project and now I'm trying to run it from the command line in the Android emulator. Which command runs the emulator for my HelloWorld…
Thierry Lam
  • 45,304
  • 42
  • 117
  • 144
471
votes
10 answers

What is the purpose of "&&" in a shell command?

As far as I know, using & after the command is for running it in the background. Example of & usage: tar -czf file.tar.gz dirname & But how about &&? (example)
Captain
  • 4,797
  • 4
  • 16
  • 6
456
votes
26 answers

Is there a command line utility for rendering GitHub flavored Markdown?

I'm wondering if there is a command line utility for taking a GitHub flavored Markdown file and rendering it to HTML. I'm using a GitHub wiki to create website content. I've cloned the repository on my server and would then like to process it into…
McLeopold
  • 5,967
  • 5
  • 21
  • 14
455
votes
23 answers

xcopy file, rename, suppress "Does xxx specify a file name..." message

This seems pretty simple and maybe I'm just overlooking the proper flag, but how would I, in one command, copy a file from one directory to another and rename it in the destination directory? Here's my command: if exist…
Sarah Vessels
  • 30,930
  • 33
  • 155
  • 222
453
votes
12 answers

How to find out line-endings in a text file?

I'm trying to use something in bash to show me the line endings in a file printed rather than interpreted. The file is a dump from SSIS/SQL Server being read in by a Linux machine for processing. Are there any switches within vi, less, more,…
Marco Ceppi
  • 7,163
  • 5
  • 31
  • 43
446
votes
16 answers

Remove the last line from a file in Bash

I have a file, foo.txt, containing the following lines: a b c I want a simple command that results in the contents of foo.txt being: a b
Fragsworth
  • 33,919
  • 27
  • 84
  • 97
446
votes
20 answers

Xcode "Build and Archive" from command line

Xcode 3.2 provides an awesome new feature under the Build menu, "Build and Archive" which generates an .ipa file suitable for Ad Hoc distribution. You can also open the Organizer, go to "Archived Applications," and "Submit Application to…
Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175