30 BASIC COMMANDS IN LINUX / UNIX || LINUX COMMANDS || UNIX COMMANDS || OPEN SOURCE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello friends welcome back to our channel so in today's session we'll discuss about important 30 basic commands in linux or unix environment so coming to this one so these are the 30 commands you should know in the linux or unix mkdirs cd touch cat ls pwd cp mv head tile and so on so there are 330 commands we'll see one by one by executing each and every command in the environment so for that i will open the ubuntu app so how can we install the ubuntu app in windows 10 i have recorded the session so i'll post the link in the description section so that you can refer that and you can download the app from the play store so this is the environment you can see the terminal right the first one is a mkdir mkdir it will create a new directory new directory so directory means it is a collection of files right so it will create a new directory with a given name so first let us create this one so mkdir and you can i will create it as a linux commands i have created one directory with linux commands and see this ls is used to list the content list the content of directory so directory means it will be having files a group of files so in order to list the files this ls command will be used so if i press ls so i'll i will get all the files which are available in that particular folder so you can observe these are the different files and you can find the different color blue color so the blue color represents the directories okay so for example if you go with a sandeep this is a directory linux is a directory and a linux command just now we have created it directly now second one is a cd cd means change to directory change to directory so whatever the directory we are giving the point will be changed to that particular directory now uh you can see cd linux commands so this is the directory which we have created so now i am moving to that particular directory see you can observe here in the terminal itself we are getting some slash and linux commands now the cursor is in that particular directory now you if you go with the ls so this is an empty directory because we have not created any files in that particular directory right for example i will change so cd let's go with the sandeep director sandeep is also directed because the text is in blue color right so just press enter so it was entered into the sandeep now you can press ls so that will be having the list of the files available in that particular directory f1 f2 f3 and so on so like this we have to change the directory now i will change the directory to this one so yeah then touch touch is used to create empty files empty files right now you can see so i am using some touch f1 or file 1 dot txt press enter so file 1 dot txt is created in linux commands directory and file1.txt doesn't have any content that means it will create an empty file so if you observe ls so ls means list of files available in that particular directory so now we have created file1.txt in linux commands directory so just press enter ls so that you will get that file1.txt file1.txt and the next one is a cat cat command is for three purposes the first one is to display the content second one is to create a file and to enter the content into that profile and the third one we can merge two files and we can copy the same content to the another file so we'll see first of all we'll see how can we create a new file and how can we write into a new file right so cat greater than symbol you can see the syntax cat greater than symbol file name so i will give file to dot txt so file2.txt will be created and if you press enter so it will ask for the data so i will write here so hello friends i'm just writing this one so press enter and it will again ask for the data so until you press a control d it will keep on asking for the data so whatever the data you are typing here everything will be stored into this file2.txt so here the end of a string is a control d whenever you press ctrl d automatically the content whatever the content so far we have created or which we have typed that will be stored in file too now you can see so hello friends is a content which is stored in file2.txt so see create a new file create a new file and writes the content and control d to save the content into file right so this we have already seen this one now cat is for display the content of file display content of file now we'll use this one cat so you can see ls so we are having a two files file1.txt which is an empty file which was created with the help of a touch command and file2.txt is a another file which is having a content which was created by using the cat command now i just want to see the text which is available in file2.txt so i will go with the cat file2.txt so that the content will be displayed here itself right the cad command is used to create a file and store the content and one more thing cad is also used to display the content of your file and one more thing we'll create one more file so cat file3.txt sorry yeah file3.txt again prompting here so i will write the content welcome to linux or unix commands so presenter and i'm using ctrl d to end so you can see ls is having three files so you can observe cat file one dot sorry file2.txt which is having hello friends so cat file3.txt which is having the content welcome to linux or unix commands now the cat is also used to merge two files and copy the content to another file so it creates new file and content of both the files will be copied to new file right so i think this one should be written here right cat file one space file two greater than file three so whatever the content available in file one and file two will be copied into file three see i will show you so file one and five file two and file three are having some content now i will go with the cad file two dot txt space file three dot txt greater than file for dot txt or file match file merge dot txt you can observe so now we will just go with the ls so we'll be having a four files file one file two file three file match file one is an empty file file merge is a kind having a content of both file two and file three so how to check the content use a cat command cat file match dot txt so that you'll be having the content of file two and file three copied into file merge so hope you understood this one right next ls dot here there is a one more uh command that is a ls star dot txt so ls if you give ls will get only all the files which are available in that particular directory and if you want to get only the text files you need to go with the ls see star dot txt it will print only the text files only the text files so our our directory is having only text file so it was printing all the things so i will tell you about the example now you can observe here hell uh ls we are having some c files python files text files okay now i will show you that ls star dot c so it will print only it will print it will display only the dot c files so we are having only one dot c that is hello dot c and similarly ls star dot p y it will list the p y effects so we are having only one p by five and ls uh space star dot txt which will give only the text files you can observe here all the text files there is no dot c and dot no dot so like this we can specify the files we can specify the uh the extension of the file so that will get only those files to be get displayed on the screen so for that purpose we have to go with the ls star dot txt so list all the files with given extension right and the next one is a pwd pwd means it will display the current working directory in which directory you are working that will be displayed on the screen for example here you can see cpwd present working directory so this is the present working directory this is the present working directory and if i go with this one cd uh linux commands now you can see pwd so we are working in home sandeeps are there linux commands so like this it will display the present current working directory present working directly and the next one is cp is used to copy a file or a directory copy a file or a directory right so i will just go with this one see cp file 4 dot sorry file 3 dot txt to file 4 dot txt so you can observe here ls it's having file 3 and file 4. you can simply go with the cat file 3 dot txt and cat file 4 dot txt so you will be adding the same thing so one more file is created so a copy is created and the next one is a move so move means the two things one thing we can move a file to another directory so for example you can see so i just want to move so here just go with this one so use this one so we are having all this one so we need to move hello dot c we need to move hello dot c so how can we move so m v use a hello dot c two so give the location where it should be done move so sandeep uh saradi and in that just want to move it to linux commands directory see automatically it has been moved to linux comments dot directory because you can observe here so we'll move to the linux commands so here you can observe ls so here you can see hello dot c so previously we have not created any file in linux commands directory but we are moving the file to this one okay so moves file or directory file or directory and head head means it will display the top 10 lines of the file see for example we have given some file one dot txt it is a i think it's a empty file so we'll check with that cat file one dot txt which is an empty file right now we will write some data so in order to write some data we'll use a bi editor va file1 dot txt so automatically it will be open now just use a insert mode so all these things the working of va editor i have already explained in the previous session so i will post the link in the description so that you can follow that one so press i to the insert mode so here you just go with the line two line three line four line five see line six line seven line eight line 9 line 10 line 11. so see here i have given some 30 lines okay i have written some 30 lines now put the escape and save this file wq see now you can observe cat file1.txt so you'll be having all that 30 lines all right so head means head file 1 dot txt it will display the top 10 lines so this head this head will display top or first first 10 lines in a file and similarly tile it gives the last 10 minutes tile will give last ten length see file one dot txt it will sorry l1 dot txt yes sorry spelling mistake so tail file1.txt it gives the last 10 lines of the content so this is a time right so it display last 10 lines of your file right next tag tag means the reverse of cat so it will display the content in the reverse order so tac file one dot txt you can observe it displays from the last line to first line okay reverse order for example we'll go with the cat file three dot txt okay there is a content so it is tack file three dot txt because it is having only one line so we are getting the same thing so we'll go with the next one that is a file merge because it is having some two lines file match dot txt so tech file match dot txt will display that in the reverse order the second line will be the last line will be in the first line reverse order it will be displayed okay so it will display file content in reverse file content lines in reverse okay and more the next one is a more more command is used to display the content by using enter or spacebar that means if it is beyond the screen size the content is beyond the screen size so we can simply use this more command for example so we are having some 30 lines of code in a file1.txt if you print this file1.txt so let us check this one file1 sorry file1.txt so if you print this one see from line 9 we are getting displayed so what about the lines 1 to 8 it was not displayed here so if you use the same thing more uh file one dot txt see 1 to 22 that means 72 percent of the content has been displayed and if you press enter then only it will move the next 30 38 sorry 28 percent see 75 percent so 23 24 25 so you can observe here so it was just just similar to our scroll bar just similar to our scroll bar so that is used to display the content in screen by screen okay it is similar to cad similar to cad command and here we can display large content large content by using enter enter or back spacebar spacebar right so we can display the content screen by screen and the next one is id it display id of user or a group group id it will display the user id or group id so if you go with the id so you can see the user id is some thousand group id is some thousand and groups is some thousand so like this it will display the id of a user id of a user or a group and clear is used to clear the screen clear the screen right so if you are if your screen is completely full so here you can observe the completely full the cursor is blinking at the bottom so just you want to clear all the screen so just use a clear command so that everything will be removed on the screen directly it will remove all the content which is available on the screen right next va we know that va is in text editor text editor to write the programs or text to write a programs or a text so we have seen this va editor and a grep is nothing but a filter it's a filter to search given pattern so we need to give the pattern so it will search for the given pattern in the file content in the file content so let me explain this one graph is a filter right so here you can see cat file 4 dot or file 3 dot txt so here here we are having some welcome to linux or unix so i just want to check the linux okay grep line x in file three dot txt so you can see it will be highlighted okay it will be highlighted if you want the o in file three dot txt you can observe wherever the o is there character that will be highlighted so that means search pattern so it will search for the given pattern okay and the next one is a difference difference means it compares it compares the content of the content of two different files two different files so here you can see cat file 1 or sorry file2.txt and cat file 3 dot txt so we'll use the difference difference so file 2 dot txt with file three dot txt so you can see there is no difference there is no difference now if you use a file mesh okay file merge dot txt there is a content right now we will they will see the difference between a file two dot txt with file merge dots txt because in both the files we are having a common thing that is hello friends so you can see okay so 1 8 2 1 a 2 so that means the first line is automatically it was matched right so the difference so in both the difference the common element has been removed and only one thing has been displayed that is a welcome to linux or unix command because if you go with the file cad file2.txt so you are having the content hello friends so hello friends is same hello friends is available in filemaker also so what is the difference between file to file three file file two and file matches welcome to linux commands so this is the text which is available in file match which is not available in file two right and here file two and file three so hello friends is a message which is not available in file three and welcome to linux or unix comments is the content which is not available in file 2. so it was displaying that both the things but here it displays only the remaining thing so the common thing will be removed and the difference will be printed here right so ping this pin checks the connectivity checks the connectivity in network connectivity status of a server so here we need to give the data see ping here you need to give the address so google.com let us take so you can see 64 bytes from so and so and ttl and time so that means if you are getting like this automatically we can say that there is a connectivity to the server okay use a control jet it will stop and now i am disconnecting the internet you can observe here i have disconnected the internet again i am using the same thing ping google.com so you can observe here there is no connectivity okay there is no data so previously we are having the data so here we are not having the data see the temporary failure in name resolution okay so hope you understood this one there is a thing and a history this history will review it will review all the comments all the comments which you have entered entered right so just i will show you history so it will review all the comments so so far so far we have uh reviewed all these comments so history right so what are the commands we are executing everything is displayed here right so like this the history will be used and hostname it will display the hostname display hostname here you can observe here the if you go with the host name so this is my host name and if you want to get the ip ip address so you have to use a hyphen i so display host ip host ip see hostname hyphen i which will give the ip okay instead of giving the host name it will return the ip and chmod is used to change the user or a group permissions to access the file so it is used to change change the user or a group permissions to access file see here you can see cat file2.txt so only one line so just i will edit this one so vi file2.txt so here i will go with the insert mode and here see i am just going with this one welcome to line x i have inserted one line go to the command mode use a w sorry colon w q so saving feed now you can observe here cat file2.txt so automatically the updated content will also be displayed now if i change the permission for this one so chmod user is equal to read u is equal to r and give file to dot txt so i have changed the file to dot tx u is only read only by using read only r for read w is for write okay i am just using u is equal to r u is equal to r means user will be having only read only now let us check that means read only means we must be unable to read write the data so i will try to write the data to the same file so vi file two dot txt so it will be open no problem insert mode go to the insert mode so you are having some warning here see changing a read-only file so i will change here thank you and go into the command mode use a colon and wq to save and quit you can observe here so read-only option is set so we should not use the read-only i mean we are unable to write the data into the command right so this is a quit without save so if you again use chmod user is equal to write only write mode file2.txt now use the same thing file two dot txt so everything has been arranged because it is a read mode so everything has been arranged here right so in order to quit without saving so q colon so it will it will erase i mean it will quit from the v editor and the next one is nl is used to display the line numbers line numbers see so va uh file 4 dot txt is having some welcome to linux commands so i will go with the sorry vi five to pst oh sorry so i think uh we have given [Music] yeah okay cat file four dot txt okay we'll see this one so nl file four dot txt so you can see a line number after this particular line you can see the line number after this particular line right so you can see here one so if you use the same thing nl file three dot txt see nl file1.txt so you can be having the line numbers before the content okay you can add the content line numbers and wc command wc command it will give number of lines available in the content words available in the content and characters available in the content characters available in the file content right see let us check so what is this one wc wc file three dot txt so you can have one line six words and 33 characters so you can see here cat file three sorry cad file three dot txt so you can have this one so one line six words one two three four five six six words and 33 characters right and if you see wc and if you go with the wc file 1 dot txt see 30 lines 30 words 30 words and 200 and characters 231 characters right and the next command is uni unique unique command is used to remove duplicates of file content but here there is an exception case for this unit command that is the exception is uh it can remove only continuous duplicates that's a restriction continuous duplicates right see for example if uh i will i will edit here vi file3 dot txt so here i will go with the yy and p okay and go to the insert mode and i will go with here see okay i will remove here and i will create one more thing thank you and i will write a subscribe and again i will go with the thank you and here you can observe the uh we have written the same content twice here here we can we have written the same content thank you and thank you this is a duplicate but these two lines are not a continuous lines and coming to the first one welcome to linux or unix commands so this is a duplicate but these are the continuous lines now i will save this one sorry before saving i just move to the command mode so wq now you can observe here the cat file three dot txt so you all you are having some four five lines of code among that five two lines are duplicates one is with a continuous and another one is without without continuous now if you use this unique unique uh file three dot txt so whatever the content which is available in the continuous lines that will be do i mean that duplicates will be removed and whatever the content which are not a continuous line duplicates that will not be get removed so if you can observe here so unique file three so you can observe only one line has been removed the first line because the first two lines are duplicates continuous lines okay continuous lines and you can observe the third line and the fifth line is the same but those are not a continuous so that will remains in the same so that is one restriction of this unique command so if the content is continuous duplicates then only it will be deleted and if the content is not a continuous duplicates the content will not be get deleted right and the next one is rim rmdir it removes the specified directory this one is used to removes the specified director right for example go with this one so we are having directories linux and sandeep so ls sandeep so it is having some three uh files so rm dir i just want to remove sandi see fail to remove sandi because it can remove only the empty directory so it removes the specific directory but here one constraint is the directory should be empty right see make sure that directory should be empty so if the directory is having any file so this rmdir will not be accepted okay so go to the linux so linux is an empty directory so rmdir go with the line x so automatically the directory has been deleted so you can observe here ls so linux is not available here and see if you want to delete the directory with including the files then you go with the next one that is rm so it will remove the file or a directory right and here the directory need not be empty so if if the directory consists of any files all the files will be get deleted see here so ls i will go with the sandeep directory because sanibe is in blue color so that is that is nothing but a directory so it is having some three files now i will go with rm sandeep sorry sorry sorry so rm is used to remove the file itself not a directory i'm extremely sorry so rm is used to remove the file okay so rm i will go with the see i will ls command so there are different files i will remove the f1.txt so rm f1 dot txt you can observe here ls so there is no file with f1 dot txt i'm extremely sorry rm is for removing a file and rmdir is for removing the specified directory and make sure that directory should be empty right so hope you understood this one so these are the basic linux or unix commands so there are a lot of options in a grep filter so we'll discuss the graph filter and all these things in in the further session so but these are the basic linux or a unix commands that every computer science student should know right so hope you understood this one if you are having any doubts regarding this comments feel free to post your doubts in the comment section definitely i'll try to clarify all your doubts and if you really enjoyed my session like my session share my session with your friends and don't forget to subscribe to our channel thanks for watching thank you very much
Info
Channel: Sundeep Saradhi Kanthety
Views: 7,215
Rating: undefined out of 5
Keywords: sundeep, saradhi, kanthety, linux, ubuntu, suse, red hat, terminal, unix commands, linux commands, windows 10, play store, microsoft store, linux terminal in windows 10, ubuntu terminal, python programs in ubuntu terminal, python in linux, linux environment, vi editor, unix, save file, quit file, moving cursor, commands in vi editor, vi editor basics, basic commands, unix environment, mkdir, cd, touch, cp, mv, head, tail, more, id, clear, vi, diff, ping, hostname, chmod, nl, wc, uniq
Id: rFwdniyo0CM
Channel Id: undefined
Length: 40min 39sec (2439 seconds)
Published: Wed Dec 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.