Julia Evans's Avatar

Julia Evans

@b0rk.jvns.ca

programming and exclamation marks blog: jvns.ca zines: wizardzines.com

39,858 Followers  |  323 Following  |  6,678 Posts  |  Joined: 26.04.2023  |  2.2854

Latest posts by b0rk.jvns.ca on Bluesky

Preview
The Secret Rules of the Terminal

all of the preorders of "The Secret Rules of the Terminal" have shipped! we promised they'd ship in August and I'm pleased that we managed to get them all shipped before August even arrived

(please send us an email if you run into any problems)

wizardzines.com/zines/termin...

28.07.2025 19:51 โ€” ๐Ÿ‘ 70    ๐Ÿ” 7    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
The Secret Rules of the Terminal

got back from vacation to see that most of the print preorders for "The Secret Rules of the Terminal" have shipped!

if you'd like a print copy you can get one here: wizardzines.com/zines/termin...

23.07.2025 16:01 โ€” ๐Ÿ‘ 37    ๐Ÿ” 8    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

where is that? ganadara?

06.07.2025 00:06 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Three partially shaded congruent rectangles, with unshaded triangles connecting some of the corners.

Three partially shaded congruent rectangles, with unshaded triangles connecting some of the corners.

The three rectangles are congruent. What fraction of the design is shaded?

#geometrypuzzle

05.07.2025 11:03 โ€” ๐Ÿ‘ 56    ๐Ÿ” 16    ๐Ÿ’ฌ 14    ๐Ÿ“Œ 3
37% - 30+ years
39.5% - 10-30 years
13.6% - 5-10 years
10% - under 5 years

37% - 30+ years 39.5% - 10-30 years 13.6% - 5-10 years 10% - under 5 years

we ran a Wizard Zines reader survey and it's interesting to see that 75% of people who buy the zines have been programming for 10+ years

When I imagine a typical reader I always imagine someone who's been programming (in some capacity) for at least 5-10 years so it's nice to see that's accurate

04.07.2025 15:52 โ€” ๐Ÿ‘ 68    ๐Ÿ” 2    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 1
The Secret Rules of the Terminal, by Julia Evans - The cover illustration depicts three people doing arcane terminal magic in a temple with a smoking censer in the background. Each of the three people has curly brown hair and light brown skin. They are all wearing dresses, billowing cloaks, and utility belts with keyboard symbols on them. The one on the left holds a palette of paints and a brush. The one on the right has a staff with a $ symbol on it and a starfish at the top. The one in the centre has a sword and is reading from a book whose cover says โ€œ>_โ€ and โ€œ./โ€, which rests on a lectern with a smiling snake wrapped around it.

The Secret Rules of the Terminal, by Julia Evans - The cover illustration depicts three people doing arcane terminal magic in a temple with a smoking censer in the background. Each of the three people has curly brown hair and light brown skin. They are all wearing dresses, billowing cloaks, and utility belts with keyboard symbols on them. The one on the left holds a palette of paints and a brush. The one on the right has a staff with a $ symbol on it and a starfish at the top. The one in the centre has a sword and is reading from a book whose cover says โ€œ>_โ€ and โ€œ./โ€, which rests on a lectern with a smiling snake wrapped around it.

we've already sold 1000 copies of The Secret Rules of the Terminal since it came out on Tuesday!!

so to celebrate I'm giving away 1000 copies to anyone who can't afford to buy one. You can use code BUYONEGIVEONE to get a free PDF copy if $12 USD is a lot for you.

wizardzines.com/zines/terminal

28.06.2025 15:41 โ€” ๐Ÿ‘ 166    ๐Ÿ” 53    ๐Ÿ’ฌ 4    ๐Ÿ“Œ 2
Preview
Writing a basic Linux device driver when you know nothing about Linux drivers or USB

i've always been curious about how to write a Linux USB device driver and this blog post looks like a great intro: crescentro.se/posts/writin...

26.06.2025 19:08 โ€” ๐Ÿ‘ 183    ๐Ÿ” 14    ๐Ÿ’ฌ 5    ๐Ÿ“Œ 1
New zine: The Secret Rules of the Terminal New zine: The Secret Rules of the Terminal

new zine: The Secret Rules of the Terminal jvns.ca/blog/2025/06...

26.06.2025 18:42 โ€” ๐Ÿ‘ 59    ๐Ÿ” 6    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 1

I was a beta reviewer for this zine and itโ€™s a banger. Iโ€™ve used the terminal for most of my life and I still learned a lot of secrets, from big concepts to little tricks.

26.06.2025 17:27 โ€” ๐Ÿ‘ 26    ๐Ÿ” 4    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

oops thanks will fix!

25.06.2025 19:48 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

aw thanks!

Iโ€™ve priced things so that it comes out to basically the same thing for me, itโ€™s really just whatever you prefer

25.06.2025 16:54 โ€” ๐Ÿ‘ 5    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

