ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have created a new system call for which i need to also create a command at user level so that i can use the terminal to execute the system call.But I am not sure what steps to follow for creating a command like,say 'reboot' of my own.Please give any suggestions regarding the same.
- Verify that /usr/local/bin or /usr/local/sbin are in your path; they should be.
- Perform "ls -l" of your /usr/local/bin or /usr/local/sbin directory where you intend to place the new command and see for yourself what the normal owners, groups, and permissions are. Be cautious that symbolic links will likely have different permissions and further many times symbolic links are pointing to a revision based executable in the same directory; for instance gimp on my system points to an executable for gimp-2.6 which are both in the /usr/bin directory.
You may ask "Why /usr/local versus /usr/bin or merely /bin?" The reason is more historic and conventions versus technical; however the historic convention was technical. On server based Unix systems, the partition /usr/local was truly local to the user and other partitions were server based. Therefore when you had a script or program to be shared with your team or the rest of your company or peers there were other partitions where you placed this shared data so that they could try it an the main system /bin or /usr/bin directories were controlled by the system administrator who would place your executable in those partitions if it was deemed to be acceptable, or if you weren't in their bad graces for some reason.
and put your program in any of the directories that are in that list (some will obviously be more "suitable" than others, such as /usr/local/bin or /home/user/bin, but any of them would technically work). Or you can put it anywhere you want and simply add the directory that it's in to your PATH by modifying your ~/.bashrc (or similar file for whatever shell you use).
Last edited by suicidaleggroll; 01-16-2013 at 03:00 PM.