Tag Info

New answers tagged

3

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


1

If the program is installed by a system administrator, and it's ok if the data is erased now and then, create a directory under /var/cache. Files under /var/cache can be deleted by the system administrator at any time, but normally aren't unless the system is running out of disk space. Managing /var/cache/YOUR-DIRECTORY so that it doesn't grow out of control ...


2

There's also /run, but the convention seems to be that while /tmp is world writable, /run requires root privileges. /var has similar restrictions. So your best bet is either /tmp, or something you arrange via configuration (so that the user can specify a runtime directory). WRT to naming conventions, it appears to be a free-for-all global space -- use ...


6

You need to quote it to protect it from shell expansion. ls ~ # list your home directory ls "~" # list the directory named ~ ls \~ # list the directory named ~ Same thing with rm, rmdir, etc. The shell changes ~ to /home/greg before passing it to the commands, unless you quote or escape it. You can see this with echo: anthony@Zia:~$ echo ~ ...


15

This change was introduced by BSD after 1985 (BSD 4.2 was still documenting /usr) and in or before 1988 (BSD 4.3/SunOS 4.1 hier(7) manual page already documents /home). It was quickly followed by Solaris 2.0 (which kind of merged System V and BSD) and was later adopted by most other Unix vendors. This is from the Solaris 2.0 useradd manual page: -D ...



Top 50 recent answers are included