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

How to close git commit editor?

I just executed a command $ git commit and it opens a new editor. But I'm trying to close that new commit editor. How to do this? I'm using Git for Windows.
aniskhan001
  • 7,981
  • 8
  • 36
  • 57
355
votes
19 answers

How can I use Unicode characters on the Windows command line?

We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things, we've stumbled upon a problem; we can't pass the š letter to the command-line tools. The command prompt…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
354
votes
8 answers

How to export and import a .sql file from command line with options?

Not Duplicate! looking for some feature have phpmyadmin during export in command line I want to export and import a .sql file to and from a MySQL database from command line. Is there any command to export .sql file in MySQL? Then how do I import…
AZinkey
  • 5,209
  • 5
  • 28
  • 46
353
votes
11 answers

Execute combine multiple Linux commands in one line

I am trying to merge multiple linux commands in one line to perform deployment operation. For example cd /my_folder rm *.jar svn co path to repo mvn compile package install
d-man
  • 57,473
  • 85
  • 212
  • 296
352
votes
14 answers

How to connect to MySQL from the command line

How can you connect to MySQL from the command line in a Mac? (i.e. show me the code) I'm doing a PHP/SQL tutorial, but it starts by assuming you're already in MySQL.
Leahcim
  • 40,649
  • 59
  • 195
  • 334
351
votes
14 answers

Windows shell command to get the full path to the current directory?

Is there a Windows command line command that I can use to get the full path to the current working directory? Also, how can I store this path inside a variable used in a batch file?
user62958
  • 4,669
  • 5
  • 32
  • 35
347
votes
11 answers

Is there replacement for cat on Windows

I need to join two binary files with a *.bat script on Windows. How can I achieve that?
Artem Tikhomirov
  • 21,497
  • 10
  • 48
  • 68
347
votes
12 answers

How to recursively download a folder via FTP on Linux

I'm trying to ftp a folder using the command line ftp client, but so far I've only been able to use 'get' to get individual files.
Charles Ma
  • 47,141
  • 22
  • 87
  • 101
346
votes
9 answers

Why do you need ./ (dot-slash) before executable or script name to run it in bash?

When running scripts in bash, I have to write ./ in the beginning: $ ./manage.py syncdb If I don't, I get an error message: $ manage.py syncdb -bash: manage.py: command not found What is the reason for this? I thought . is an alias for current…
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
345
votes
15 answers

What's the best way to parse command line arguments?

What's the easiest, tersest, and most flexible method or library for parsing Python command line arguments?
kamens
  • 11,910
  • 6
  • 45
  • 46
341
votes
16 answers

Run function in script from command line (Node JS)

I'm writing a web app in Node. If I've got some JS file db.js with a function init in it how could I call that function from the command line?
winhowes
  • 7,845
  • 5
  • 28
  • 39
338
votes
11 answers

How to kill all processes matching a name?

Say I want to kill every process containing the word amarok. I can print out the commands I want to execute. But how do I actually make the shell execute them. ie. ps aux | grep -ie amarok | awk '{print "kill -9 " $2}' Output: kill -9 3052 kill -9…
PuercoPop
  • 6,707
  • 4
  • 30
  • 40
337
votes
4 answers

Executing command line programs from within python

I'm building a web application that will is going to manipulate (pad, mix, merge etc) sound files and I've found that sox does exactly what I want. Sox is a linux command line program and I'm feeling a little uncomfortable with having the python web…
Mattias
  • 5,189
  • 4
  • 23
  • 18
337
votes
19 answers

How can I shuffle the lines of a text file on the Unix command line or in a shell script?

I want to shuffle the lines of a text file randomly and create a new file. The file may have several thousands of lines. How can I do that with cat, awk, cut, etc?
Ruggiero Spearman
  • 6,735
  • 5
  • 26
  • 37
333
votes
6 answers

What is the purpose of the -m switch?

Could you explain to me what the difference is between calling python -m mymod1 mymod2.py args and python mymod1.py mymod2.py args It seems in both cases mymod1.py is called and sys.argv is ['mymod1.py', 'mymod2.py', 'args'] So what is the -m…
Charles Brunet
  • 21,797
  • 24
  • 83
  • 124