I am programming in shell scripting, and would like to log results.

Is there any way to know what is the default path storage for logfiles in my operating system? I have researched:

set | grep "log" -i

but there is nothing that seems to be like a log path directory.


For any system that follows the Filesystem Hierarchy Standard this should be /var/log. I think this is safe to assume for most modern systems.

Note that this is for system processes (ie daemons etc), for user processes the common thing to do is just to create the log file as a hidden file in the user's home directory. Eg ~/.myscript.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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