Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the function:

function >> file.txt

this creates the file.txt in my current directory. I have a folder log in the same directory, how would I request file.txt to be created in my log file (a directory higher)? I tried:

function >> log/file.txt

and am unsure why this didn't work for me

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

If the "same directory" you mention is up one directory, then use

function >> ../Log/file.txt

.. refers to up one directory, and . refers to the current directory. Read up on all this in a bash tutorial

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.