how do i make parent directory, sub dir, then files at once?

the book says to use mkdir and touch to create a directory called "Unix1b" within my home directory with the structure at the following



A book that i bought is saying to use mkdir and touch to create a directory called "Unix1b" within my home directory with the structure at the following

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Unix1b
`-- Unix1
    |-- admin
    |-- street
    |   |-- annex
    |   |-- building1
    |   `-- parking
    |-- faculty
    |-- history.exe
    |-- markham
    |   |-- outline.doc
    |   |-- programming
    |   |   `-- systems.pdf
    |   `-- security
    |-- course
    |   |-- gen_ed
    |   `-- lib_arts
    |       |-- english.txt
    |       `-- match.doc
    `-- mall
        |-- cafeteria
        |-- library
        `-- security
            |-- annex
            |-- building
            `-- parking

i did "mkdir -p Unix1b/Unix1"
then i do" cd Unix1"
username@matrix:~/Unix1> mkdir street
username@matrix:~/Unix1> mkdir admin
username@matrix:~/Unix1> cd street
username@matrix:~/Unix1/street> touch annex
username@matrix:~/Unix1/street> touch building1
now here is my question, what should i do for the for the parking in street directory.... what does that " `-- parking " mean?

am i even doing this right?

Last edited on
and whats with the history.exe ?
it shows green in the structure
Last edited on
showing green means that it has read/write/execute permissions for all users. So anyone can modify it.

You can change the permissions with chmod 755

http://ss64.com/bash/chmod.html
now here is my question, what should i do for the for the parking in street directory.... what does that " `-- parking " mean?


"`--parking" is no different than what you would do for building1 or annex. `-- is just how linux displays the directory/file at the end of the tree.
I guess pnoid answered your question then

mkdir -v Unix1b; cd Unix1b;
mkdir Unix1; cd Unix1;
mkdir -v admin street faculty markham course mall;
touch -c history.exe;
cd street; mkdir -v annex building1 parking;
cd ../markham; mkdir -v programming;
touch -c outline.doc; cd programming;
touch -c systems.pdf; cd ../../course;
mkdir -v gen_ed lib_arts; cd lib_arts;
touch -c english.txt match.doc; cd ../../mall;
mkdir -v cafeteria library security; cd security;
mkdir -v annex building parking; cd ../../../../


Copy and paste into terminal and hit enter
Last edited on
Topic archived. No new replies allowed.