Questions tagged [command-line-interface]

The interface to a program that consists entirely of text, as opposed to (although not necessarily mutually exclusive to) a GUI, or Graphical User Interface.

A command line interface (CLI) is an interface to a program based on a series of typed text lines, called commands, which follow a specific language structure. The command lines are then interpreted by a Command Language Interpreter (more commonly known as a Shell).

The CLI was a popular interface since the 1960's, and even with development of more modern UI experiences such as , it is still a ubiquitous interface today. Depending on the specific command language, the CLI could provide a quicker and more accurate way to perform commands compared to alternatives.

Useful Resources

7666 questions
3668
votes
14 answers

grep a file, but show several surrounding lines?

I would like to grep for a string, but also show the preceding five lines and the following five lines as well as the matched line. How would I be able to do this?
Mark Harrison
  • 267,774
  • 112
  • 308
  • 434
1237
votes
23 answers

Merge / convert multiple PDF files into one PDF

How could I merge / convert multiple PDF files into one large PDF file? I tried the following, but the content of the target file was not as expected: convert file1.pdf file2.pdf merged.pdf I need a very simple/basic command line (CLI) solution.…
alcohol
  • 19,052
  • 4
  • 21
  • 21
711
votes
11 answers

Execute a command line binary with Node.js

I am in the process of porting a CLI library from Ruby over to Node.js. In my code I execute several third party binaries when necessary. I am not sure how best to accomplish this in Node. Here's an example in Ruby where I call PrinceXML to convert…
Dave Thompson
  • 7,313
  • 3
  • 14
  • 11
538
votes
8 answers

Pretty print in MongoDB shell as default

Is there a way to tell Mongo to pretty print output? Currently, everything is output to a single line and it's difficult to read, especially with nested arrays and documents.
raffian
  • 28,859
  • 25
  • 95
  • 164
506
votes
3 answers

Is there a way to follow redirects with command line cURL?

I know that in a php script: curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); will follow redirects. Is there a way to follow redirects with command line cURL?
user1592380
  • 26,587
  • 62
  • 220
  • 414
482
votes
17 answers

How to create a file in Linux from terminal window?

What's the easiest way to create a file in Linux terminal?
raffian
  • 28,859
  • 25
  • 95
  • 164
409
votes
18 answers

How to open Atom editor from command line in OS X?

I have the Atom editor and was wondering how you can open a file or folder from the terminal in Atom. I am using a Mac. I am looking for a way to do this: atom . (opens folder) atom file.js (opens file) atom (opens editor) Is this possible and…
Anders
  • 9,518
  • 7
  • 25
  • 34
392
votes
12 answers

Command prompt won't change directory to another drive

I'm trying to compile some java (learning java currently), and to do so I need to change command-prompt's directory (using javac). C:\...\Admin> cd D:\Docs\Java C:\...\Admin> cd C:\...\Admin It doesn't change the directory. I try again using…
nebuch
  • 5,044
  • 3
  • 18
  • 33
367
votes
24 answers

Is it possible to create a remote repo on GitHub from the CLI without opening browser?

I created a new local Git repository: ~$ mkdir projectname ~$ cd projectname ~$ git init ~$ touch file1 ~$ git add file1 ~$ git commit -m 'first commit' Is there any git command to create a new remote repo and push my commit to GitHub from here? I…
anddoutoi
  • 9,289
  • 3
  • 27
  • 28
321
votes
18 answers

How to change the project in GCP using CLI commands

How can i change the current running project to another project in GCP (Google Cloud Platform) account using cli commands other than using gcloud init manually. $gcloud projects list will list the projects running on my account. I want to change the…
Ebin Davis
  • 3,663
  • 3
  • 8
  • 18
316
votes
15 answers

Is there a better Windows Console Window?

I find working on the command line in Windows frustrating, primarily because the console window is wretched to use compared to terminal applications on linux and OS X such as "rxvt", "xterm", or "Terminal". Major complaints: No standard…
Alan Storm
  • 157,413
  • 86
  • 367
  • 554
308
votes
4 answers

How to expand/collapse a diff sections in Vimdiff?

I've started using vimdiff today, and wanted to do some of the things that I've taken for granted on Windows based diff editors (like expand/collapse a diff section, have full file expansion/only diffs with 3 context lines above or below, etc.). I…
TCSGrad
  • 11,324
  • 13
  • 46
  • 68
288
votes
5 answers

Send request to cURL with post data sourced from a file

I need to make a POST request via cURL from the command line. Data for this request is located in a file. I know that via PUT this could be done with the --upload-file option. curl host:port/post-file -H "Content-Type: text/xml" --data…
breedish
  • 5,331
  • 11
  • 36
  • 57
280
votes
10 answers

Highlight text similar to grep, but don't filter out text

When using grep, it will highlight any text in a line with a match to your regular expression. What if I want this behaviour, but have grep print out all lines as well? I came up empty after a quick look through the grep man page.
Martin Konecny
  • 50,691
  • 18
  • 119
  • 145
257
votes
2 answers

Is there a way to continue broken scp (secure copy) command process in Linux?

I am copying 7.5 GB file to a remote server using scp command. At some point in time file transfer breaks and I have to start all over again. Is the temporary amount of file being transferred completely lost ? Can I somehow restart the transfer from…
Matko
  • 3,144
  • 4
  • 18
  • 31
1
2 3
99 100