shio

~/shio.sh/learn/making-things $ ./read

chapter 04 · learn the terminal

Making things (mkdir, touch, echo)

mkdir makes a folder. touch makes an empty file. echo writes a line. Build a small world from three commands.

$ mkdir — make a folder

mkdir is short for "make directory." Give it a name and it creates an empty folder there.

try: mkdir notebook

Then ls to see it appear.

$ touch — make an empty file

touch creates an empty file with the name you give it. (If the file already exists, it just updates the timestamp — that's where the name comes from. For now, think "make.")

try: touch hello.txt

$ echo > file — write a line

Remember echo? Printing a sentence to the screen? The greater-than sign > redirects that printed output into a file instead.

echo "hello, world" > hello.txt

This creates hello.txt (or overwrites it) with one line: hello, world. Then you can cat hello.txt to confirm.

try: echo hello > hello.txt

The double-arrow >> works the same but appends instead of overwriting. We'll use it in the piping chapter.

$ what you can build

With mkdir, touch, and echo >, you can sketch out an entire project structure from the shell — folders, empty files, single-line configs. Many developers prefer it to clicking in a file manager. It's faster, and the steps are written down as you go.

~/shio.sh/learn/making-things $ cd ..