1

What is the most appropriate folder to store both scripts and their output (some txt files) on linux os? The scripts and their directory need to have 755 permission.

Is there an appropriate directory, that already exists, for that purpose or where should I create one?

Timur Shtatland
  • 12,024
  • 2
  • 30
  • 47
Taserface
  • 93
  • 2
  • 13
  • 1
    Often, users store scripts in their personal `~/bin` directory. I wouldn't store their output there though. Create some other directory of your choosing for output, e.g. `~/output`. – costaparas Jan 13 '21 at 11:12
  • 1
    /usr/local is another option. This way you can put your scripts in /usr/local/appname/bin and your output in /usr/local/appname/log – Raman Sailopal Jan 13 '21 at 11:33

2 Answers2

0

The typical directory for the scripts is ~/bin, which needs to be created. Do not mix scripts and output! The output files should be stored separately, in directories named according to the naming convention that suits your work best. Often, these directories are named per project, and there is more than one such directory. The directories can be named, for example, ~/prj_name/in and ~/prj_name/out for input and output, respectively. But there is no convention for those.

Timur Shtatland
  • 12,024
  • 2
  • 30
  • 47
0

$HOME/.local/share is the right place for data according to the XDG Base Directory Specification:

$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

I've also seen ~/.local/bin used for binaries by homebrew. I'm not sure if this is defined in a spec anywhere.

chicks
  • 2,393
  • 3
  • 24
  • 40