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
269
votes
9 answers

find filenames NOT ending in specific extensions on Unix?

Is there a simple way to recursively find all files in a directory hierarchy, that do not end in a list of extensions? E.g. all files that are not *.dll or *.exe UNIX/GNU find, powerful as it is, doesn't seem to have an exclude mode (or I'm missing…
Cristian Diaconescu
  • 34,633
  • 32
  • 143
  • 233
268
votes
13 answers

Copy Paste in Bash on Ubuntu on Windows

How to execute a copy paste operation from Windows 10 to the Bash on Ubuntu on Windows environment? I tried the following: ctrl + shift + v right click to paste Any suggestions?
267
votes
13 answers

Execute a command without keeping it in history

When doing software development, there is often need to include confidential information in command line commands. Typical example is setting credentials for deploying the project to a server as environment variables. How can I execute some…
Jan Vorcak
  • 19,261
  • 14
  • 54
  • 90
266
votes
9 answers

How to run .NET Core console application from the command line

I have a .NET Core console application and have run dotnet publish. However, I can't figure out how to run the application from the command line. Any hints?
devlife
  • 15,275
  • 27
  • 77
  • 131
263
votes
18 answers

Executing multi-line statements in the one-line command-line

I'm using Python with -c to execute a one-liner loop, i.e.: python -c "for r in range(10): print 'rob'" This works fine. However, if I import a module before the for loop, I get a syntax error: python -c "import sys; for r in range(10): print…
user248237
261
votes
26 answers

How do I parse command line arguments in Scala?

What is a good way of parsing command line arguments in Scala? Related: How do I parse command line arguments in Java?
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
261
votes
8 answers

Find all files with name containing string

I have been searching for a command that will return files from the current directory which contain a string in the filename. I have seen locate and find commands that can find files beginning with something first_word* or ending with something…
Dru
  • 9,632
  • 13
  • 49
  • 68
255
votes
13 answers

How do I run a Java program from the command line on Windows?

I'm trying to execute a Java program from the command line in Windows. Here is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import…
Elizabeth Turner
  • 2,711
  • 3
  • 15
  • 11
253
votes
13 answers

Can the Unix list command 'ls' output numerical chmod permissions?

Is it possible when listing a directory to view numerical Unix permissions such as 644, rather than the symbolic output -rw-rw-r-- ? Thanks.
Jon Winstanley
  • 23,010
  • 22
  • 73
  • 116
252
votes
22 answers

How can I use xargs to copy files that have spaces and quotes in their names?

I'm trying to copy a bunch of files below a directory and a number of the files have spaces and single-quotes in their names. When I try to string together find and grep with xargs, I get the following error: find .|grep "FooBar"|xargs -I{} cp "{}"…
Drew Stephens
  • 17,207
  • 15
  • 66
  • 82
250
votes
1 answer

What does the "-U" option stand for in pip install -U

Despite a ton of Googling, I can't find any docs for pip's command line options/arguments. What does pip install -U mean? Does anyone have a link to a list of pip's options and arguments?
zakdances
  • 22,285
  • 32
  • 102
  • 173
249
votes
3 answers

How do I forward parameters to other command in bash script?

Inside my bash script, I would like to parse zero, one or two parameters (the script can recognize them), then forward the remaining parameters to a command invoked in the script. How can I do that?
Łukasz Lew
  • 48,526
  • 41
  • 139
  • 208
247
votes
19 answers

Multiple simultaneous downloads using Wget?

I'm using wget to download website content, but wget downloads the files one by one. How can I make wget download using 4 simultaneous connections?
jubo
  • 2,479
  • 2
  • 15
  • 3
246
votes
25 answers

How to reset Jenkins security settings from the command line?

Is there a way to reset all (or just disable the security settings) from the command line without a user/password as I have managed to completely lock myself out of Jenkins?
ryanzec
  • 27,284
  • 38
  • 112
  • 169
241
votes
9 answers

Windows recursive grep command-line

I need to do a recursive grep in Windows, something like this in Unix/Linux: grep -i 'string' `find . -print` or the more-preferred method: find . -print | xargs grep -i 'string' I'm stuck with just cmd.exe, so I only have Windows built-in…
Andy White
  • 86,444
  • 48
  • 176
  • 211