Questions tagged [terminal]

A terminal or command-line interface is a text-only interface for interacting with an operating system or a piece of software. A user typically types commands into the terminal to perform specific tasks.

A terminal or command-line interface is a text-only interface for interacting with an operating system or a piece of software. A user typically types commands into the Terminal to perform specific tasks.

Programming standards

Wikipedia articles

See also:

24127 questions
642
votes
20 answers

How to use 'cp' command to exclude a specific directory?

I want to copy all files in a directory except some files in a specific sub-directory. I have noticed that cp command didn't have the --exclude option. So, how can I achieve this?
David Liu
  • 16,374
  • 12
  • 37
  • 38
612
votes
24 answers

List Git aliases

How do I print a list of my git aliases, i.e., something analogous to the bash alias command?
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
559
votes
33 answers

Open Sublime Text from Terminal in macOS

In Terminal when I use .subl It returns -bash: .subl: command not found Anyone know how to open Sublime Text 3 from the command line in macOS?
user1405049
  • 5,591
  • 3
  • 14
  • 3
546
votes
6 answers

Unable to show a Git tree in terminal

Killswitchcollective.com's old article, 30 June 2009, has the following inputs and outputs git co master git merge [your_branch] git push upstream A-B-C-D-E A-B-C-D-E-F-G \ ----> \ your branch …
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
538
votes
7 answers

OS X Terminal Colors

I just got a Mac after working with Ubuntu Linux for some time. Among the many things I'm trying to figure out is the absence of colors in my terminal window- like the ones that are shown (on Linux) when running ls -la or git status. How can one…
sa125
  • 28,121
  • 38
  • 111
  • 153
471
votes
21 answers

Concatenate multiple files but include filename as section headers

I would like to concatenate a number of text files into one large file in terminal. I know I can do this using the cat command. However, I would like the filename of each file to precede the "data dump" for that file. Anyone know how to do…
Nick
  • 5,411
  • 4
  • 19
  • 7
468
votes
9 answers

List of ANSI color escape sequences

On most terminals it is possible to colorize output using the \033 ANSI escape sequence. I'm looking for a list of all supported colors and options (like bright and blinking). As there are probably differences between the terminals supporting them,…
ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
461
votes
12 answers

Clear a terminal screen for real

Using the clear command on the terminal only fools the user into thinking the screen has been cleared...you can still see output from the previous commands when you scroll using the mouse. This makes life difficult when you are drowning in a tsunami…
Sandeep Datta
  • 28,607
  • 15
  • 70
  • 90
444
votes
9 answers

How can I turn off "scrolling the history" in iTerm2

I have installed the new iTerm 2. It asked me in a yellow bar at the top if I'd like to enable a mouse feature. Unfortunately, I don't remember the exact sentence anymore. By accident I approved. Now when I use the scroll wheel on the mouse in…
Gambo
  • 4,790
  • 2
  • 14
  • 14
443
votes
16 answers

How to exit a 'git status' list in a terminal?

How can I exit a terminal listing mode generated by the git status command?
Luis Martins
  • 4,589
  • 3
  • 17
  • 6
427
votes
4 answers

How to remove files and directories quickly via terminal (bash shell)

From a terminal window: When I use the rm command it can only remove files. When I use the rmdir command it only removes empty folders. If I have a directory nested with files and folders within folders with files and so on, is there a way to…
None
424
votes
5 answers

Keep SSH session alive

I use ssh -p8520 username@remote_host to login remote server. Issue: It is always connected and works properly when I am in the work place. Unfortunately, terminal freezes in 10 - 15 minutes after I connected with the remote server from home.…
Haifeng Zhang
  • 30,077
  • 19
  • 81
  • 125
395
votes
10 answers

How do I find the width & height of a terminal window?

As a simple example, I want to write a CLI script which can print = across the entire width of the terminal window. #!/usr/bin/env php
too much php
  • 88,666
  • 34
  • 128
  • 138
386
votes
24 answers

`npm install` fails on node-gyp rebuild with `gyp: No Xcode or CLT version detected!`

Every time I try npm install. I get the following error. How do I fix it? gyp: No Xcode or CLT version detected! I am on node -v → v8.8.0 & npm -v → v6.11.3 I tried to run it on VSCode terminal and iTerm, but both ended up getting the same error.…
Jeena
  • 4,193
  • 3
  • 9
  • 19
385
votes
12 answers

Change the default terminal in Visual Studio Code

I am using Visual Studio Code on my Windows 10 PC. I want to change my default terminal from Windows PowerShell to Bash on Ubuntu (on Windows). How can I do that?
abhijeetps
  • 4,609
  • 4
  • 17
  • 30