Questions tagged [terminal]

Questions about the Terminal application or its terminal emulation should use this tag. Use **command-line** for questions about shells or command-line programs that do not specifically involve Terminal.

Terminal.app icon

Apple's Terminal application (sometimes spelled “Terminal.app”) lets the user interact with their shell and other command-line programs. General shell and command-line related questions should use and optionally the specific shell if that's relevant to the post in question.

6281 questions
470
votes
15 answers

git auto-complete for *branches* at the command line?

On my Linux machine I have autocomplete for branches with Git. [Note we are talking about git branch completion, not bash completion (e.g. commands, files, etc). Thus NOT Lane's answer at all] For example I can type git checkout+TAB and get a list…
Michael Durrant
  • 16,996
  • 20
  • 48
  • 71
440
votes
7 answers

How can I create a symbolic link in Terminal?

What command is used to create a symbolic link/soft link?
Patrick
  • 4,409
  • 3
  • 12
  • 3
408
votes
5 answers

What is the difference between .bash_profile and .bashrc?

To make an alias for the Terminal in OS X, you can either put the aliases in .bash_profile or .bashrc. What is the difference between the two and why would I choose to put aliases in one and not the other?
daviesgeek
  • 37,296
  • 51
  • 158
  • 200
404
votes
133 answers

Got any tips or tricks for Terminal in Mac OS X?

One tip or trick per answer. My favorite is open . Opens the folder you're currently browsing in Finder. You can also pass URLs, images, documents or else to open. If you specify a program name with -a you can pass the URL, image, document or…
Josh K
  • 1,868
  • 9
  • 25
  • 30
401
votes
9 answers

Using Alt/Cmd + Right/Left Arrow in iTerm

Is it possible to move between words in iTerm using Alt + Right/Left Arrows ? Now if I press Alt+Left I will get '[D' and '[C' if I press Alt+Right.
ceth
  • 5,017
  • 4
  • 17
  • 19
385
votes
12 answers

How can I configure Mac Terminal to have color ls output?

How can I configure Mac Terminal to have color ls output? I am using MacOS 10.5
lucius
383
votes
13 answers

How can I trigger a Notification Center notification from an AppleScript or shell script?

I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write. Is there a built-in command or a third-party library I can use from either an AppleScript or shell script? Ideally the type and…
Nathan Greenstein
  • 28,124
  • 24
  • 102
  • 135
348
votes
9 answers

How do I find my IP Address from the command line?

I know you can do ifconfig | grep inet, but that shows you several IPv4 addresses. How do I get the specific one for SSHing et al?
JShoe
  • 4,529
  • 8
  • 26
  • 37
324
votes
5 answers

How can I list my open network ports with netstat?

I would like to list my open network ports in Terminal with built in commands. As what I know, netstat is the command to use. But I'm struggling to get any useful information out of it. How can I list my open ports with netstat? Any specific flags…
Jonas
  • 5,813
  • 10
  • 31
  • 34
304
votes
4 answers

What are the practical differences between Bash and Zsh?

With the news that Catalina will default to Zsh instead of Bash, I'm finding lots of results telling me about the switch, and that it may cause problems with shell scripts, but I'm not familiar enough with Zsh to know what those problems might…
dr.nixon
  • 5,228
  • 3
  • 17
  • 24
272
votes
13 answers

Why doesn't .bashrc run automatically?

I put some alias commands in my .bashrc file, so that they might be loaded everytime I open a new Terminal window. Yet this doesn't happen. I have to select run script: in the Terminal>Preferences>"MyDefaultTheme">Shell prefpane and add: source…
romeovs
  • 4,143
  • 8
  • 23
  • 32
255
votes
7 answers

How to replace Mac OS X utilities with GNU core utilities?

I found there is some differences between the utility command I used on the mac OSX and linux. I want to make my experience united. How could I replace all my mac utilities with GNU utilities?
steveyang
  • 2,715
  • 3
  • 15
  • 6
250
votes
5 answers

Can I open files in TextEdit from the Terminal in Mac OS X?

I frequently find that a Terminal command to open a file in TextEdit would be very handy. Does such a command exist on Mac OS X?
wfbarksdale
  • 2,659
  • 2
  • 14
  • 8
244
votes
22 answers

Is there a Mac OS X Terminal version of the "free" command in Linux systems?

On Linux, I often use the free command to see the current amount of free and used memory in the system. For example: $ free total used free shared buffers cached Mem: 7264256 1010952 6253304 0…
hpy
  • 5,365
  • 12
  • 37
  • 47
243
votes
11 answers

How to use terminal to copy a file to the clipboard?

I got a file on desktop, file name is ded.html. To copy the file, I click the file and press cmd+c. Now how would I do the same thing using terminal ?
angry kiwi
  • 2,715
  • 5
  • 18
  • 19
1
2 3
99 100