1 00:00:00,570 --> 00:00:07,650 Hello this is with you we are going to learn about file names in Linux and we will also see how we can 2 00:00:07,650 --> 00:00:10,790 determine file type using our file command. 3 00:00:11,100 --> 00:00:17,670 So if I do an ls here on my home directory I can see that the desktop name here the file name desktop 4 00:00:18,380 --> 00:00:20,400 is written with an uppercase D. 5 00:00:20,430 --> 00:00:27,360 So if I try to change to my desktop with a lowercase d it will not work it will tell me no such file 6 00:00:27,720 --> 00:00:28,840 or directory. 7 00:00:29,290 --> 00:00:34,470 That's like because our file names in Linux are case sensitive. 8 00:00:34,680 --> 00:00:40,640 So I have to write desktop with an uppercase d in order for it to change to my desktop. 9 00:00:40,780 --> 00:00:48,000 This was the first thing here is that you guys need to know that our file names in Linux are case sensitive 10 00:00:48,000 --> 00:00:50,100 just like our commands. 11 00:00:50,690 --> 00:00:54,580 OK so here is the second thing here. 12 00:00:54,600 --> 00:00:59,270 I have an image file of course IP in the file talks. 13 00:00:59,280 --> 00:01:06,440 Talks of course is our favorite penguin because it's a symbol of Linux. 14 00:01:06,530 --> 00:01:08,940 What if I change the file name tags here. 15 00:01:08,960 --> 00:01:17,800 If I change the file name from Thaxter Binjie to Pinguin without any extension. 16 00:01:18,110 --> 00:01:21,140 So this will still show me a penguin here. 17 00:01:21,160 --> 00:01:28,010 It did not do anything to the file though it was just open like normal you see it did not change anything 18 00:01:28,010 --> 00:01:29,380 to the image file. 19 00:01:30,770 --> 00:01:33,530 So that was the first concept here. 20 00:01:33,650 --> 00:01:37,760 In Linux we have no concept of file extension. 21 00:01:37,760 --> 00:01:45,680 That means that if I change the filename with an extension that PTF file or as a peg file. 22 00:01:45,680 --> 00:01:49,070 If I change the extension to anything it will work. 23 00:01:49,100 --> 00:01:55,970 As you can see here here I removed the extension completely from DOT pre-injury to nothing here I don't 24 00:01:55,970 --> 00:02:01,350 have an extension here and the file is working just like normal. 25 00:02:01,550 --> 00:02:03,190 So let's do it one more time. 26 00:02:03,200 --> 00:02:07,050 Here I have a file system to start pedia right. 27 00:02:07,670 --> 00:02:14,680 So if I and if I open it here you will see an explanation of the Linux file system that I made and. 28 00:02:14,690 --> 00:02:26,300 OK let's change this file so I will rename this file from pedia of two files that blah blah blah blah 29 00:02:26,300 --> 00:02:28,080 is an extension that I made up. 30 00:02:28,400 --> 00:02:30,860 There is no extension called blah blah here. 31 00:02:31,640 --> 00:02:36,720 And as you can see it was just open just like normal. 32 00:02:36,830 --> 00:02:45,300 So it did not affect the file itself so the extension of a file in Linux has no meaning whatsoever. 33 00:02:46,220 --> 00:02:54,140 And the same for here like here I have a text file called Text one which which has some text. 34 00:02:54,140 --> 00:03:01,780 If I change if I renamed this file from text I want to text one dot PDA for example 35 00:03:05,530 --> 00:03:08,680 and if I just try to open it with my 36 00:03:11,390 --> 00:03:19,050 my edit your Megi edit editor here so it will just open like normal it will show me some text. 37 00:03:19,050 --> 00:03:25,150 So you can see it did not affect the file itself so let's rename it back to the original name. 38 00:03:25,190 --> 00:03:28,740 Text one that PDA or even I can rename it to something else. 39 00:03:28,740 --> 00:03:30,210 Text one dot. 40 00:03:30,900 --> 00:03:32,680 Wow. 41 00:03:34,050 --> 00:03:41,080 And as you can see there's an extension here no meaning whatsoever. 42 00:03:41,220 --> 00:03:46,110 And one more time I will do it for the zip file here file that zip. 43 00:03:46,110 --> 00:03:48,810 So here I have the file containing these two files. 44 00:03:48,820 --> 00:03:57,400 Actually if I open my file I would have two files text one and text two if I changed file the zip and 45 00:03:57,410 --> 00:03:59,050 rename it to a file. 46 00:03:59,160 --> 00:04:02,340 So I would just remove the extension here. 47 00:04:02,430 --> 00:04:09,180 It will just open like normal and you can see the file extensions are not required in Linux. 48 00:04:09,180 --> 00:04:11,830 In fact they carry no meaning man. 49 00:04:12,360 --> 00:04:14,280 And one more time for you guys. 50 00:04:14,280 --> 00:04:17,790 Here I have an avid you don't. 51 00:04:17,800 --> 00:04:19,760 MP for you and MP for video. 52 00:04:19,760 --> 00:04:33,600 So if I change my file here and I completely remove it completely remove the extension. 53 00:04:33,600 --> 00:04:38,880 So as you can see it's still a video of course. 54 00:04:39,430 --> 00:04:48,790 OK so now let's learn how we can determine a file type using our file command. 55 00:04:48,930 --> 00:04:55,770 So because we have so much flexibility when we when you deal with file names like you see here sometimes 56 00:04:55,820 --> 00:05:02,350 you will see an image file like or as a peg extension but it's not actually as a page file. 57 00:05:02,820 --> 00:05:09,100 So how can you know that the true content or the true file type. 58 00:05:09,120 --> 00:05:11,100 You use the file command. 59 00:05:11,460 --> 00:05:19,830 So if you use file and then here is specify your file name so this will tell you it will print a brief 60 00:05:19,830 --> 00:05:28,860 description about the contents of your file and it will also reveal the type of your file. 61 00:05:29,250 --> 00:05:41,940 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 62 00:05:41,940 --> 00:05:45,500 have an extension here that tells me it's a PNB image. 63 00:05:45,810 --> 00:06:03,290 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 64 00:06:03,740 --> 00:06:04,770 a peg. 65 00:06:05,010 --> 00:06:13,500 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 66 00:06:13,500 --> 00:06:16,000 me it's a zip file I you can see. 67 00:06:16,110 --> 00:06:22,520 And here is a video file terminal. 68 00:06:22,810 --> 00:06:28,920 It will tell me it's an MP for file even though I have no extension here that say that says it's an 69 00:06:28,920 --> 00:06:29,960 MP 4. 70 00:06:30,090 --> 00:06:36,350 And also let's reveal the type of this file here text. 71 00:06:36,930 --> 00:06:39,270 1. Wow. 72 00:06:39,990 --> 00:06:44,910 It will tell me oh I have have to say one more wow here. 73 00:06:45,120 --> 00:06:46,040 OK. 74 00:06:46,560 --> 00:06:53,330 So it will tell me it's a text file I think and the ASCII text and have an empty file text too. 75 00:06:53,610 --> 00:07:00,780 So if I make a file if I do file text too it will tell me I have an empty text. 76 00:07:01,140 --> 00:07:04,890 And one last one here for file that blah blah blah. 77 00:07:05,160 --> 00:07:11,990 File file that blah blah. 78 00:07:12,020 --> 00:07:13,390 I made another typo. 79 00:07:13,400 --> 00:07:15,600 So I would say blah blah. 80 00:07:16,070 --> 00:07:20,640 Ok yeah I can see it tells you it's a PTF document. 81 00:07:22,070 --> 00:07:22,660 So yeah. 82 00:07:22,700 --> 00:07:32,060 So if you want to determine the file type you can use the file command as you can see and actually again 83 00:07:32,170 --> 00:07:34,360 combine more than one file together. 84 00:07:34,550 --> 00:07:45,890 So if you say file text do as long as terminal as you can see it will tell you text to an empty file 85 00:07:46,130 --> 00:07:49,890 but terminal is an MP for file and so on. 86 00:07:51,870 --> 00:07:55,380 So I guess that's it for this video. 87 00:07:55,870 --> 00:07:56,250 Joe.