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

Is there a subshell created when I run `sh -c "command"`, a new shell or none of these?

In bash, when I run the following command: sh -c "command" is there created a subshell and then the command is executed? My guess is that the command will run in the current shell, but I'm not sure. This guess come from the fact that I already…
Radu Rădeanu
  • 2,642
  • 2
  • 26
  • 43
14
votes
2 answers

When a Java system property is set on the command line without value ("-Dkey"), what value does it get?

According to the Oracle documentation, I can set system properties of a Java process on the command line with the following syntax: -Dproperty=value But what happens when I don't specify the value, i.e. when I omit the "equals value"…
oberlies
  • 11,503
  • 4
  • 63
  • 110
14
votes
5 answers

How to do a HTTP HEAD request from the windows command line?

What's the best way (or tool) on the Windows (Vista) command line to get size and modification time for a file on a remote webserver, without downloading it?
Henning
  • 11,496
  • 5
  • 27
  • 25
14
votes
6 answers

adding a timeout to batch/powershell

$fullnamexp = ((net user $winxp /domain | Select-String "Full Name") -replace "Full Name","").Trim(); If $winxp cannot be found, the command will hang, is there a timeout I can use with this to make it move on after 5-10 seconds? Not sure where I…
Aaron
  • 3,135
  • 20
  • 51
  • 78
14
votes
2 answers

Move file as root preserving ownership linux

OS: Debian. I want to be able to move files and folders around as root and from the command line without changing it's owner and group. Is this possible?
Rombus
  • 341
  • 1
  • 7
  • 19
14
votes
1 answer

Why do bash command line arguments after 9 require curly brackets?

This may not be the most thought provoking question, but nevertheless has struck my curiosity. I have not been able to come across any answer (let alone a definitive one) on the web. While reading Advanced Shell Scripting, I came across this…
Default
  • 16,020
  • 3
  • 24
  • 38
14
votes
2 answers

How to package native commandline application in apk?

I would like to package an Android native commandline application into an apk. I have the application building with ndk-build which uses jni/Android.mk. The output is in libs/armeabi/. I also have the apk building with ant. However, the…
Alex I
  • 19,689
  • 9
  • 86
  • 158
14
votes
4 answers

pipe each line of a file to a command

I have a text file which each line is a one word coded base64 separely. Now I want to decode it. I'm trying to use base64 command line, but I'm getting all the words in only one line, I want one per line. For example, my file…
tpcordeiro
  • 441
  • 1
  • 6
  • 13
14
votes
4 answers

PHP UTF-8 to Windows command line encoding

Everything is in the question : I have a Php script that is a UTF-8 file. In this script I want to do this : If I run it in a Windows prompt I get this : C:\php>php -c C:\WINDOWS\php.ini -f…
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
14
votes
1 answer

postgresql - start on mac - `pg_ctl` not working

I want to use the pre-installed postgresql on my local machine (mac os 10.7.5), when I run which psql I find it (in /usr/bin/psql), but then running pg_ctl -D /usr/bin/psql -l /usr/bin/psql/server.log start results in: -bash: pg_ctl: command not…
Lucy Weatherford
  • 5,452
  • 16
  • 50
  • 76
14
votes
10 answers

Using SC.exe to set service credentials password fails

I know this question has been asked in the past, but a satisfactory answer has not been provided. I am using the SC command to config the credentials for a service. SC.exe config "SERVICE NAME" obj= "domain\user" password= "password" This completes…
Grayson
  • 591
  • 1
  • 4
  • 17
14
votes
3 answers

Linux command get tomcat process id by name

Linux command line: When i execute the following command ps -ef |grep tomcat it shows me the following process abcapp 28119 1 0 12:53 ? 00:00:19 /usr/java/jdk1.6.0_10//bin/java -Xmx256m -Dabc.log.file=/home/app/apps/rum/logs/dev.log…
d-man
  • 57,473
  • 85
  • 212
  • 296
14
votes
2 answers

Error unable to access jarfile C:\Jar

My jar file P2.jar (which has a main method and manifest file) is located in C:\Jar Folder. I tried to run it from cmd like this: C:SomeRandomFolder> java -jar C:\Jar Folder\P2.jar I get the error: unable to access jarfile C:\Jar It works when I…
Apple Grinder
  • 3,573
  • 7
  • 22
  • 35
14
votes
3 answers

How to extract a specific field from output of tasklist on the windows command line

I ran the following command on the windows command prompt C:>tasklist /fi "Imagename eq BitTorrent.exe" The output of which is Image Name PID Session Name Session # Mem Usage ================== ======== ================= …
ashish makani
  • 153
  • 1
  • 1
  • 8
14
votes
7 answers

How do you convert command line args in python to a dictionary?

I'm writing an application that takes arbitrary command line arguments, and then passes them onto a python function: $ myscript.py --arg1=1 --arg2=foobar --arg1=4 and then inside myscript.py: import sys argsdict = some_function(sys.argv) where…
priestc
  • 33,060
  • 24
  • 83
  • 117
1 2 3
99
100