Version 3 vs 11
Version 3 vs 11
Edits
Edits
- Move Away by keithzg, Version 11
- Jul 5 2021 9:32 PM
- ·Moved to beneath the new path as I commit to writing some documentation on macOS stuff (largely so I don't forget as I figure things out)
- Edit by keithzg, Version 3
- Jan 18 2019 7:35 PM
- ·Starting to actually sound kinda useful!
Edit Older Version 3... |
Content Changes
Content Changes
So, you're trying to use the Terminal app on macOS, eh? Maybe you're unfamiliar with the terminal, with macOS, or both? Well, here are some pointers for you, imaginary person and/or Sam!
= Neat basics =
----
== {key tab} ==
Use the tab key all the time! Type as little as you actually have to, let tab autocomplete do all the heavy lifting!
----
== `cd` ==
Now of course, everyone and their dog knows you use the `cd` command to change directories. But did you know that if you just run `cd` without any arguments, it returns you to your home directory? Ah, exquisitely lazy!
----
== `pushd` and `popd` ==
While most of the time one changes directories using `cd`, if you're going off to some other directory for a bit but planning on returning to where you currently are, `pushd` and `popd` can be quite useful. They're a classic [[ https://en.wikipedia.org/wiki/Stack_(abstract_data_type) | stack ]], so for instance rather than
```
totally-real-mac:/some/place use$ cd /some/otherplace
totally-real-mac:/some/otherplace user$ {do a buncha crap}
totally-real-mac:/some/otherplace user$ cd /some/place
totally-real-mac:/some/place user$
```
just run
```
totally-real-mac:/some/place user$ pushd /some/otherplace
totally-real-mac:/some/otherplace user$ {do a buncha crap}
totally-real-mac:/some/otherplace user$ popd
totally-real-mac:/some/place user$
```
Obviously this isn't always that much more helpful than just using `cd`, but in some circumstances it can be quite nice!
----
== {key alt .} ==
In a normal Linux terminal, {key alt .} calls back up the last portion of the last command you typed. So for instance, if you just ran `touch somefile`, then typing `chmod +x ` and then press {key alt .}, viola, now you have `chmod +x somefile`! And you can tap {key .} multiple times to walk back through your history. This is really quite handy a lot of the time.
Unfortunately on macOS this instead just prints a ≤ character. I hate you //so much//, Apple.
There are two ways around this:
1. {nav Terminal > Preferences > Profiles} and checkmark "Use Option as Meta key". That fixes it entirely.
2. Use {key Escape .} instead. Unfortunately, this is not only more awkward but it's made even more awkward by requiring you to press `Esc` each time too, rather than just {key .} like with {key alt .}, so you should really just use option 1.
So, you're trying to use the Terminal app on macOS, eh? Maybe you're unfamiliar with the terminal, with macOS, or both? Well, here are some pointers for you, imaginary person and/or Sam!
= Neat basics =
----
== {key tab} ==
Use the tab key all the time! Type as little as you actually have to, let tab autocomplete do all the heavy lifting!
----
== `cd` ==
Now of course, everyone and their dog knows you use the `cd` command to change directories. But did you know that if you just run `cd` without any arguments, it returns you to your home directory? Ah, exquisitely lazy!
----
== `pushd` and `popd` ==
While most of the time one changes directories using `cd`, if you're going off to some other directory for a bit but planning on returning to where you currently are, `pushd` and `popd` can be quite useful. They're a classic [[ https://en.wikipedia.org/wiki/Stack_(abstract_data_type) | stack ]], so for instance rather than
```
totally-real-mac:/some/place use$ cd /some/otherplace
totally-real-mac:/some/otherplace user$ {do a buncha crap}
totally-real-mac:/some/otherplace user$ cd /some/place
totally-real-mac:/some/place user$
```
just run
```
totally-real-mac:/some/place user$ pushd /some/otherplace
totally-real-mac:/some/otherplace user$ {do a buncha crap}
totally-real-mac:/some/otherplace user$ popd
totally-real-mac:/some/place user$
```
Obviously this isn't always that much more helpful than just using `cd`, but in some circumstances it can be quite nice!
----
== {key alt .} ==
In a normal Linux terminal, {key alt .} calls back up the last portion of the last command you typed. So for instance, if you just ran `touch somefile`, then typing `chmod +x ` and then press {key alt .}, viola, now you have `chmod +x somefile`! And you can tap {key .} multiple times to walk back through your history. This is really quite handy a lot of the time.
Unfortunately on macOS this instead just prints a ≤ character. I hate you //so much//, Apple.
There are two ways around this:
1. {nav Terminal > Preferences > Profiles} and checkmark "Use Option as Meta key". That fixes it entirely.
2. Use {key Escape .} instead. Unfortunately, this is not only more awkward but it's made even more awkward by requiring you to press `Esc` each time too, rather than just {key .} like with {key alt .}, so you should really just use option 1.