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
239
votes
8 answers

how to change directory using Windows command line

I'm using cmd.exe (C:\WINDOWS\System32\cmd.exe) and I have to change my current directory to "D:\temp" i.e. temp folder in the D drive. When I try to cd nothing happens. C:\> cd D:\temp C:\> I don't know what else to do here. Even pressing tab key…
A. K.
  • 34,395
  • 15
  • 52
  • 89
238
votes
6 answers

Take a full page screenshot with Firefox on the command-line

I'm running Firefox on a Xvfb in a VPS. What I want to do is to take a full page screenshot of the page. I can redirect Firefox to particular page using firefox http://google.com and take a screenshot (inside X) using ImageMagick import root…
Omar Abid
  • 15,753
  • 28
  • 77
  • 108
236
votes
11 answers

BAT file: Open new cmd window and execute a command in there

I'm trying to open a new command window in a BAT file: start %windir%\system32\cmd.exe After it opens, I'd like to execute a BAT command in the new window: echo "test in new window" How can I do this?
Tjekkles
  • 5,352
  • 8
  • 36
  • 53
235
votes
7 answers

Linux equivalent of the Mac OS X "open" command

I've found the "open" command in Mac OS X very handy in the command line. From "man open": The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the …
Liu Chang
235
votes
5 answers

How to remove all MySQL tables from the command-line without DROP database permissions?

How do I drop all tables in Windows MySQL, using command prompt? The reason I want to do this is that our user has access to the database drops, but no access to re-creating the database itself, for this reason we must drop the tables manually. Is…
Mantas
  • 3,179
  • 4
  • 20
  • 32
232
votes
19 answers

How do you input command line arguments in IntelliJ IDEA?

I usually input command line arguments in Eclipse via run configuration. But I don't know how do achieve the same task in IntelliJ IDEA.
sungkwangsong
  • 5,575
  • 4
  • 26
  • 18
231
votes
7 answers

How to do a non-greedy match in grep?

I want to grep the shortest match and the pattern should be something like: ... ... ... ... means any character and the input is multiple lines.
syker
  • 10,912
  • 16
  • 56
  • 68
230
votes
12 answers

Shell command to find lines common in two files

I'm sure I once found a shell command which could print the common lines from two or more files. What is its name? It was much simpler than diff.
too much php
  • 88,666
  • 34
  • 128
  • 138
229
votes
8 answers

How to merge 2 JSON objects from 2 files using jq?

I'm using the jq tools (jq-json-processor) in shell script to parse json. I've got 2 json files and want to merge them into one unique file Here the content of files: file1 { "value1": 200, "timestamp": 1382461861, "value": { …
Janfy
  • 2,466
  • 2
  • 20
  • 17
228
votes
12 answers

How do I use the lines of a file as arguments of a command?

Say, I have a file foo.txt specifying N arguments arg1 arg2 ... argN which I need to pass to the command my_command How do I use the lines of a file as arguments of a command?
Yoo
  • 17,526
  • 6
  • 41
  • 47
227
votes
16 answers

How to start MySQL server from command line on Mac OS Lion?

I installed mySQL on my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preferences, I want to know the instructions to start from command-line. I do as follows: After su root I start the mySQL server by…
vietstone
  • 8,784
  • 16
  • 52
  • 79
224
votes
28 answers

Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system

Inside of visual studio code, I'm trying to execute a script.bat from the command line, but I'm getting the following error: File C:\Theses_Repo\train-cnn\environment\Scripts\activate.ps1 cannot be loaded because running scripts is disabled on this…
Ricardo Rocha
  • 14,612
  • 20
  • 74
  • 130
224
votes
19 answers

How to replace ${} placeholders in a text file?

I want to pipe the output of a "template" file into MySQL, the file having variables like ${dbName} interspersed. What is the command line utility to replace these instances and dump the output to standard output? The input file is considered to be…
Dana the Sane
  • 14,762
  • 8
  • 58
  • 80
224
votes
16 answers

How to request Administrator access inside a batch file

I am trying to write a batch file for my users to run from their Vista machines with UAC. The file is re-writing their hosts file, so it needs to be run with Administrator permissions. I need to be able to send them an email with a link to the…
skb
  • 30,624
  • 33
  • 94
  • 146
223
votes
16 answers

Git says "Warning: Permanently added to the list of known hosts"

Every time I use git to interact with a remote, such as when pulling or pushing, I am shown the following message: Warning: Permanently added '...' (RSA) to the list of known hosts. How can I prevent this annoying message from displaying? It is…
Donald T
  • 10,234
  • 17
  • 63
  • 91