greetings and salutations thanks for
clicking on the video today we're going
to talk about the Linux file system this
is not a comprehensive video and
hopefully it will but not be very
technical this is just for anybody who
is curious about what is different with
the Linux UNIX file system compared to
like what you might be used to working
with in Windows or Macintosh or other
devices and it does have its
idiosyncrasies mainly because of the
fact that the Linux file system comes
from UNIX and unix-like that filled up a
whole room and had hundreds of users
attached to them and all sorts of
different storage all over the place and
tape drives and things like that
so we're using this system today on our
little laptops in our little desktops
that have maybe one or two hard drives
in them but we still get all the
functionality for these big gargantuan
systems of years ago and the first thing
that I guess we need to do is clear up
just a little bit of confusion we need
to define the word file system in the
sense that we're talking about it today
because there are two meanings to that
word file system can refer to the format
that you put on a hard drive the way the
hard drive itself actually stores files
and you'll hear people say well I had to
format the hard drive and install a new
file system in Windows
there are file systems like fat32 and
NTFS and Linux there are a number of
file systems the de-facto is ext4 but
there's ext3 and ext2 and JFS and XFS
and butter FS and many more to choose
from the average user though really
doesn't care about what file system is
being used on their hard drive as long
as it works and ext4 is one of the most
stable and best in the world so it's a
good de facto choice
today what we're talking about is a file
system in the sense of how an individual
computer organizes data where it stores
it and how it keeps up with where it is
so we're looking at a diagram here of a
basic file system for a Linux machine
and all of the different folders or
directories that appear if you're
working at a command line we call them
directories because the directory is
actually a file that holds a bunch of
addresses for other files in computer
science class they compared those two
file folders that held more files that
was the common way it was taught so
therefore when gooeys came along the
graphic user environments with file
managers directories were represented by
file folders so today we actually call
them folders they're interchangeable all
right so now that we have our
nomenclature all figured out let's get
into this oh we have another one here
that's a dual meaning to talk about and
that is the root of the filesystem
not to be confused with the root user
who is the one person on a linux or unix
system who has complete control over the
system okay in this case we're talking
about the root of the filesystem the
base the start the top the beginning and
it is represented by a single slash now
under here you'll see all of these
different directories and folders and
all this other stuff and the entire
computer is in here because in Linux and
UNIX everything is represented by a file
or a folder every device on your
computer is represented by a file or a
folder your hard drives your display
your keyboard your everything is
actually represented by a file or a
folder also you can have numerous hard
drives hooked up to a Linux computer and
you're going to notice immediately there
are no A's B's C's Indies in Windows you
can have more than one partition on one
physical drive and that
be put it you know is different drives
on the machine
ABCD whatever in Linux and UNIX what you
do is you mount that hard drive in a
folder somewhere an empty folder so it
could appear anywhere in the filesystem
and you could have as many hard drives
as you want it you can also take Network
shares and mount them to the filesystem
in different folders and that way
you don't care where the data is coming
from all you care is that you have
access to it
that's called a few skatin and it makes
sense when you have very complex systems
so let's actually take a look at some of
the folders that you will find on your
computer and to do that I'm going to
open up a actual file manager here in
this case since we're using a boom tube
it's called files or Nautilus is the
actual name of the program that does
this and we're in our home folder and we
see our typical folders and you see that
I've created some more folders in here
and if you want to see all of the files
that are on the system and a boon to you
have an entry down here it says computer
and now lets me see pretty much the same
thing that we're seeing here with a few
added things so let's go ahead and take
a look in here and talk about a few of
these folders I'm not going to get too
deep into this I'm just going to point
out some of the ones that are the more
important ones then stands for binary
this is where all of the programs live
on the machine or most of them the boot
folder is actually where all of the
files live that the kernel needs to boot
the machine and your boot loader lives
here as well that is a system folder you
don't have access to cd-rom is from the
early days of when you had cd-rom
devices on computers and this is where
somebody could find the cd-rom when they
plopped a CD into it this is now
basically just a legacy folder that's
left in here for compatibility because
your DVD drives and CD drives and
everything show up in the media folder
these days
dev is all of the devices on the
computer remember everything like your
keyboard your mouse whatever is
represented by a file or a folder so
this is where they are there's an
important folder which is etc' this
holds all sorts of configuration files
for the system and sometimes you
actually have to go in here and find a
file and change something in it and this
is ye Etsy is important also
it's the etc directory but people call
it Etsy or et Cie the home folder which
in this case is an example of a hard
drive that is mounted to the system all
of the stuff in the home folder actually
lives in a separate drive on this
particular system although you can't
tell by looking in the file system and
this is where all of the users files
live in their home directories ok and
this is where it comes up by default it
will open up when you open a file
manager and you're logged into your
account that's where you are when you
open a terminal you are automatically in
your home folder Lib and live 64 are
where libraries live they are like DLLs
in windows and it's basically
information that programs use on the
computer for programs can use the same
library so therefore they're stored
separately the media folder is very
important with the aboon to desktop and
gnome desktop and many of the other
modern linux desktops because here is
where when you plug in a USB Drive this
is where it's going to show up it's
going to automatically mount itself in
media anything that mounts and media oh
I didn't mean to do that
anything that mounts in media will show
up on your desktop or over here in your
- as a drive for instance I have a hard
drive that is on this machine that
automatically mounts its start up and it
shows up here and it's mounted in the
media directory get back to where it was
please thank you optional
opt directory is where some programs are
stored like for instance here we have
Google Chrome and TeamViewer which are
proprietary programs available for Linux
this is where a lot of those go and it's
just optional software of course the
temp directory is the same thing as TMP
stands for temporary and that's where
temporary files are stored usually that
directory is cleared out when you reboot
your system or you can use programs to
clean that out by the way everything
except the home folder here you have to
have administrator privileges to access
we're allowed to look but we can't touch
unless we actually have administrator
privileges to do so another important
folder is var this is where a lot of
logs and temporary files for the system
are stored this is variable data and
you'll find all kinds of stuff in here
like caches backups just all kinds of
stuff goes into the var directory some
administrators actually choose to put
that on a separate partition on the hard
drive as well
spen is more binaries usually used by
the system so here's where a lot of your
commands live the root folder remember
we have the root of the filesystem which
is represented by the flat slash and
then we have the root folder this is
where the root user's home directory is
so if you actually have a root user
account activated on your Linux system
this is where you would find all of the
root users stuff that would be in the
home directory this temp let's see
there's anything else in here to talk
about SRV universal system resources
sometimes things like icons for your
desktop or stored here all kinds of
crazy things that the desktop uses or
other programs use that can be used by
many different users on the computer end
up in there sometimes you'll hear
somebody say go look in the USR folder
the user some people
say that's the user folder it's not it's
Universal system resources so there's a
quick look around the file system mainly
you're going to be working in your home
folder that's where you're going to be
all the time unless you have to do
something else to the system you're
trying to customize it you're trying to
modify it or troubleshoot a problem
working in the file system is actually
quite easy and we're going to do this
with the GUI you can do all of this with
the terminal there are commands but I'm
not going to do any of it with a command
today to prove a point because one of
the common misconceptions about Linux is
is that all you got to open a terminal
all the time to do everything no you
don't I mean some things you do but some
things you have to do that in Windows
and Mac too so we're going to work here
in the terminal and I created a new
folder it says untitled folder at this
point and I'm going to give it a new
file name I'm going to give it something
creative like junk because we're just
going to create some files to play
around with and we'll open that up and
we have a nice empty folder to create
new files simply right-click and choose
new document and it will create an empty
file we're going to call this one test
and there you go now one of the
interesting things about the Linux file
system is that it is case sensitive in
other words a lower case T and an upper
case T are different so therefore I can
create a file that looks like this
and as you can see it pops right up it
exists I can keep that going let's
create another one this presents
problems when you're sharing files with
a Windows file system because the
Windows File system is not
case-sensitive
it doesn't really care now they do have
an extension that allows you to name
files with upper and lower case letters
so it shows up in the GUI and all that
other stuff but if you tried to send
these files to a Windows file system it
would get confused and it would do all
kinds of goofiness so keep this in mind
if you're creating files that will end
up on a Windows filesystem to rename a
file all we do is press f2 and then we
can do that we can also choose it from
the menu so we're going to call this one
test one and let's see we're going to
rename the file and this time around
I'll choose it from the menu to show you
that it does the same thing test two Oh
actually I'm going to rename that again
because I call it guest why didn't
anybody tell me I did that gee thank you
now we don't look like so much of an
idiot alright so we have our three files
another thing that you need to
understand about the Linux file system
is how it will actually hide a file so
if we go back into our home folder let's
go back into home here we see that we
have these folders but you may know that
all of your system settings and
everything about your particular account
live in this folder so where is it well
let me show you where it is if I use the
ctrl key and the letter H I am now
looking at hidden files in Linux
files are hidden by placing a dot in
front of the file name so if you want to
create a file and you don't want it to
be automatically seen this is how you
would do it so we have all of this stuff
in here
outside of the folders that we normally
see and these files contain
configuration files mainly so if I open
this and we take a look at it which is a
configuration file for a program called
asunder which is a CD music Ripper you
see this is where all of that
configuration is if you know what you're
doing you can edit this file and then
you can change the configuration without
using a GUI and sometimes that is a cool
way to do things also here's the picture
for my account that's here and let's see
what else is in here that we can look at
bash history is an important file we
will open that with let's do this with
actually I'm going to do it G edit thank
you that's a little bit lighter weight
and application and you can see here
this contains a list of all of the
commands that I have ever typed into the
terminal when I was working on the
computer so I have access to those and
in the terminal itself to access a list
of the commands that I have used then
all I do is use the arrow keys to go up
and there you go so that's where that is
stored so all of this information lives
in here so let's go back to our junk
folder and let's go ahead and hide the
file the first file here I'm going to f2
to change its name and we're going to
retype it with a I'll just call it dot
hide you have renamed the file
sometimes you have to do this twice to
get it to take and this is actually
something that's easier to do in the
terminal kind of like you have to do it
twice so the system knows that you
really mean it alright in a moment here
that file is just simply going to
disappear we won't see it because we
started it if I jump back out here and
then go back in you'll see well now it's
gone to see it again control H and there
is the file so this is how you would
create a hidden file or folder now samba
which is a program that allows you to
share files with Windows machines will
actually interpret this and it can I
don't know whether this is on by default
but if you put a file on your Windows
machine it will set the hidden attribute
so it tries to keep the different
attributes of the files the same which
can cause even more confusion so if
you're moving a hidden file over to a
Windows machine and you see it just
disappears that means that in Windows
the hidden attribute on the file was
actually set when Samba transferred it
over of course having all these
different file names that can have the
same text or the same capitals and mixed
cases in Linux does present a problem in
Windows as well I think I've already
mentioned that ok so we have learned
about what files are and how to name
them and of course everything else is
pretty straightforward if you're working
in the graphic user environment if you
want to move a file I'm going to put it
out on the desktop and drag it and then
there it goes and that sort of thing
that's all pretty simple and
straightforward now if we move a file
between two drives we might not know
because of the way that the Linux system
office gates the different partitions on
a hard drive are different physical
devices and if we move from one
partition to another we're going to copy
the file and not move it so if you do
that and you see that happen and you go
well the file thought I was moving it
then that's why in this case when I move
this file out to the
Desktop like this then we're actually
just moving it from one directory or
folder to another I will show you one
terminal command because it is extremely
useful and it's one that you can get a
lot of use out of if you're managing
files on the system and this is going to
be the one I'm going to hold myself to
and that is I'm going to show you the
touch command so let's first of all go
to the directory that we're playing
around in which is junk
this little Tildy here represents my
home directory so it lets me know that I
am in home so if I want to go back to
home I can always do CD and then a Tildy
like so and then it'll automatically
take me back to my home directory if you
want to know what director you're
working in present just type in present
working directory or print working
directory PWD and it'll tell you and it
tells me I'm in home so anyway and like
I said we can go back and get files get
commands by just doing that anyhow so
let me show you this command I'm in the
junk folder so we're going to use touch
to create a bunch of files and we'll
call it file1 file2 file 3l or ok so I'm
just going to create a whole bunch of
files and they showed up here now what
what good is the touch command well it
does the same thing as right-clicking
and choosing create empty document okay
so it'll create an empty file I don't
even know what to call this one at this
point
who cares but it will do it in batches
so that's kind of cool if you use the
touch command against a file that
already exists on the system then it
will change the modification date of
that file so that can be very useful
when you want to backup a whole
directory of files you want to make sure
that the backup program says ok this is
changed and I need to make a copy of it
that's how you can do it is using the
touch command the touch command can also
be used to create flag files which means
that it's a file with a certain name
that tells the system to do something
when the system sees it so it can be a
very useful little command and that's
the only one I'm going to show you
alright since we were creating files I
thought about it now the next thing we
need to talk about is file permissions
before we wrap this video up because
this is very important in Linux to get
through it to get to it through the GUI
we would go to properties out of the
drop down menu there and then we would
choose file permissions I created the
file so therefore I own the file I am
the owner I have since I am the owner
complete access I may read and write
this file people who are in my group my
group is called Joe if I should choose
to include other users on the system in
that group they will have access to the
file and they will be able to read and
write it as well others this is anybody
that can see the files on the system
they can only see it they can only read
it and in this case this means that they
can do nothing with it it's just that
they can see it now if this is a file
that contains private information and I
want to be the only person who actually
can see it then I can change these
permissions to none which means that I'm
the only person and if I'm so paranoid
that I myself don't even want to write
to the file I can change it to read-only
down here if this will allow me to
execute the file is a program which
means that when I click on it the system
will try and actually run the profile as
a program this is useful if you're
creating script files in other words you
are writing your own little programs to
tell the computer to do different things
you would create the file and then you
would give it executable status here and
when you did that that would mean that
if you ran it in a terminal or clicked
on it that it would actually run so
those are what the permissions mean you
can screw up the permissions in such a
way that you can give nobody access and
if that happens then you'll have to log
in as the super user to delete
everything that's in the system or all
of those files on everything that's in
the system why would you want to do that
and you just blew up the whole town man
nothing works now bang you have to
reinstall okay so about to wrap this
video up I think I think I've pretty
much covered all of the basic stuff here
and all of the differences between the
Linux file system and the other file
systems out there go ahead and make it
so we can't see the files and then we
are going to remove this directory and
get back to normal so I hope that was an
interesting introduction I know that I
have left a great deal of stuff out but
it gives you a basic idea of how the
Linux file system works and most of it
is the same as what you're dealing with
but there are some differences that
every now and then again you run across
you go huh what was that all about so
thank you for watching the video love to
hear from you
comments are always welcome and don't
forget to check out the link below to
easy Linux comm if you want me to help
you get started with Linux and get off
on the right foot and have a good
experience with the Linux system thanks
for watching