<p>In the linux file system, where should user scripts be placed?</p>

<p>I'm thinking specifically python scripts to be called by cron.</p>

[{'answer_id': 15177, 'author': 'Matt McMinn', 'author_id': 1322, 'author_profile': 'https://Stackoverflow.com/users/1322', 'pm_score': 4, 'selected': False, 'text': "<p>If you're talking about scripts created by a user that will be run from that users crontab, I typically put those in either a bin or scripts folder in the home directory, or if they're intended to be shared between users, a /usr/local/scripts directory.</p>\n"}, {'answer_id': 15189, 'author': 'icco', 'author_id': 1063, 'author_profile': 'https://Stackoverflow.com/users/1063', 'pm_score': 2, 'selected': False, 'text': "<p>I'm a strong beleiver that if a file is made by a user, it goes in his user directory (/home/username) if he didn't make it then it gets more complicated. I have in the past just put them in either /usr/local/bin, /bin, or /usr/local/scripts, I'm not sure about etch, but you need to check to make sure that /usr/local/scripts is actually in Cron's $PATH.</p>\n"}, {'answer_id': 15194, 'author': 'Judge Maygarden', 'author_id': 1491, 'author_profile': 'https://Stackoverflow.com/users/1491', 'pm_score': 0, 'selected': False, 'text': '<p>You can also add paths to your crontab file as shown in a <a href="https://stackoverflow.com/questions/13204/why-doesnt-my-cron-job-work-properly#13220">previous cron-related question</a>.</p>\n'}, {'answer_id': 15374, 'author': 'Peter Stuifzand', 'author_id': 1633, 'author_profile': 'https://Stackoverflow.com/users/1633', 'pm_score': 2, 'selected': False, 'text': '<p>How about /home/username/bin?</p>\n\n<p>Add ~/bin to $PATH and make the script executable with chmod +x filename.</p>\n'}, {'answer_id': 15476, 'author': 'Mo.', 'author_id': 1870, 'author_profile': 'https://Stackoverflow.com/users/1870', 'pm_score': 2, 'selected': False, 'text': '<p>personally I prefer</p>\n\n<pre><code>/home/username/.bin\n</code></pre>\n\n<p>This way the bin folder is hidden but you can still add it to the PATH and execute all scripts with the x-bit inside.</p>\n\n<p>I like my home directory to be clean (at first glance) with very few folders.</p>\n'}, {'answer_id': 35327, 'author': 'flight', 'author_id': 3377, 'author_profile': 'https://Stackoverflow.com/users/3377', 'pm_score': 3, 'selected': False, 'text': '<p>For whom it interests, the <a href="http://www.pathname.com/fhs/" rel="noreferrer">Filesystem Hierarchy Standard (FHS)</a> is a standards document and still a very good read. I describes the foundation for almost any Linux distribution and is officially endorsed e.g. by <a href="http://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html" rel="noreferrer">Debian</a> and the Linux Standards Base (LSB).</p>\n\n<p>You won\'t find any positive answer for that question, though, since ... it\'s not defined ;-). Only thing I can say: Don\'t put in /bin (neither in /usr/bin). /usr/local/scripts is unusual as well. $HOME/bin seems to be an acceptable place, iff the script is only used by this single user.</p>\n'}, {'answer_id': 1759292, 'author': 'pete', 'author_id': 214121, 'author_profile': 'https://Stackoverflow.com/users/214121', 'pm_score': 2, 'selected': False, 'text': '<p>The <a href="http://www.debian.org/doc/maint-guide/ch-modify.en.html" rel="nofollow noreferrer">Debian guide</a> can be quite useful when it comes to Ubuntu:</p>\n\n<blockquote>\n  <p>Normally, programs install themselves in the /usr/local subdirectories. But, Debian packages must not use that directory, since it is reserved for system administrator\'s (or user\'s) private use</p>\n</blockquote>\n\n<p><code>/usr/local/bin</code> seems to be acceptable according to the guide.</p>\n\n<p>Personally I put my scripts in <code>$HOME/.scripts</code>.</p>\n\n<p>I wish that LSB would specifically address this question though.</p>\n'}, {'answer_id': 7989517, 'author': 'c33s', 'author_id': 590247, 'author_profile': 'https://Stackoverflow.com/users/590247', 'pm_score': 6, 'selected': True, 'text': "<p>the  information i got:</p>\n\n<pre><code>/usr/local/sbin     custom script meant for root\n/usr/local/bin      custom script meant for all users including non-root\n</code></pre>\n\n<p>chatlog snips from irc.debian.org #debian:</p>\n\n<pre><code>(02:48:49) c33s: question: where is the _correct_ location, to put custom scripts\nfor the root user (like a script on a webserver for createing everything needed \nfor a new webuser)? is it /bin, /usr/local/bin,...? /usr/local/scripts is \nmentioned in (*link to this page*)\n(02:49:15) Hydroxide: c33s: typically /usr/local/sbin\n(02:49:27) Hydroxide: c33s: no idea what /usr/local/scripts would be\n(02:49:32) Hydroxide: it's nonstandard\n(02:49:53) Hydroxide: if it's a custom script meant for all users including \nnon-root, then /usr/local/bin\n(02:52:43) Hydroxide: c33s: Debian follows the Filesystem Hierarchy Standard, \nwith a very small number of exceptions, which is online in several formats at \nhttp://www.pathname.com/fhs/ (also linked from http://www.debian.org/devel/ and \nseparately online at http://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html)\n(02:53:03) Hydroxide: c33s: if you have the debian-policy package installed, it's \nalso in several formats at /usr/share/doc/debian-policy/fhs/ on your system\n(02:53:37) Hydroxide: c33s: most linux distributions follow that standard, though \nusually less strictly and with more deviations than Debian.\n</code></pre>\n\n<p>thanks go out to Hydroxide</p>\n"}]
['https://Stackoverflow.com/questions/15171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/479/']