one of my goals with this zine is to show you that you have a lot of choices about how your shell behaves, and that a well-configured shell can make your life in the terminal a LOT easier

25.06.2025 15:12 โ€” ๐Ÿ‘ 39    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

in case you missed it, "The Secret Rules of the Terminal" came out yesterday!

25.06.2025 15:11 โ€” ๐Ÿ‘ 60    ๐Ÿ” 11    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 1
1. SHELL

cast of characters
meet the shell
PATH
PATH tips
history
job control
filename tips
stdin/stderr/stdout
redirects

2. TERMINAL EMULATOR

meet the terminal emulator
escape cdoes
colours
the mouse
copy & paste
TERM

3. PROGRAMS

types of programs
less
editing text in REPLs
keyboard shortcuts

4. TTY DRIVER

meet the TTY driver
stty
canonical mode

1. SHELL cast of characters meet the shell PATH PATH tips history job control filename tips stdin/stderr/stdout redirects 2. TERMINAL EMULATOR meet the terminal emulator escape cdoes colours the mouse copy & paste TERM 3. PROGRAMS types of programs less editing text in REPLs keyboard shortcuts 4. TTY DRIVER meet the TTY driver stty canonical mode

It really left me feeling like the terminal is full of hidden secrets -- because "the terminal" is made up of so many different pieces, there's no single terminal manual you can read!

Here's the table of contents, which as a bonus shows the different components of the terminal!

24.06.2025 17:23 โ€” ๐Ÿ‘ 63    ๐Ÿ” 5    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 1

The reason this zine is called "The Secret Rules of the Terminal" is that I learned more useful things while writing this zine than when writing any other zine, even though I've been using the terminal every day for 20 years.

24.06.2025 17:20 โ€” ๐Ÿ‘ 43    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 1
The Secret Rules of the Terminal, by Julia Evans - The cover illustration depicts three people doing arcane terminal magic in a temple with a smoking censer in the background. Each of the three people has curly brown hair and light brown skin. They are all wearing dresses, billowing cloaks, and utility belts with keyboard symbols on them. The one on the left holds a palette of paints and a brush. The one on the right has a staff with a $ symbol on it and a starfish at the top. The one in the centre has a sword and is reading from a book whose cover says โ€œ>_โ€ and โ€œ./โ€, which rests on a lectern with a smiling snake wrapped around it.

The Secret Rules of the Terminal, by Julia Evans - The cover illustration depicts three people doing arcane terminal magic in a temple with a smoking censer in the background. Each of the three people has curly brown hair and light brown skin. They are all wearing dresses, billowing cloaks, and utility belts with keyboard symbols on them. The one on the left holds a palette of paints and a brush. The one on the right has a staff with a $ symbol on it and a starfish at the top. The one in the centre has a sword and is reading from a book whose cover says โ€œ>_โ€ and โ€œ./โ€, which rests on a lectern with a smiling snake wrapped around it.

delighted to announce that my new zine "The Secret Rules of the Terminal" is out today!!

You can get it for $12 USD here: wizardzines.com/zines/terminal

24.06.2025 16:52 โ€” ๐Ÿ‘ 323    ๐Ÿ” 100    ๐Ÿ’ฌ 3    ๐Ÿ“Œ 6

it's coming out tomorrow! You can sign up at wizardzines.com/zine-announc... if you want to get an email when it's released

23.06.2025 20:43 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
1. SHELL

cast of characters
meet the shell
PATH
PATH tips
history
job control
filename tips
stdin/stderr/stdout
redirects

2. TERMINAL EMULATOR

meet the terminal emulator
escape cdoes
colours
the mouse
copy & paste
TERM

3. PROGRAMS

types of programs
less
editing text in REPLs
keyboard shortcuts

4. TTY DRIVER

meet the TTY driver
stty
canonical mode

1. SHELL cast of characters meet the shell PATH PATH tips history job control filename tips stdin/stderr/stdout redirects 2. TERMINAL EMULATOR meet the terminal emulator escape cdoes colours the mouse copy & paste TERM 3. PROGRAMS types of programs less editing text in REPLs keyboard shortcuts 4. TTY DRIVER meet the TTY driver stty canonical mode

it's happening! "The Secret Rules of the Terminal" is coming out tomorrow!

here's the table of contents:

23.06.2025 19:59 โ€” ๐Ÿ‘ 281    ๐Ÿ” 40    ๐Ÿ’ฌ 4    ๐Ÿ“Œ 5

whatโ€™s an example of a case where you use sponge?

23.06.2025 13:56 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

you can actually technically use the syntax with any file descriptor number (not just 1 and 2) but iโ€™ve only ever used 1 and 2

21.06.2025 22:00 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

yeah exactly!

21.06.2025 21:59 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

yeah! so basically imagine that there are variables called "output" and "error".

`cmd > file.txt 2>&1` is like

output = 'file.txt'
error = output

`cmd 2>&1 > file.txt` is like

error = output
output = 'file.txt'

so in the first case, you end up with error = file.txt but not in the second

21.06.2025 18:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I feel the same way. like I know the reason why it comes at the end but it's still counter intuitive to me

21.06.2025 00:22 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

oh yeah we built a website from scratch a few years ago just to handle a higher volume of beta readers and I ended up adding a bunch of new features to it this time (like an admin toolbar to hide comments that are from too long ago)

20.06.2025 20:02 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

95 beta readers is a new record, I used to ask maybe 1-2 people to read a zine before it went out but this one went through 4 rounds of beta readers who made it a LOT better than it started

20.06.2025 19:53 โ€” ๐Ÿ‘ 28    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0
cmd > file.txt
cmd >> file.txt
cmd < file.txt
cmd 2> file.txt
cmd > file.txt 2>&1
cmd1 | cmd2
cmd1 2>&1 | cmd2

three gotchas:

1. cmd file.txt > file.txt  will delete the contents of file.txt

some people use set -o noclobber (in bash/zsh) to avoid this

But I just have "never read from and redirect to the same file" seared into my memory.

2. sudo echo blah > /root/file.txt doesn't write to /root/file.txt as root. Instead, do:

echo blah | sudo tee /root/file.txt

or

sudo sh -c 'echo blah > /root/file.txt'

3. cmd 2>&1 > file.txt  doesn't write both stdout and stderr to file.txt. Instead, do:

cmd > file.txt 2>&1

panel 3: cat vs <

I almost always prefer to do:

cat file.txt | cmd

instead of

cmd < file.txt

it usually works fine & it feels better to me

using cat can be slower if it's a GIANT file though

panel 4: &> and &|

some shells support &> and &| to redirect/pipe both stdout and stderr

(also some shells use |& instead of &|)

cmd > file.txt cmd >> file.txt cmd < file.txt cmd 2> file.txt cmd > file.txt 2>&1 cmd1 | cmd2 cmd1 2>&1 | cmd2 three gotchas: 1. cmd file.txt > file.txt will delete the contents of file.txt some people use set -o noclobber (in bash/zsh) to avoid this But I just have "never read from and redirect to the same file" seared into my memory. 2. sudo echo blah > /root/file.txt doesn't write to /root/file.txt as root. Instead, do: echo blah | sudo tee /root/file.txt or sudo sh -c 'echo blah > /root/file.txt' 3. cmd 2>&1 > file.txt doesn't write both stdout and stderr to file.txt. Instead, do: cmd > file.txt 2>&1 panel 3: cat vs < I almost always prefer to do: cat file.txt | cmd instead of cmd < file.txt it usually works fine & it feels better to me using cat can be slower if it's a GIANT file though panel 4: &> and &| some shells support &> and &| to redirect/pipe both stdout and stderr (also some shells use |& instead of &|)

here's the final version of the "redirects cheat sheet" draft I posted a while back!

("The Secret Rules of the Terminal" is finished! 95 beta readers have read it! the copy editor is done! technical review is done! the illustrator has made the cover! It's going to be out on **Tuesday June 24**"!)

20.06.2025 19:52 โ€” ๐Ÿ‘ 216    ๐Ÿ” 32    ๐Ÿ’ฌ 10    ๐Ÿ“Œ 1

I just lost like 2 hours debugging a *wild* bug that only showed up when running my tests in a specific way.

It was a combination of garbage collection and file descriptors being re-used, conspiring together to ruin my day.

20.06.2025 15:55 โ€” ๐Ÿ‘ 139    ๐Ÿ” 9    ๐Ÿ’ฌ 4    ๐Ÿ“Œ 1
Matthew Sackman (@hylomorphism@mastodon.me.uk) @b0rk@jvns.ca It's trailing space. If I add -t to xargs, I can see the filename is being 'quoted' and has a bunch of 'trailing '. So changing your sed to sed 's/ *|.*//' fixes it.

maybe the same issue as this person on mastodon? mastodon.me.uk/@hylomorphis...

18.06.2025 00:58 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

i think this fzf hack is interesting because fzf is a "search tool" but actually you can build lots of stuff with it (like "help me scroll through the files in a git commit") or "preview the results of a `jq` query I type in" that does not use its search features at all

17.06.2025 16:01 โ€” ๐Ÿ‘ 30    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0
View with files on the left and diff for that file on the right

View with files on the left and diff for that file on the right

I've still never gotten into `fzf` (and maybe I never will!) but I think it's really cool that you can use a fzf 1-liner to make things like this little UI for reviewing git commits

jvns.ca/til/fzf-prev...

17.06.2025 15:56 โ€” ๐Ÿ‘ 113    ๐Ÿ” 11    ๐Ÿ’ฌ 8    ๐Ÿ“Œ 1

@b0rk.jvns.ca is following 20 prominent accounts