LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I would like a file system tutorial (https://www.linuxquestions.org/questions/linux-newbie-8/i-would-like-a-file-system-tutorial-4175508429/)

009jim 06-18-2014 05:02 PM

I would like a file system tutorial
 
Gents, I played with Ubuntu about 5 years ago and still use it intermittently as the OS on my spare PC when I am solving hardware problems on my main windows PC. Lately I have a new (2nd hand) PC that I am readying to replace my main PC. I'm liking the idea of using Zorin and permanently leaving windows. However, it's often said that "the linux file system is completely different to windows" This I found true when I used Ubuntu. I was confused when I tried to do something simple like locating a file and copying to a place where I knew I could find it. With windows, most things end up in "my documents" and you can have sub-folders like "my family photos" etc. I need to be able to do something logical like this with my linux OS. What I would like is a tutorial on the linux / unbuntu / zorin file system. Please help.

bigrigdriver 06-18-2014 06:38 PM

Here is a general overview of the Linux file system.

The types of files you are concerned about are personal files which go into your /home/<your user name> directory.

Hint: learn how to use a web browser and a search engine such as google. The great majority of questions you may have are probably answered somewhere on the web. You can probably find answers faster by searching for them than by posting on a board and waiting for an answer. This should hold true unless you are using bleeding edge hardware or software specific to windows or mac os.

frankbell 06-18-2014 07:17 PM

I've also sort of liked this site's explanation.

http://www.thegeekstuff.com/2010/09/...tem-structure/

mreff555 06-18-2014 08:48 PM

While I agree with bigrigdriver, that most of the question can be found by a search on the internet. The whole point of this site is to help new people, and this question may be difficult to find exactly, so let me see if I can help.
The linux filesystem has a VERY different structure than windows. Once you get to know it, you will love it. It is much more organized and there is much less redundancy.
Let me give a quick analogy. You bought a house and decide it's time to get tools to work on your house. When it comes time to organize your tools you decide there are two ways you can do it. Make a bucket for every job, so every tool you need for one type of repair goes in a bucket. Convienient, but lot of redundancy, and sometimes you just need a friggin screwdriver!! This is analagous to windows. Linux on the other hand would be a methodically organized toolbox. Wrenches in one drawer, screwdrivers in another.

The root filesystem looks pretty similar on most linux systems. You may see more stuff, but the directories you are going to see off of the root directory for sure are these.

/home This is equivlent to c:\users\ in windows. All the users will have a directory within this directory. In your particular directory you may find a setup that looks similar to windows, such as a documents and pictures directory. However this is distro dependant.

/bin and /sbin
Like I tried to explain in my analogy above, linux doesn't mix file types. Every file in these directories is executable. There are other directories, not off of root like this as well such as /usr/bin. There is no good comparison to a windows directory since windows compartmentalizes it's programs. The closest example might be the c:\windows\system32 directory. Just remember that /bin directories usually contain files that everyone can execute, while /sbin directories are generally reserved for administrative programs.

/etc Back in the day, before Windows XP and the windows registry, config files were grouped with all the other files associated what that program. It was confusing, and the registry was considered a huge accomplishment. Of course the registry is an administrative nightmare, but they were trying. On linux, all the config files are kept in /etc

/var var stands for variable. Things that change a lot go here. Logs, mail, etc. On easy to use systems there is not a whole lot of need to mess with /var because services control most of the actions here.

/dev ok, here is where it gets a little confusing. Everything in linux is a file. /dev contains representations of every device on your system in the form of a file. Your system memory, /dev/mem. Your clock, /dev/rtc. Your first hard drive, /dev/sda. The first partition on your first hard drive /dev/sda1. Given enough time playing with linux, you'll figure out what to do with these.

/mnt and possibly /media When you insert a CD or jump drive into a windows machine, Windows automaticlly mounts it and assigns it a letter. Newer versions of linux do the same thing, only it's not a letter, but a directory, generally off of /media.
If you have a more simplistic linux system. or if you just prefer doing it manually, you can mount and unmount filesystems manually by specifying the device and the location you want to mount it. For example:
[code]
mount /dev/sdc1 /mnt
[\code]
This command would mount the first partition of the third drive at /mnt.

/sys sorta similar to /dev, but not really. Again it is actual devices however, rather than actual mountable block files it's more like volitile memory of devices (can someone explain this better?) You can do a lot of really cool things or totally f**k your system by playing in this directory.

/proc files that represent actual processes currently happening on your system. The best way to understand is to look at some for yourself. For example, check out /proc/cpuinfo

/lib Library files. equivlent to dll's in windows. Difficult to explain if you are not a programmer. If you want a better understanding read about "static and dynamic libraries" You may want to read about "includes" as well since you will see directories in linux dedicated to these as well.

/boot contains the kernel. (this you can google, I'm not explaining the kernel here)

/tmp This is a directory which everyone should have access to. It's reserved work space which is purged quite often.


/usr If you look around in /usr you find a filesystem with a lot of similar directories to the root directory. Such as /usr/bin, and possibly /usr/sbin. The idea is this. Core components of the system are installed off of the root directory. Programs like games, web browsers, office suites, are installed in /usr

/opt Everybody has a different opinion about this one. It stands for optional. I use it for programs which were slopily ported from windows to linux and don't follow the linux structure.
/root This is actually the home directory for the root user

There will be more directories on newer systems like /run which deals with services. but that should get you started for now

onebuck 06-19-2014 08:02 AM

Member Response
 
Hi,

Welcome to LQ!
Quote:

Originally Posted by 009jim (Post 5190208)
Gents, I played with Ubuntu about 5 years ago and still use it intermittently as the OS on my spare PC when I am solving hardware problems on my main windows PC. Lately I have a new (2nd hand) PC that I am readying to replace my main PC. I'm liking the idea of using Zorin and permanently leaving windows. However, it's often said that "the linux file system is completely different to windows" This I found true when I used Ubuntu. I was confused when I tried to do something simple like locating a file and copying to a place where I knew I could find it. With windows, most things end up in "my documents" and you can have sub-folders like "my family photos" etc. I need to be able to do something logical like this with my linux OS. What I would like is a tutorial on the linux / unbuntu / zorin file system. Please help.

You can look at the links within: Linux File System
Hope this helps.
Have fun!
:hattip:


All times are GMT -5. The time now is 01:54 PM.