Sign in with
Sign up | Sign in
Your question

Need help with commands.

Tags:
  • Terminal
Last response: in Linux/Free BSD
Share
October 14, 2014 11:59:31 AM

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.

More about : commands

October 14, 2014 12:57:40 PM

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)
  1. touch ~/backup/{brown.cp,pink.pdf}
  2. mkdir ~/college/audio
  3. touch ~/college/audo/{orange.c,purple.html,red.ogg}
  4. touch ~/pictures/{blue.ogg,yellow.txt}


You can also do something like
  1. 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...
m
0
l
!