Need help with commands.

kkty5

Honorable
Jun 4, 2012
106
0
10,710
Hey, im doing a assignment for school and i never used terminal before. I need help making some files and paths. i have a examle.
├── a1.A
├── a1.B
├── a1.C
├── backup
│   ├── brown.cpp
│   └── logs
│   └── tmp
│   └── pink.pdf
├── college
│   ├── audio
│   │   ├── orange.c
│   │   ├── purple.html
│   │   └── red.ogg
│   ├── black.conf
│   ├── pictures
│   │   ├── blue.ogg
│   │   └── yellow.txt
│   └── projects
│   └── documents
│   ├── conf
│   ├── green.html
│   └── videos
└── white.log

that is what i need to have and this is what i already have.
├── a1.A
├── a1.B
├── a1.C
├── backups
│   └── logs
│   └── tmp
└── college
├── audio
├── pictures
└── projects
├── conf
├── documents
└── videos
i need to turn that into the first example using 4 commands. I cant use the cd comand.
Create an answer file called a1.C in ~/lnx155.a1, containing Unix commands which will
create a number of empty files using your assignment directory structure.
You must use relative pathnames and create the files while you are in the
"pictures" directory. Do not use the cd command in the a1.C file.
Accomplish this step with no more than 4 commands.

Similarly to the previous step, figure out the answers before creating the a1.C file.
Test your a1.C file by executing the script while in the "pictures" directory.
 
Solution
Kind of a silly instructions because you could make it all one command.
Here is 4 commands. Use the touch command (type 'man touch' in to your terminal to get the manual page)
Code:
touch ~/backup/{brown.cp,pink.pdf}
mkdir ~/college/audio
touch ~/college/audo/{orange.c,purple.html,red.ogg}
touch ~/pictures/{blue.ogg,yellow.txt}

You can also do something like
Code:
mkdir ~/college/audio & touch ~/backup/brown.cpp ~/pictures/blue.ogg ~/college/audio/orange.c
I'm sure from here you can figure out the rest...
Kind of a silly instructions because you could make it all one command.
Here is 4 commands. Use the touch command (type 'man touch' in to your terminal to get the manual page)
Code:
touch ~/backup/{brown.cp,pink.pdf}
mkdir ~/college/audio
touch ~/college/audo/{orange.c,purple.html,red.ogg}
touch ~/pictures/{blue.ogg,yellow.txt}

You can also do something like
Code:
mkdir ~/college/audio & touch ~/backup/brown.cpp ~/pictures/blue.ogg ~/college/audio/orange.c
I'm sure from here you can figure out the rest...
 
Solution