Linux - NewbieThis 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
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by jan128
From technical point , not concerning "security" , what are cons and pros of selecting (C ++ ) project folder?
1. /home / user / PROJECTS / projectX...
2. /media / user / PROJECTS / projectX ...
There is a reason why you have your own "home" directory, it's because that's your place on the filesystem that YOU have full read/write permissions to. The /media directory is for mounting removable media, not storing personal projects.
I think you need to do your own research before asking your questions.
From technical point , not concerning "security" , what are cons and pros of selecting (C ++ ) project folder?
1. /home / user / PROJECTS / projectX...
2. /media / user / PROJECTS / projectX ...
And to add on to what jsbjsb001 said, you're asking a question that doesn't really have a good answer. The project itself, and the users, should determine where it goes.
If you have a program that you only want root/sudo users to use, /sbin or /usr/sbin may be the best location. General users system-wide? /usr/bin (or /usr/local/bin/, which is MY preference). If this is a project you're sharing and is related to removable devices...maybe /media is an ok place for it, but not one I'd use.
At the end of the day, this is YOUR system...you put things where you think they're best.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,818
Rep:
Quote:
Originally Posted by TB0ne
If you have a program that you only want root/sudo users to use, /sbin or /usr/sbin may be the best location.
Or, for those users with privileges, and assuming that /usr/local/is already a separate filesystem: /usr/local/sbin. The project can then survive distribution changes, re-installs, etc.
From technical point , not concerning "security" , what are cons and pros of selecting (C ++ ) project folder?
1. /home / user / PROJECTS / projectX...
2. /media / user / PROJECTS / projectX ...
You might want to look at the official guide for file system structure on linux.
With that said, the source directory where you are creating a project needs to be where you (and any other developers) can access it and create/modify files. Other users not involved in the development normally should not have access.
Once the project is complete and the binary has been compiled and is ready to use then it gets installed where the users can access and execute it.
Please try
echo $HOME
You see folder name. It is a good place for all your project, because all permission are for you!
And this doesn't address the OP's original question; read the thread and replies already given. computersavvy has given the 'best practices' answer to this already.
Perhaps my expectations are too high.
( See I can blame myself so you experts are happier).
1. Even when I say "excluding security" I get suggestion about "accessibility by other (developers) ".
2. Reason I asked because I like to SEPARATE OS from my stuff - preferably in hardware - hence
"media".
Since the prevailing groups opinions are - it is up to me to choose , IMHO no reasonable reply was given.
In closing - thanks for participating - I shall refrain from bothering everybody by asking questions "I should have researched before asking here" .
I shall go back to Mrs Google - she is little more patient and understanding.
She actually reads and answers questions.
Now, if there are others you want to share your work with then indeed you need to create a shared location and preferably create a new system group for users to have full access rights to it. You know best what location that might be, local or remote.
Perhaps my expectations are too high.
( See I can blame myself so you experts are happier).
1. Even when I say "excluding security" I get suggestion about "accessibility by other (developers) ".
2. Reason I asked because I like to SEPARATE OS from my stuff - preferably in hardware - hence
"media".
Since the prevailing groups opinions are - it is up to me to choose , IMHO no reasonable reply was given.
No one can give you a definitive answer.
1. We don't know if you are working on a home machine or work machine.
2. We don't know what your preferences are.
3. Your post does not give us anything except a very general field to base the answers on.
Code:
From technical point , not concerning "security" , what are cons and pros of selecting (C ++ ) project folder?
1. /home / user / PROJECTS / projectX...
2. /media / user / PROJECTS / projectX ...
4. Without more response from you defining your concerns and making this a 2-way conversation all of us are left just stabbing in the dark and we cannot provide anything more than factors for you to use in making your own decision.
5. Placing stuff under your $HOME directory does separate it from the OS. Placing it on a removable media does separate it from the OS. Your choice. (although if you read the responses, every one also did the same thing)
Good luck with google and your "ask a general question and get a specific answer" expectations. Google often gives millions of possible answers that you have to sort through for relevance.
Last edited by computersavvy; 02-01-2021 at 10:12 AM.
Perhaps my expectations are too high.
( See I can blame myself so you experts are happier).
1. Even when I say "excluding security" I get suggestion about "accessibility by other (developers) ".
2. Reason I asked because I like to SEPARATE OS from my stuff - preferably in hardware - hence
"media".
Since the prevailing groups opinions are - it is up to me to choose , IMHO no reasonable reply was given.
In closing - thanks for participating - I shall refrain from bothering everybody by asking questions "I should have researched before asking here" .
I shall go back to Mrs Google - she is little more patient and understanding. She actually reads and answers questions.
If you just want to whine, good luck getting answers anywhere.
And the reason you got what you got, is because there IS no way to answer your question. You were not only given suggestions (with explanations), but also directed to the best-practices guide for Linux file system structures. What more, exactly, would you like? This is YOUR SYSTEM...you do what YOU WANT on it, period. You give us no details about the app (which has bearing on the best place to install it), etc. And saying 'hence, media" means nothing to us...because WE DO NOT KNOW how your system is laid out, do we? We don't know if /media is its own 45TB SAN mount, or a folder on a thumbdrive, do we? You sure didn't tell us.
Again: /usr/local/bin (or /usr/local/sbin) are typically used...if you want more than one person to use it, those are good locations which typically don't get overwritten by updates, and is a convenient location to store programs for easy backup. We AGAIN don't know your path, so if you have your development directory in your path, then use it if you want.
And this doesn't address the OP's original question; read the thread and replies already given. computersavvy has given the 'best practices' answer to this already.
But is true! you can use every folder in user $HOME, it is all the same good! Permission is the most important.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,818
Rep:
Quote:
Originally Posted by computersavvy
Placing it on a removable media does separate it from the OS. Your choice.
Not sure the OP will see this now that they've left to search Google for an answer: Placing a "project" on removable media and mounting it on "/media" may introduce additional handcuffs that may eventually become a problem. Unless you wipe it and build a Linux-native filesystem on it, most removable media is formatted as VFAT which prevents some normal filesystem features from being used---symlinks being one of more obvious ones.
OP: Don't go away mad. I cannot imagine that another forum that you find on Google will find the question, as you initially presented it here, to be any easier to answer. Including more information when posting a question is better than leaving things out in favor of brevity. And there may be a lot of ways to skin the cat so, in many cases, opinions/personal preferences are going to be the majority or the replies you receive.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.