LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Some random linux questinos (https://www.linuxquestions.org/questions/linux-newbie-8/some-random-linux-questinos-4175433550/)

jayfurrie 10-22-2012 02:42 PM

Some random linux questinos
 
hey guys,

i tried googling how to create a link in /usr/local/bin for a shell script in another directory. the ultimate goal of this is to make a proper manpage that exaplains the output of a quote check. my google search didnt' yeild anything. furthermore, i don't know how to use quota or how to understand the manpage either. i'm supposed to set a soft quota of 8 files and a hard quota of 10 files on a directory owned by a certain group, i understand what the soft and hard quotas mean but i don't know how to set # of file limits on a directory.

Didier Spaier 10-22-2012 02:59 PM

(1) Let's suppose your script is /home/user/bin/myscript.sh You could do this:
Code:

ln -s /home/user/bin/myscript.sh /usr/local/bin/
(2) Basically quota can be set at the file system level, not at the directory level. So you should set up a partition with a specific file system including only one directory in it. If you do not want to repartition your hard disk to do that you can use this trick proposed by Colucix which mount a virtual file system on an empty directory.

theNbomr 10-22-2012 05:07 PM

Quote:

Originally Posted by Didier Spaier (Post 4812441)
(1) Let's suppose your script is /home/user/bin/myscript.sh You could do this:
Code:

ln -s /home/user/bin/myscript.sh /usr/local/bin/

That will create a link, and the link will be in /usr/local/bin, but it will not point to the script in question. A better way is to run ln -s while the current working directory is the directory in which you want the link to exist.
Code:

cd /usr/local/bin
ln -s /home/user/bin/myscript.sh [optional_link_name]

Now, if /usr/local/bin is in $PATH (and it usually is), it can be executed by simply typing
Code:

myscript.sh
--- rod.

Didier Spaier 10-22-2012 05:33 PM

Quote:

Originally Posted by theNbomr (Post 4812541)
That will create a link, and the link will be in /usr/local/bin, but it will not point to the script in question.

It will, I just tried again. Only caveat: /usr/local/bin should be an existing directory, otherwise the command will create a link called "bin" in /usr/local.

chrism01 10-22-2012 05:43 PM

Chap 7 here http://www.linuxtopia.org/online_boo...ion/index.html is a good run through on quotas and how to set them up.

jefro 10-22-2012 07:00 PM

Might not need the link, instead use direct paths in script if possible.


All times are GMT -5. The time now is 07:17 AM.