Power of ls & Meta Characters | UNIX Tutorial | Mr. Subba Raju

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys welcome to nourish a technologies this is subbaraj you will see another video session on power of LS command LS means generally we are calling lists it is used to list files and directories just go to man LS to view that once you are going to insert list directory contents LS option file M it has several options and - a means hidden files it is going to display and a dot double dot - capital a next one B escape and eyghon capital B ignore backups you can't I do not and list the employed entries and next - D or - - directory like this several options available - capital F only file related symbols displaying - i-i node - L long listing format - m file with with a comma separated list of entries like this several options available one by one we can try to observe q-quit from there and I am giving LS command press Enter there is no file no directories right now I am creating here to bring some files I am using touch command already completed that I am creating file one file one file to file three I created three files you know already touch related I am NOT discussing that now LS three files displayed mkdir I am displaying some directories directory one and directory - yes displayed now once LS means it is displaying inside whatever the contents available means in the name of files and subdirectories right now we observe LS simple command I am providing first - a right now two directories available three files available total five whenever you are saying LS - a it a displace normal files plus hidden files here a dot indicate current directory and double dot indicate parented directory these to our system hidden directories press whatever you created means directory one directly to I created file1 file2 file record total seven available now now we can try to observe what is this LS dot R double dot dot R double dot you are unable to access as I said already system defined directories but what it contains system related information available inside these dot and double dot now first can we create system hidden files ok can we create user-defined hidden files try to observe yes we are creating for example using cat command one file cat giving file name file name i am giving as a pole if you say like this it is called normal file if file which is starting with a single dot is called hidden file or a double dot is called a hidden file now cat is normal file if you want to make sure that hidden file put it dot means a period press enter it is full text file with hidden status with the hidden status so whenever I am typing that press enter ctrl D save and exit now press LS you can't see dot polar because it is a hidden file LS always displays normal files and directories LS - a displays normal files and hidden files available my dot pol if you want to view the contents from the pole cat and operator is input redirection elaborate ur and you can use pole press enter and your lines visible if you want to append that cat Upendra directional and filename the center I am appending I am appending Paul hidden file now in the pole text file there are the two lines available observe cat and without any radiation operator press ENTER to two lines available so hidden files we can create hidden files we can display and hidden files we can open is it possible to create hidden directories yes mkdir dot dia r3 I said now if you are pressing enter LS and LS not visible LS - a visible this is current parent hidden directory hidden file is it possible to rename hidden file to normal file is it possible to change normal file to hidden file s both are possible as we discuss in our previous video CP MV will try to use here MV command MV means I said cut paste same command I am using it - a and MV what is my hidden file lamp Pole and I want to convert into normal file press Enter Els pole visible because Paul is now normal file now already Paul is normal file I want to change to hidden file yes MV Paul and rename it same name you can use another name I can use I am using for example shell yes possible not visible LS - a visible same like that in the directories also we are doing this is the way we are converting hidden file to normal file normal file - hidden file next LS - f will try to another command LS - F capital F it is displaying always some kind of file notations forward slash indicates directory I said earlier now LS - - classify whenever you are using classified and presenter this is also so indicating file symbols and file notations and LS - I indicating I know the numbers see the inode numbers available here i means index numbers what are the index numbers what is the duty of index numbers i will discuss in a separate video but here a hint i am providing whenever system crashes using i know the number basis we can recover the data from UNIX operating system that is a speciality of the inode numbers I note number never duplicated inode number always unique I note you can provide LS - - I Nord also you can use both are same output presented on the screen next one and most important option is LS - L whenever we are using LS - L it is a displaying long listing format what is the long listing format meaning it is displaying seven to nine detailed information about ever files so let will see one by one that one first I am removing whatever I am having existing thing right I am creating fresh file just I am creating cat I am saying for example my file name is pull it is full text file I am calling whenever you are calling Perl text file it is Paul text file Paul text for enter control D whenever LS - L you entered observe how many list of options are coming total four means total four blocks assigned next one is first - there is a meaning available for each and every column one by one I am discussing first - indicates type of the file and next one indicates file permissions next one indicates number of links to the file next one indicates Warner of the file next one indicates group of the file next one indicates number of bytes in the file next one indicates the month when you created the file next one indicates the date when you created next one indicates the time last one indicates the file so these are the details available with LS - L long the listing format and another one available here LS - L another one LS - there is an option available T t means it displaying time based assigning order yes we'll see there is only one file available now that is already split now I am creating several files and a high high one high - simple example now clear the screen and LS - t what is steam is time based it is displaying latest created first displace first created a last displace now for example I am giving here the time I am modifying cat hi - I am modified yes modification means appending adding data not exactly modification hi - is my text file hi - is my text file press enter ctrl D LS - T now my hi - is coming first I said latest created or latest updated first displace first created or first operated last it is placed that is a t LS - R and T are means rivers tea means time-based abaut results will come in reverse away so this is LS - R for example only are you are entering LS LS iPhone or you are entering this is a result LS - T and time-based LS - T time-based LS - R T observer now reverse of course TT displayed also it is taking as a single T do not worry about that now this is about your LS - T as well as LS - R I want to see these many files available parallel line I want to see only one file because LS means displaying like this I want per line one means - one so every line one one filename only it is displaying next one I want to see size of the file so these are 0 blocks available nothing sir because touch command I use it to create so it contains it contains it contains now I modify this means updated appended this file that is a reason it is available now for example LS iPhone capital S this is indicates size wise assigning order big size always first now s so see the pole and it is displaying first why both are same no and according to that it is taking which one first created also so these are the LS related options LS is a bigger command in the UNIX operating system which is doing different kind of options now we will move to another one that is called meta characters in UNIX operating system to perform our operations in a simple way we are using some special characters these are special characters popularly known as meta characters meta characters popularly known as wildcard characters these characters are first one asked question mark it always matches a single character at a time second one is a strict it matches one or more characters at a time next one is brackets this is we are calling as listed it matches any character any character or any one character in the list and next one we are taking as a range from two to these four meta characters will see with various various commands how it is supporting first let me show to you I am removing whatever the data existed here are M - are a string to remove this command I'll explain soon now LS no file available right of in this directory simple I am creating some files as per my convenient to execute these examples touch I said first one file a one file a be one file ABC one file ABCD any name you can choose any character can choose it is not a capital letter or smaller anyone press Enter all are empty files at the same time you can create the same thing lowercase also a-a-a a-a-a-a and like this I created press Enter all are visible here now one by one we can't write so whenever we are going to access our meta characters simple I said LS question mark question mark matches only single character if I press ENTER with this one I want to display all file names and directory names which are having single character name yes your expectation correct small e a capital e if I am say typing LS double it is displaying yes a a a b LS and triple question marks yes your exploitation correct now for example LS I said two question marks and I said C and enter what it is saying it is there is no file available exactly no such file or directory because it is a capital C now you want to t-80 is yes this using LS command we can do with the help of meta characters excellent operations not only that we'll try to observe now for example LS RM command already completed to remove files I said question mark yes correct it removes which are the filenames having single character as a file name if I press ENTER how many files will be removed as two files will be remove els if I say RM and I am giving this one now how many yes correct like this RM command for example I am creating mkdir with mkdir 1 h 1 HH and 1h like this 3 empty directories i created right and come back to that LS now I am saying RM di are I said question mark yes first empty directly related rmdir double question mark yes as you expected two characters 1 1 available to available 200 available any number of files will be related now 3 means that one will be removed so rmdir triple question marks I type very good and one messes also viable plus my Triple H is not there but here it is matching ABC this evil it is saying very clearly our MDR fail to remove to play yes because our MDR only specifically for removing directories not for files that is the reason message provided clearly now if you want to remove that RM and you can so RM command is specifically for that purpose now all Col files available with the 4 characters again I want to create some files with one two three characters like that with the cat command I will show you otherwise cat I am creating only one character a it is 8 extra file it is a text file control D once controlled your pressing and LS you can press now for example cat I said yes so it is displaying that simply whatever the a available I want to see for example cat it is displaying all file contents which are related to two files and it is displaying all files which are related to three characters file name it is displaying all files related to four characters file name already two files available displaying are not nothing because these two are empty files if you want to see that yes view here this is about your question mark question mark always matches single character next one I am going to second meta character is called as tree asterik matches one or more characters you try to observe one by one for example LS now I said LS a streak a it is displaying all files any number of characters starting ending must be lowercase a how many will come only one only one one already available one and two so these are the two now LS I am displaying as trick and I am saying is again D observe whenever I am saying this one any output no now I am changing that one to capital D yes this is a string same like that RMS trick it removes all files from the current directory RM - are astrick it removes all files and subdirectories structures from the current directory RM di are a strict it removes all empty directories from the current directory and next one is cat astrick it displays all file contents on the standard output screen right next one we can observe that is called this is we are calling as brackets so these brackets or we are using what purpose means is specific characters purpose we are going to for example I want to display that those brackets LS I am providing brackets I said a comma ABCD directly as strict as trick whenever you are going to say it is providing all files and directories which are starting with a b c d file names and directory names now for example you want to provide the same like this also can provide a comma B comma C comma D this is it is displaying all so now you are going to for example you said the same command RM you said a comma B comma C comma D it is removing all files which are starting with a and B and C and D press ENTER and you can check it yes good remote same like that our MDI our and I am giving XYZ a straight answer it is removing all empty directories which are starting with x and y and jet same like that RM - - or and i am providing a b c d and a strip it is removing files subdirectory structures all which are starting with a b c d and final last one is a range we will try to observe that is called the range from - a - D and I am giving LS so it is displaying all files which are starting with ABCD and presenter displaying capital you know sir it is displaying small year right for example we can create triple year press ENTER and say hello controlled and I am executing observe means whenever range you are giving it is matching both characters same like that you can use RM same like that rmdir to work on it same like that a cat cat and you can type for example I want to see a to jet and a string it displays all file contents on the screen which are starting between A to Z these are the meta characters so totally number of meta characters available these meta characters frequently we are using for the several operations what are that one question mark matches single character at a time as trick one or more characters and brackets only specific characters which are specified and a range is nothing but from two two characters that is we are calling - thank you for watching videos catching for more videos youtube.com slash narration
Info
Channel: Naresh i Technologies
Views: 86,929
Rating: undefined out of 5
Keywords: Subba Raju, Unix/Linux, Naresh IT, Hands on UNIX Training, Online UNIX Training, UNIX Tutorial Videos, UNIX Overview, UNIX Interview Questions, Power of ls, Meta Characters, MetaCharacters, metacharacters in unix, UNIX Tutorial
Id: hFvEY97y3q4
Channel Id: undefined
Length: 23min 43sec (1423 seconds)
Published: Sat Sep 10 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.