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
169
votes
5 answers

What is the canonical way to determine commandline vs. http execution of a PHP script?

I have a PHP script that needs to determine if it's been executed via the command-line or via HTTP, primarily for output-formatting purposes. What's the canonical way of doing this? I had thought it was to inspect SERVER['argc'], but it turns out…
Bobby Jack
  • 15,689
  • 15
  • 65
  • 97
167
votes
23 answers

Show a popup/message box from a Windows batch file

Is there a way to display a message box from a batch file (similar to how xmessage can be used from bash-scripts in Linux)?
billyy
  • 2,265
  • 3
  • 18
  • 13
165
votes
5 answers

Does svn have a `revert-all` command?

If I want to throw away all of my changes, and return to the code that is on the repository, I do the following: $ rm -fr * $ svn up This is easy enough, but I'm wondering if there is a single command that will accomplish this, something like: $…
Eric Wilson
  • 57,719
  • 77
  • 200
  • 270
165
votes
17 answers

How do I get the find command to print out the file size with the file name?

If I issue the find command as follows: find . -name *.ear It prints out: ./dir1/dir2/earFile1.ear ./dir1/dir2/earFile2.ear ./dir1/dir3/earFile1.ear I want to 'print' the name and the size to the command line: ./dir1/dir2/earFile1.ear 5000…
Brian
  • 13,412
  • 10
  • 56
  • 82
165
votes
10 answers

How to pass command line argument to gnuplot?

I want to use gnuplot to draw figure from data file, say foo.data. Currently, I hardcoded the data file name in the command file, say foo.plt, and run command gnuplot foo.plg to plot data. However, I want to pass the data file name as a command…
Yun Huang
  • 4,256
  • 7
  • 27
  • 36
162
votes
13 answers

How can I search for a multiline pattern in a file?

I needed to find all the files that contained a specific string pattern. The first solution that comes to mind is using find piped with xargs grep: find . -iname '*.py' | xargs grep -e 'YOUR_PATTERN' But if I need to find patterns that spans on…
Oli
  • 15,345
  • 8
  • 30
  • 36
161
votes
18 answers

Command line progress bar in Java

I have a Java program running in command line mode. I would like to display a progress bar, showing the percentage of job done. The same kind of progress bar you would see using wget under unix. Is this possible?
g andrieu
  • 2,081
  • 3
  • 14
  • 10
160
votes
18 answers

SVN: Is there a way to mark a file as "do not commit"?

With TortoiseSVN, I can move a file into the ignore-on-commit changelist, so that when I commit a whole tree, changes to that file do not get committed. Is there a way to do something like that using the svn command-line tool? EDIT: Thanks for the…
Ferruccio
  • 98,941
  • 38
  • 226
  • 299
160
votes
4 answers

How to merge images in command line?

I would like to try the CSS Sprite technique to load a few thumbnails as a single image. So I need to "merge" a few thumbnails in a single file offline in the server. Suppose I have 10 thumbnails of the same size. How would you suggest I "merge"…
Michael
  • 41,026
  • 70
  • 193
  • 341
159
votes
6 answers

Determine command line working directory when running node bin script

I am creating a node command line interface. It is installed globally and uses a bin file to execute. I plan to have a command window open at the root directory of the files I am working on and then just run the command however I have been unable to…
Daniel Chatfield
  • 2,952
  • 3
  • 19
  • 17
158
votes
9 answers

How do I compile a Visual Studio project from the command-line?

I'm scripting the checkout, build, distribution, test, and commit cycle for a large C++ solution that is using Monotone, CMake, Visual Studio Express 2008, and custom tests. All of the other parts seem pretty straight-forward, but I don't see how…
John Mulder
  • 9,765
  • 7
  • 33
  • 37
158
votes
5 answers

mkdir's "-p" option

So this doesn't seem like a terribly complicated question I have, but it's one I can't find the answer to. I'm confused about what the -p option does in Unix. I used it for a lab assignment while creating a subdirectory and then another…
156
votes
105 answers

What is your single most favorite command-line trick using Bash?

We all know how to use -R to reverse search through history, but did you know you can use -S to forward search if you set stty stop ""? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are…
hoyhoy
  • 6,281
  • 7
  • 38
  • 36
153
votes
11 answers

How to change Firebase user login identity from command line (CLI)?

I'm trying to login to Firebase using login credentials of, let's say, User-Alice. But when I go through the authorization procedure I get a message saying I'm logged in as User-Bob. This is not mentioned anywhere in the documentation nor does it…
Let Me Tink About It
  • 15,156
  • 21
  • 98
  • 207
153
votes
15 answers

Where is svn.exe in my machine?

I have Tortoise svn installed on my desktop. I want to perform some tasks using commandline svn.exe? But I am not able to find svn.exe on my machine. Do we have to install something else to get the svn.exe commands?
Amitabh
  • 59,111
  • 42
  • 110
  • 159