LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-22-2012, 03:42 PM   #1
jayfurrie
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Rep: Reputation: Disabled
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.
 
Old 10-22-2012, 03:59 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,870

Rep: Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783
(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.

Last edited by Didier Spaier; 10-22-2012 at 05:35 PM. Reason: As requested by unSpawn who told me that my initial post was unwarranted, inefficient and less than respectful.
 
1 members found this post helpful.
Old 10-22-2012, 06:07 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by Didier Spaier View Post
(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.
 
Old 10-22-2012, 06:33 PM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,870

Rep: Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783
Quote:
Originally Posted by theNbomr View Post
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.
 
Old 10-22-2012, 06:43 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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.
 
Old 10-22-2012, 08:00 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,195

Rep: Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562
Might not need the link, instead use direct paths in script if possible.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Box is attempting to scan and ssh into random machines using random usernames gianh Linux - Security 2 11-09-2008 06:42 PM
using /dev/random to output random numbers on a text file guguma Programming 4 04-02-2007 02:42 PM
KDE Random wallpaper or script to create symbolic links to random files cvelasquez Linux - Software 2 02-26-2007 07:48 PM
some questinos... mandrake 8.1 netdur Linux - Software 0 04-21-2003 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration