0

I have tried this but it is not working

touch dir_practice ../cambridge/library/ 
touch dir_practice  ./sample_dir/cambridge/library/**** 

enter image description here

2
  • 3
    What does “it is not working” mean? Explain how you know something did not work, and what you expect instead. Commented Oct 13, 2020 at 4:48
  • 1
    Please, don't post images of text Commented Oct 13, 2020 at 6:46

1 Answer 1

3

If you look at the man page for touch, you'll see that it takes a filename as an argument. So what you need is:

touch ../cambridge/library/dir_practice

Since you're new to this, let's break this down. A relative pathname is a path specified relative to your current location. Contrast this with an absolute pathname, which starts from the root (/).

So you start at sample_dir/oxford. The first .. takes you back to the sample_dir directory. Then, you want to go to the library directory, which is inside the cambridge directory. Inside the library directory, you want to create the file named dir_practice.

Put all that together, and you get ../ + cambridge/library/ + dir_practice. Together, that's ../cambridge/library/dir_practice. This is the argument we pass to the touch command.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.