Where should I keep my personal files while keeping the pathname short?
What is the purpose of these directories?
- lib: kernel modules and those shared library images (the C programming code library) needed to boot the system and run the commands in the root filesystem
- etc: configuration files
- var: files to which the system writes data during the course of its operation
- tmp: temporary files
- mnt: the temporary mount points for mounting storage devices
Is there any way to shorten the file path ?
Instead of call /home/shifar
you can use ~/
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... Softwares is better stored in there... like that.
/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
like
export PROJ='/home/shifar/Public/Projects'
That would make an environment variable PROJ
available for use and you could do things like:
ls "${PROJ}"
cd "${PROJ}"
cp mynewfile "${PROJ}"
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.