Pages - Menu

06 August 2011

Ubuntu File System - Explained

Here's a short overview for a complete beginner explaining everything about file system in Ubuntu and how to manage files and folders, hide them, see them from terminal, work with them etc in a Linux Ubuntu OS. For this guide I will use Ubuntu 10.10 which I think is the most successful Ubuntu release till date. This guide is aimed for users which are completely new and are unfamiliar with Ubuntu structure i.e Windows users.

Isn't it same as Windows?
Simple answer: yes and no!
The visual part here is quite similar to Windows. But Windows files are arranged inside drives. These drives are alphabetically named like C drive, E drive etc. (where mostly the system files are stored in your C drive) and you store all you files, photos and videos inside these directories. Well, its the same way in Ubuntu all the files are kept inside a single drive called "Filesystem" and no other drives, in case you can create one but its really unnecessary to do so. You can always store it in the basic Ubuntu files system.

First Some Basics
Lets first explore what we already have on a new Ubuntu machine.
Unlike you had My Computer in Windows, here you have to explore your files through the "Places" tab.
Lets take a closer look at the menu, your "Home Folder" is your main working folder, you can store all your music, images, videos or documents as well as you can see your downloaded files in Home Folder. All these pre-created folders are then listed below the Home Folder. By default the files you download with default browser Mozilla  Firefox are stored in Downloads folder. The "My Computer" in Windows is similar to "Computer" as you can see above, through which you can manage all your drives. You can see the Drive C and Drive E which are Windows drives because I am duel booting with Windows i.e I have Windows installed with Ubuntu on my computer and can access all my Windows files from here. Next there is Network which is for your LAN and the Connect to Server thingy is for FTP servers if you have any.

Try exploring each one of them and get familiar.
As you now know that you have Desktop, Documents, Music, Images, Videos etc inside your Home Folder lets find where this Home Folder is located. First open up your "Computer" in "Places" tab now you will discover a lot of files, all of these are Ubuntu's system files. Lets not fiddle with them for now. Just to learn where Home Folder comes from open the "Home" folder, it will have another folder with the name of your Username and there you will find your "Home Folder". These are the basic folders you must know.

The Complex Part - Using Terminal
Terminal is the place from where you can give commands to your Ubuntu, by default all the applications you use automatically give commands to the terminal and shows the result which saves your times for typing. But you can still learn to manually give commands to the shell which can always be useful.
You can open the basic terminal (don't do this now) by doing Ctrl + Alt + F3 and return back with Ctrl + Alt + F7 but there is also a terminal window by GNOME which can be opened by Applications > Accessories > Terminal.
On opening the terminal the first thing which you will see is a blank window with your username an @ symbol your computers name and a $ written - this $ means the terminal is ready to accept commands from you.
The default directory for terminal is your Home Folder, you can change this by using "cd" command

The "pwd" command
On opening the terminal the terminal has a working directory - now a working directory is the one which is used whenever you use a command like for opening a script, the terminal will search for that script in a directory which is called as working directory.
To see the current directory or working directory use the pwd command.





This shows my working directory is /home/bhavesh

The "ls" command
ls command lists all the current files and folders inside working directory



The "cd" command
cd stands for Change Directory, it is basically used to change the current working directory for terminal.
Now you know the folders and files inside your working directory. Now lets try to change our working directory by "cd ./Desktop" command.
You will get a ~/Desktop before your $ which means your current working directory is Desktop inside Home folder. You can check this my doing "ls" again.

Now What?
After reading this you now have a basic idea of how are files and folders arranged inside your Ubuntu FileSystem, you can learn more Shell Commands from here http://linuxcommand.org/lts0020.php < This website has all linux commands and explanation for file management.

No comments:

Post a Comment