0

I'm sorry for the silly question.

I'm using Ubuntu on a Vagrant VM and wanted to create a custom folder to hold some random files. Where is the "best" place to do so? Is it `/usr/'?

In Windows, for example, you can create folders in the Desktop, in the Documents folder, ... but not in Program Files or in Windows32 for example.

ahmed
  • 137
  • 2
    You should create your custom folders in your Home folder. Other places are system directories, like Program files, etc. – Pilot6 Dec 05 '15 at 17:21
  • 1
    Depends on the purpose, but /usr seems not appropriate. It stands for unix system resources, which has nothing to do with "user". Use your home directory instead (/home/yourname). – Jacob Vlijm Dec 05 '15 at 17:21

2 Answers2

3

It depends on why you want the custom folder.

If it is for personal use, create it in your home directory (and thing of that as the windows equivalent of %userprofile%).

If you want shared folder (e.g. a music collection for all memeber of the family, all with their own accounts) then user /usr/local/.

If you want to share the folders between your VM and the host OS, then you have two choices:

  1. Create them in the VM (in /usr/local/my_secial_folder_name_here/) and share that with the rest of the network. (E.g. NFS, samba, ...)
  2. Or create them on the host OS and use the hypervisors option to share that folder with the VM.

All options will work. But the 'right' option really depends on your goal.

Hennes
  • 1,233
  • Thanks, that what was useful! Sorry I can't upvote your answer; not enough reputation for me :/ – ahmed Dec 05 '15 at 17:54
  • You got it all right with the exception of /usr/local. /usr/local is used to store files that are maintained only on that specific machine and may conflict when put in /usr (which is where most sysadmins do their stuff). – Ashhar Hasan Dec 06 '15 at 03:58
  • Aye. Hence the local part in the name. If the OP uses multiple VMs and all share the same custom folder with eachother then this is indeed not the right place. I read the question as 'I have one host and one guest, and I want to share between these'. But the other interpretation is equally valid. – Hennes Dec 06 '15 at 12:58
2

Ubuntu has Desktop, Documents, Pictures, Downloads, Videos,and Music folders as well. So you can keep random files there.

If it's going to be custom scripts, custom executable binaries, program source code, it's a good practice to create $HOME/bin folder.

If you want to have shared folder between your VM and Windows, that's also possible to set up. Consult VirtualBox/SharedFolders for that

Consult How to add a directory to my path? if you want to run scripts in your personal bin folder from anywhere on the system.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497