>_ IzzyLab

Hands-on task

This task is step 3 of the course “First steps in Linux”

Set up a project layout

easy~4 min

You're starting a new project called shop. Create this tree of directories and files for it:

/root/shop/
├── src/
│   └── app/
│       └── main.py
├── docs/
│   └── README.md
└── logs/

src, app, docs and logs are directories; main.py and README.md are empty files.

What you'll practise:
  • mkdir
  • mkdir -p
  • touch
  • command flags

Topic breakdown

Most commands have flags (also called options or switches) — short words with a dash that change how the command behaves. For example, ls shows only names, while ls -l also shows size, permissions and date. Flags go after the command name, separated by a space.

mkdir creates a directory. Without flags it creates just one level: mkdir /tmp/a/b fails if there's no /tmp/a. The -p (parents) flag asks it to create every missing directory along the path.

touch creates an empty file, and for an existing one it just updates the modification time:

mkdir -p /tmp/demo/one/two
touch /tmp/demo/one/notes.txt /tmp/demo/one/two/list.txt

What's checked

  1. Project directories created
  2. main.py and README.md created in their directories

What it looks like