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
6018
votes
66 answers

How do I execute a program or call a system command?

How do I call an external command within Python as if I had typed it in a shell or command prompt?
freshWoWer
  • 61,969
  • 10
  • 36
  • 35
3414
votes
38 answers

Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")

I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13). This morning I navigated to my work's codebase in the command line on my MacBook Pro, typed…
dustbuster
  • 79,958
  • 7
  • 21
  • 41
3112
votes
65 answers

How do I print colored text to the terminal?

How do I output colored text to the terminal in Python?
aboSamoor
  • 31,331
  • 3
  • 17
  • 10
2142
votes
18 answers

How to reload .bashrc settings without logging out and back in again?

If I make changes to .bashrc, how do I reload it without logging out and back in?
Jed Daniels
  • 24,376
  • 5
  • 24
  • 24
1142
votes
16 answers

How do I clear/delete the current line in terminal?

If I'm using terminal and typing in a line of text for a command, is there a hotkey or any way to clear/delete that line? For example, if my current line/command is something really long like: > git log --graph --all --blah..uh oh i want to cancel…
triad
  • 20,407
  • 13
  • 45
  • 50
989
votes
2 answers

How can I get the current date and time in the terminal and set a custom command in the terminal for it?

I have to check the time in a Linux terminal. What is the command for getting date and time in a Linux terminal? Is there a way in which we can set a custom function?
harshal
  • 10,252
  • 3
  • 18
  • 23
913
votes
20 answers

How to move the cursor word by word in the OS X Terminal

I know the combination Ctrl+A to jump to the beginning of the current command, and Ctrl+E to jump to the end. But is there any way to jump word by word, like Alt+←/→ in Cocoa applications does?
Arne
818
votes
25 answers

How can I copy the output of a command directly into my clipboard?

How can I pipe the output of a command into my clipboard and paste it back when using a terminal? For instance: cat file | clipboard
Legend
  • 113,822
  • 119
  • 272
  • 400
789
votes
31 answers

Find and kill a process in one line using bash and regex

I often need to kill a process during programming. The way I do it now is: [~]$ ps aux | grep 'python csp_build.py' user 5124 1.0 0.3 214588 13852 pts/4 Sl+ 11:19 0:00 python csp_build.py user 5373 0.0 0.0 8096 960 pts/6 S+ …
Orjanp
  • 10,641
  • 12
  • 36
  • 39
762
votes
27 answers

Run / Open VSCode from Mac Terminal

I'd like to run / open Visual Studio Code from the Mac OSX Terminal by running this command code .. I found instructions here: https://code.visualstudio.com/Docs/setup Apparently I need to include this in my .bashrc file, so I did, but to no…
Johnny Oshika
  • 54,741
  • 40
  • 181
  • 275
756
votes
10 answers

Git branch command behaves like 'less'

When I use the git branch command to list all branches, I see the output of git branch | less. The command git branch is supposed to show a list of branches, like ls does for files. This is the output I get: How do I get the default behaviour of…
DenicioCode
  • 8,668
  • 4
  • 18
  • 33
728
votes
18 answers

How do I see which version of Swift I'm using?

I just created a new Swift project within Xcode. I am wondering which version of Swift it's using. How can I see, in Xcode or the terminal, what version of Swift I am using inside my project?
David Snabel
  • 9,801
  • 6
  • 21
  • 29
692
votes
36 answers

Node Version Manager install - nvm command not found

I am trying to install NVM as per these instructions I typed in this command in terminal: $ curl https://raw.github.com/creationix/nvm/master/install.sh | sh After running the install, I restart the terminal and attempt to install Node.js with this…
jordan
  • 9,570
  • 9
  • 43
  • 78
691
votes
35 answers

psql: FATAL: role "postgres" does not exist

I'm a postgres novice. I installed the postgres.app for mac. I was playing around with the psql commands and I accidentally dropped the postgres database. I don't know what was in it. I'm currently working on a tutorial:…
user805981
  • 9,979
  • 8
  • 44
  • 64
682
votes
14 answers

Open terminal here in Mac OS finder

Is there something similar to the "Open Command Window Here" Windows Powertoy for Mac OS? I've found a couple plugins through a google search but wanted to see what works best for developers out there.
Abdullah Jibaly
  • 53,220
  • 42
  • 124
  • 197
1
2 3
99 100