Version 1 vs 2
Version 1 vs 2
Edits
Edits
- Edit by keithzg, Version 2
- Jan 18 2019 7:11 PM
- Edit by keithzg, Version 1
- Jan 18 2019 7:09 PM
- ·A few initial bits
Original Change | Next Change » |
Edit Older Version 1... | Edit Older Version 2... |
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 you might not have heard of =
----
== `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
```
user:/some/place$ cd /some/otherplace
user:/some/otherplace$ {do a buncha crap}
user:/some/otherplace$ cd /some/place
```
just run
```
user:/some/place$ pushd /some/otherplace
user:/some/otherplace$ {do a buncha crap}
user:/some/otherplace$ popd
```
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`! 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.
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 you might not have heard of =
----
== `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
```
user:/some/place$ cd /some/otherplace
user:/some/otherplace$ {do a buncha crap}
user:/some/otherplace$ cd /some/place
```
just run
```
user:/some/place$ pushd /some/otherplace
user:/some/otherplace$ {do a buncha crap}
user:/some/otherplace$ popd
```
Obviously this isn't always that much more helpful than just using `cd`, but in some circumstances it can be quite nice!
----
== `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!
----
== {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`! 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.
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 you might not have heard of =
----
== `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
```
user:/some/place$ cd /some/otherplace
user:/some/otherplace$ {do a buncha crap}
user:/some/otherplace$ cd /some/place
```
just run
```
user:/some/place$ pushd /some/otherplace
user:/some/otherplace$ {do a buncha crap}
user:/some/otherplace$ popd
```
Obviously this isn't always that much more helpful than just using `cd`, but in some circumstances it can be quite nice!
----
== `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!
----
== {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`! 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.