Hello this is with you we are going to learn about file names in Linux and we will also see how we can
determine file type using our file command.
So if I do an ls here on my home directory I can see that the desktop name here the file name desktop
is written with an uppercase D.
So if I try to change to my desktop with a lowercase d it will not work it will tell me no such file
or directory.
That's like because our file names in Linux are case sensitive.
So I have to write desktop with an uppercase d in order for it to change to my desktop.
This was the first thing here is that you guys need to know that our file names in Linux are case sensitive
just like our commands.
OK so here is the second thing here.
I have an image file of course IP in the file talks.
Talks of course is our favorite penguin because it's a symbol of Linux.
What if I change the file name tags here.
If I change the file name from Thaxter Binjie to Pinguin without any extension.
So this will still show me a penguin here.
It did not do anything to the file though it was just open like normal you see it did not change anything
to the image file.
So that was the first concept here.
In Linux we have no concept of file extension.
That means that if I change the filename with an extension that PTF file or as a peg file.
If I change the extension to anything it will work.
As you can see here here I removed the extension completely from DOT pre-injury to nothing here I don't
have an extension here and the file is working just like normal.
So let's do it one more time.
Here I have a file system to start pedia right.
So if I and if I open it here you will see an explanation of the Linux file system that I made and.
OK let's change this file so I will rename this file from pedia of two files that blah blah blah blah
is an extension that I made up.
There is no extension called blah blah here.
And as you can see it was just open just like normal.
So it did not affect the file itself so the extension of a file in Linux has no meaning whatsoever.
And the same for here like here I have a text file called Text one which which has some text.
If I change if I renamed this file from text I want to text one dot PDA for example
and if I just try to open it with my
my edit your Megi edit editor here so it will just open like normal it will show me some text.
So you can see it did not affect the file itself so let's rename it back to the original name.
Text one that PDA or even I can rename it to something else.
Text one dot.
Wow.
And as you can see there's an extension here no meaning whatsoever.
And one more time I will do it for the zip file here file that zip.
So here I have the file containing these two files.
Actually if I open my file I would have two files text one and text two if I changed file the zip and
rename it to a file.
So I would just remove the extension here.
It will just open like normal and you can see the file extensions are not required in Linux.
In fact they carry no meaning man.
And one more time for you guys.
Here I have an avid you don't.
MP for you and MP for video.
So if I change my file here and I completely remove it completely remove the extension.
So as you can see it's still a video of course.
OK so now let's learn how we can determine a file type using our file command.
So because we have so much flexibility when we when you deal with file names like you see here sometimes
you will see an image file like or as a peg extension but it's not actually as a page file.
So how can you know that the true content or the true file type.
You use the file command.
So if you use file and then here is specify your file name so this will tell you it will print a brief
description about the contents of your file and it will also reveal the type of your file.
So now if I want to say file Pinguin it will tell me that Pinguin is a in the image even though I don't
have an extension here that tells me it's a PNB image.
And of course here if I say file or don't Jay Jay peg it will tell me or I made a typo so or am that
a peg.
It will tell me that this is a big image and if I do a file file here which is this one that will tell
me it's a zip file I you can see.
And here is a video file terminal.
It will tell me it's an MP for file even though I have no extension here that say that says it's an
MP 4.
And also let's reveal the type of this file here text.
1. Wow.
It will tell me oh I have have to say one more wow here.
OK.
So it will tell me it's a text file I think and the ASCII text and have an empty file text too.
So if I make a file if I do file text too it will tell me I have an empty text.
And one last one here for file that blah blah blah.
File file that blah blah.
I made another typo.
So I would say blah blah.
Ok yeah I can see it tells you it's a PTF document.
So yeah.
So if you want to determine the file type you can use the file command as you can see and actually again
combine more than one file together.
So if you say file text do as long as terminal as you can see it will tell you text to an empty file
but terminal is an MP for file and so on.
So I guess that's it for this video.
Joe.