I was a Windows user and am new in Linux environment. I just installed Ubuntu two days ago and I am confused about the directories such as lib
, etc
, var
, tmp
, mnt
, etc. I've few questions.
- What is the purpose of these directories?
Currently I keep my project files in /home/shifar/Public/Projects
,
but that sounds too long...
Is there any way to shorten the file path?
Is it good to keep my project files in the above mentioned directory? Or is there any convention? Like Personal files must be stored there. and Software is better stored in there..
Instead of call
/home/shifar
you can use~/
/home/shifar
is your home dir and dedicated for your personal uses. You can store your personal dirs, files in any dirs in it.~/Documents
may be a good place for Projects.~/Public
is normally shared to anyone in the network. So if you do not want to share, put your files in another dirs instead.The previous answers are all good. I would just add a few points.
Later, (not now!) when you're more comfortable with Linux, you may want to create a separate partition for data - especially if you have big files like lots of music or video. If you add too many of these to your home partition, you can fill it up and then other things stop working because they can't get the disk space they need.
If you fill up a data partition, it doesn't affect anything else.
Also, when you want to backup your data, you can just do it any time. /home has things which change all the time, so you can't normally "freeze" it to get a copy where everything is in sync. With a separate data partition, you can make a perfect backup any time.
As far as paths go, if you are working from the command line, you can define a bash alias (in
~/.bashrc
or in~/.bash_aliases
) to shorten any path or even to change into the directory.alias proj='cd /home/shifar/Public/Projects'
and then just type
proj
to switch to that directory.When you get more comfortable with bash, you can do even more with functions. But, we'll leave that till later.
Another approach would be to add a line to
~/.bashrc
likeThat would make an environment variable
PROJ
available for use and you could do things like:It will also work without the
export
in front of it, but then it would only be defined at the top level of your shell, not in any subshell you might run from there.You don't strictly need the quotes or braces in the example above either, but they protect you from things like embedded blanks and also allow you to use
PROJ
as part of a word - like${PROJ}ect
.Ubuntu is just like your own conventional Windows. Only it is a different operating system. I am not sure what version of Ubuntu you are using. Regardless of that, Linux Environments including Ubuntu all offer a very user friendly GUI just like that of windows which shouldn't be difficult to understand for someone who is used to windows. If you're not comfortable with the terminal, you can always just use the GUI and access your files and folders from there.
As far as where you should keep them, again, it's your own desktop. It's just a different system. It is exactly the same as windows. Just store them where you would store them in windows.
The file path can be shortened. You are currently in Projects. You can move up the tree and store your files in, let's say "home" folder. It's all up to you. But it is generally a good idea to keep personal files inside your username, that is "shifar" in this case.
The "/" indicates the root directory. It contains "home", which contains "Shifar" and so on. They are solely for keeping data classified and organized. A directory is what you would call a folder on your windows.
Hope this helps.
The files are personal as in you don't want other people looking at them, your home directory is a good choice, but you should also understand file permissions -- not directly on point to your question, but relevant. You should set your permssions as restrictive as possible, as permissive as necessary. Also, if you're concerned about privacy and security, Ubuntu provides a way to encrypt only your home directory, so you can keep your sensitive data quite secure. It's somewhat technical (https://help.ubuntu.com/community/EncryptedHome).
My usual practice is to encrypt/decrypt sensitive data files one-by-one using gpg -- https://help.ubuntu.com/community/GnuPrivacyGuardHowto. This is also kind of technical but really important and worth your effort.
I've never felt much compulsion to use the subdirectories in my homedir that Ubuntu installs. You're free to organize your data as you see fit.