Each file or directory in Linux has detailed information or an operating system language properties
associated with each file or directory.
In this video we are going to look at Linux file or directory properties.
Now what are the properties?
Let's look at the example of our windows.
So to understand what properties are we talking about?
So in Windows we have this folder.
How do we know it's a folder?
Because it looks like a folder, right?
In Linux, you're not going to be able to tell if it's a folder or not.
So if you go inside of this folder by double clicking it and there is another folder called Data.
Now when you do right click on this data folder and go to properties, you will see all that information
associated with this folder.
It tells you it's a type, it's a file folder.
Where is it located?
The size who created it when created it, sharing security information, who owns it.
Previous version.
Customize all those information that is associated with the folder data.
Same way if you go inside of the data, you see there are two more files.
How can I tell these files?
Because it doesn't have the shape of a folder.
So it's so easy to tell in windows.
So you right click and you do properties, you find the same information, the location, the name,
it's a text file, it's a notepad, zero size because nothing in there when it was created, when it
was modified and so on.
So much information, all these and associated information to a file or a directory.
It's called It's Properties.
That's what this whole lesson or this whole video is about.
Now in Linux, when you run the command LS minus L, you get these list of columns.
Now on the very right, you'll see the name and a directory of a file or of course the name of the directory.
Now each directory or a file has all these associated properties to it.
The very first column tells you that type of file.
Now, anything that has starts with D, it means it's a directory.
Now, as I was telling you, when you are in Windows Environment, you could tell that it's a directory
by looking at its image.
Right?
It looks like a folder.
So but in Linux you cannot tell.
Then the only way to tell if it's a directory, if it has this D in front of it, then you could tell
are the bar is a directory.
Similarly, if you see anything in the type column which is the first column, it starts with L, it
means it's a link.
The bin file is a link to another file, and when it comes down to the third one where it starts with
nothing here, then it means it's just a regular text file and this is the name of that regular file.
There are many different file types and Linux which by the way I will cover later on and it is included
in this course.
But for now I'm just going over the properties of a file or a directory.
Now I'll come down to the second column.
Second column is the number of hard links to the file for a directory.
The number of hard links is the number of immediate subdirectories it has, plus its parent directory
and itself.
So all the directories that it has and its parent directory is combining all of that.
It tells you the number here.
But if we want to know more about links, links is another topic, another video that I'm covering later
on.
Now, the third column, third column tells you who owns this file or directory right here.
Tells you root is the one who owns it.
Group which group owns this file or directory right here?
Root If if I am the user like I have all that it would show here.
I have saw the size of the file or directory when it was created, the month, the day, what time was
created, and of course the name of the file or directory.
All right.
So let me go log into our Linux system and then we will run the command to view all the properties.
So I have my Linux machine right here.
I am logged in as myself.
Then you run this command.
Who am I?
It means it.
You are asking the system.
Who are?
Give me the user name of the person who is logged in.
All right, now, which directory are you in right now?
You do d tells you you are in slash home.
Slash.
I have solid directory.
All right.
How many files and directories do I have in my home directory?
Let's do ls and I will tell you, these are the files and directories you have in your home directory,
which is home.
I.
So now what if I wanted to know all the properties associated with all these files and directories,
then I will do ls minus l beautiful.
Now you see, it's telling me that right here this is the type of the file.
These are the link.
Who owns it?
Which group owns it?
When it was created.
Sorry, the size of the file, month, date and time the file was created or directory was created and
here is the directory.
How do you how do we know it's a directory.
Because it has this D in front of it.
Excellent.
Now you see all of these directories right here are listed here except this one.
There is a file called some file.
It doesn't have a D in front of it, so it means it's not a directory.
So if you try to go inside of this file, even though it's not a directory, what will happen?
The C CD, some file?
It will tell you, hey, it's not a directory, so you cannot go inside of this directory.
You got it.
Now let's say if you want to do same thing, CD to desktop right here.
This is a directory, right?
CD desktop.
Hit Enter.
It lets you in because it is a directory.
Now you want to see what's inside of this directory.
You do ls there's nothing in there.
And if you wanted to come back to this directory, you could do CD dot dot come one step back.
Anyway, these are the navigation commands that we have learned.
So but if you do, any time you want to see the properties of a file or a directory, you will have
to run the command ls minus l and it will list all the properties.
And through the properties you could tell that what you need to do with the file ordering.