Wednesday, November 17, 2010

What is the answer to this question in Unix?

Now suppose that you'd like to create an empty file called ';bar'; in

your new ';foo'; directory. You're still connected to your home

directory. How can you do this without changing directories?What is the answer to this question in Unix?
touch foo/barWhat is the answer to this question in Unix?
cd;mkdir foo; touch foo/bar





The ';cd'; sends you to your home directory

mkdir foo; creates the foo directory



touch foo/bar makes the empty file bar in the directory foo.



Alternatively, if you DON'T want to change back to your $HOME,



mkdir $HOME/foo; touch $HOME/foo/bar;

No comments:

Post a Comment