hey everyone welcome back to another video and in this video we are looking at an introduction to linux commands you see how these commands work and uh focused on like some basic commands as well and some commands that will help you out in like data bob's boot camp as well speaking of which we are running the devops bootcamp you can learn more about it over here what we are going to cover and the features and everything and testimonials you can subscribe for updates the link is in the description comm classroom.org one more thing i want
to share is that i have started my own personal blog as well as you can see i'm sharing my experiences with open source and technical deep dives of tutorials and things like that so you can uh put your email address over here and subscribe for free and then all the new articles and publishments uh you know blog posts that i will post you will get those in your like notification you can follow it as well and uh do show your support um we always talk about learning in public so i would highly encourage you all
to start your own blog posts as well and document your learnings i mean things you're learning in these uh webinars and boot camps right uh one more thing about it all boot camp is that i have the cloud native tools deep dive playlist so when you talk about you know like devops and cloud native there are so many tools and technologies right so we're going to be doing a deep dive in those we're going to see what is the cncf landscape like you know some monitoring tools and like you know ci cd tools and infrastructure
tools and so many other things so as you can see we have done like a few on day three and more to more to come so make sure you check out on my youtube channel cloud native tools deep dive because it's extremely important to be aware of what all things are going on in the ecosystem let's get started with today's video what is this video about it's more on the practical side of of things like the application based stuff right so there are two things first thing is how to use the terminal and second thing
is like working with like the modifications of terminals and stuff and like writing your own terminal programs and things like that okay so the first one which is the more on the practical side like how to use it which is going to be extremely important in the devops bootcamp course so that is what we're going to be focusing on in this session and there's one more thing known as shell scripting like bash scripting if you if you'd like to call it so bash programming that is a little bit more advanced topic and that is something
we'll be covering later on in the devops bootcamp itself other than that uh some other concepts related to let's say linux itself like linux infrastructure file structure how it works and whatever those things are like not required right now they will be required later on when we are like ahead of communities or whatever okay so right now don't worry much about it focus more on the practical stuff i'm a student i'm working in the devops field i'm teaching you all i do so many amazing projects open source contributions so one of the most important skills
is don't worry so much okay have fun while learning learn by doing and uh just you know keep learning while you're contributing while you are getting some hands-on experience don't be like oh i have to be an expert in all i have to do all the complete you know how the entire linux works from 0 to 100 i have to know everything and then only i'll contribute then you will be stuck and you will not achieve anything okay so i have also learnt all these things but i've learned it in a different way by doing
so when i'm telling you do the practical approach right now and the theory part later do that okay that will be covered in the boot camp itself cool so bash scripting and everything on linux and stuff will be coming as well in future videos but i wanted to get you up and up and running okay so after this video we'll be doing like yaml courses and then we'll be doing docker and then kubernetes so in just like the next three four videos we will be at kubernetes complete complete complete courses okay because i'm planning one
long a video on docker like a complete course like i did for networking so the networking course has been pretty popular make sure you check it out okay so let's see how things work um what is so this is a basic tutorial like not basic i mean like it starts from the basic and we'll be covering some advanced like uh some other like commands useful devops networking commands as well if you haven't checked out the networking bootcamp make sure you do so it's a 4r plus long video we've covered you know so many amazing things
over there on how the internet works so first thing is that uh what is this on your screen okay so this is item okay it's a terminal emulator okay a terminal emulator in simple language in simple language the idea is that let me ask you a question when you interact with your computer how do you do so if this is a folder called tutorial folder you want to create a new folder in it how do you do so right click new folder you want to delete it you say move to bin isn't that what you
do right that is what we do so basically here this structure that i have is this is the file structure the graphical interface that everyone works with right click and stuff and this is known as a terminal emulator okay so what is a terminal emulator canal a terminal emulator is basically a program that will let us use the the terminal in a graphical way okay in a graphical environment so there's so many in mac we have like the terminal which is by default we can also download item which i have downloaded because it has a
lot of cool features okay in windows there's like putty and in linux there's the terminal and there's x term and uh kde and all these other consoles and everything so basically terminal is something that you will find now windows also has a terminal right so basically every terminal emulator terminal inventory is like this application okay this app so everyone will have like their own features and stuff but mostly it's it's same how it works internally though that is fine if you're saying that what is the use of this terminal application then the terminal emulator you're
saying that it's an emulator for the terminal now what is this terminal what is this shell thing that you are talking about this is known as the shell so basically let me explain it to you the idea is that using this application item or terminal or whatever you will be able to control your operating system basically so you want to create a new folder there is a command mkdir mkdir folder folder is created okay all these commands i'll look at later on okay let's first remove this okay so what is a shell a shell in
linux is basically it's a command line interface that will take all my commands as input okay like i'm saying hey create a new file or something like that okay touch new file or touch is a command to create a new file show me all the networking details or whatever git okay so git is also command line tool so how does my operating system know what command line tools you are saying and how that is converting to the instructions the shell helps us in doing that okay so it will interpret the commands that i give and
you know all the script files and everything which we'll talk more about later like when i'm writing you know something like something like if i'm writing git so how does my computer know where this git file is and how is it running we know this is a git command but what is actually running is it a file is it magic what is it it actually execute an executable file i'll tell you more about that later okay so this is what the shell is a shell is basically a command line interface that will interpret our you
know to our commands and convert those like you know tell the operating system what to do basically okay so there's like bond cell seashell there's bash and there's uh you know uh zsh as well okay so z shell has like the oh my uh oh my z s h that's the one that i am using over here uh so these are just various various cells it is also based on like the you know the the bash shell but it has a lot more improved features and stuff okay and part of the terminal is known as
the command prompt where you actually write commands so i have customized it according to my needs oh my oh my dish uh actually provides just with all these customizations i'll show you how you can customize this as well um but if you're using the bash cell then i'm gonna tell you right now just hold on a little bit so basically let's first you know introduce you to like a basic like that is not modified so i can run like docker run ubuntu so basically i'll be running ubuntu on my machine don't worry about this because
we'll be covering it later on in the docker bootcamp okay so here what is this root thing basically this is the username of the current user so as the current user i'm running as root if you don't know what root is don't worry about it just think of it as your computer's user name add that it is like a separator this thing what is this thing this is basically the host name of the server okay host name of the server and this is basically the uh um directory the current directory you are in okay basically
about that let's learn about this directory and stuff and this thing will cover like uh you know when we do network uh more hands-on docker tutorials tutorials work with virtual machines and stuff this will make much more sense then so don't worry about this right now because the focus of this tutorial is linux commands exit okay something i want to share with you is that kunal like um what is this uh like when you're running docker command when you're running git command let's say you've done git right so how does my computer know where this
git command file is located git command is actually an executable file that file is run if i'm running python 3 okay so it's running python 3.7.6 now how does my computer know where this python 3 file is or whatever let's see so this is basically the executable file over here binary user bin python 3. if i just run this directly like this you can see it's running python how cool is that okay if you run this particular version oops exit actually updated in the interpreter so this python 3 is actually saying run the eucharlos user
local bin python3 okay if you try to open this if i try to open this uh i can say something like if i exit out of it okay a little bit of a spoiler forget about opening it there's a command known as list command which basically lists all the things in the folder i know like you might be a little confused right now what do you mean by this thing or whatever let me explain it to you let me first explain some like basics basic stuff two basic things so a command line tool like i'm
it says tutorial over here right now okay this basically means that i'm in the tutorial folder okay so in the current folder if you want to list all the items you do the list command ls it's showing nothing it's saying this folder is empty and that is true when you open a new terminal this is let's say a new terminal that a new item you know shell that i have opened so i'm using the shell zsh you can use bash sell or whatever they have their own features cool so the idea is that when i
open it a new one it's on my like home directory okay let's see what's in my home directory it has applications and desktop and documents so basically this thing over here if i just open it like this cool so application and downloads and movies applications and downloads and movies or whatever okay so the idea is that whatever name is represented over here all the commands will be run at that particular folder only this basically means you are in this folder a visual representation of this is what you see on the right hand side okay if
you want to make changes in like your downloads folder or whatever you will step into the downloads folder so for example if i create a new folder over here mkdir folder okay where is it going to create the folder where you are running the commands and where am i running the commands right now in the home directory so new folder will be created in home directory okay but what if you want to create a new folder in the downloads folder how would you do that in the graphical user interface i will double click in it
and then i will do it so first i will enter into the folder and then i will make a folder so this entering into the folder is known by change directory change directory all the directories that you see over here so for example downloads i want to go into downloads now it says downloads means all the changes you will be made will be made in download so mkdir make folder make directory older now the folder is made in the downloads folder see downloads folder this is what i wanted to explain it to you like what
does it mean by when i say downloads it written over here it means that you are in that folder right now all the commands will run in that folder okay so for example if you're in downloads right now and you say list it shows nothing because i just removed a folder if you're in downloads folder and you're saying hey now i want to change directory into a pictures folder you say change directory into pictures this will give me error it'll be like hey you're saying you're in downloads folder from here you want to go to
pictures folder i'm not seeing any pictures folder over here go back first for back if you want to go back a folder you use dot dot and now you can do cd pictures that means like this and then like this okay so speaking of again like if you just do cd you will go to home okay just write cd no path but i'll cover these commands like later on as well in detail uh there's nothing more to it this is as much detail as it gets but anyway one thing i wanted to share with you
is how do we know like canal uh you know if you're running uh if you're running docker then it looks something like this kunal ours is looking something different ours is looking like this yours is looking very pretty with like the color and everything and how are we going to you know change that or whatever and when i'm running let's say when i'm running something like python 3 okay it's running the python command right but we know that python is actually listed where user local bin so i can say uh you can say where python
3 so it's saying user local bin python 3 okay so i can say open use your local bin so here you can see this is user local bin this is python 3. so this is the actual executable command python 3 okay so if i write user local bin python 3 or if i just write python 3 it will run that command python 3 also runs the same command same you know program the python interpreter and here you can see that this entire path will do as well internally it's doing the same thing if you write
python 3 it's actually running this one only but now the question is how does it know that it is stored in user local and bin for example when i'm running git okay so if i'm running it it's running the git command okay you can see it's running the git command where is this git file located user bin gate in user bin if i open that folder there will be a git file over here there you go here's the git file there it is it's very small you can't see it but there you go how cool
is that there you go this is a gate file why are we not why is this computer not asking us to provide the entire path this is something that is known as environment variable so what is the environment variable there there are some variables that you need to set right that have some uh let's look into it so basically what an environment variable is that they can affect your like environment as the name suggests so basically these are just named values that are used to change how the you know commands and like processes and everything
are executed cool so if you ask me about kunal commands we know what you mean by that but what do you mean by like a process any instance of a running command will be known as a process okay so basically when a command is executed uh there may be you know like uh the user must wait like for some process to finish before the output is returned or whatever so during that point they can like issue more and more commands and things like that we'll we'll look more into like uh later on but basically uh
we've covered like processes in the networking bootcamp as well so make sure you check it out but the basic idea of environment variable is that it will change how the commands and processes are executed so for example there's one environment variable known as path environment variable i can echo it echo basically means display so i can say echo path environment variable so as you can see user bin is located over here user bin so every single path these are just file folder paths is separated via a dot dot a colon or whatever you want to
call it so basically idea is that whenever you write a command whenever you write a command open command where command git command docker command python command or whatever it's first going to check the path variable it's going to be like hey does the executable file that you are trying to print exists over here in this folder python libraries folder let's say you're doing the git commands i'm like no it does not okay does it exist that is exist over here it's going to make no it does not okay does it exist in this folder uh
no it does not okay does it exist in let's say this folder i know it does not uh okay does it exist in this folder yes it does so it's going to run it that's how the computer finds if none of these folders consist the command here every command echo is also a command if you say where echo okay so it's a built-in command in the home bin directory okay so if any command like something like a random command i can give something like this this is not a command so you're going to check it
over here it's going to check it over here then here then here it will not find it error command not found commands are just like these executable files okay and this is what are environment variables something you sometimes you want to may store in your development environment like uh you want to store some uh you know um some some files or something like that right you want to store some uh some not files passwords secrets that you don't want to hard code in your source code so for that you also use environment variables and things
like that okay cool one more thing i want to share is there are some bash files we'll dive deep into this when we do like uh you know um bash scripting but for example when the terminal is loaded how do i know that this color is needs to be set and this theme is needs to be set and all the commands and everything that it's running which shell it's using using zsh how does my terminal know to do that so it might be possible when you learn about linux you'll learn about this in detail that
whenever you open a terminal like this few commands are executed few files are executed automatically these are dependent on dash for example if you're using the the the shell like the the bash cell so you have the dot bash file the the the dot bash profile and bash bash underscore profile and bash rc file okay so i had bash over here so i can say list minus a minus a basically means show me all the hidden files any file that starts with the dot is hidden means you will not be able to see it over
here so here you can see there's a z profile okay because i'm using z shell so here you can see if i just try to see what's what lies in it if i just try to see what lies in it cat cat basically displays so you can see here i can see aliases and exports and everything and so many other things i mentioned over here okay there's one more thing mentioned uh known as like your uh theme themes are also mentioned over here okay so let me just show you theme there you go if you
go to this url you will see all the themes i'm using robin russell so this is also an environment variable capitals okay if i go over here i'll be able to see it the themes over here let me show you okay so here you can see i'm using robin russell if i change the value of this to af magic then my shell will look something like this otherwise if i change this to af a fouler it will look something like this okay so these are the commands that are run alliances are what alliances are nothing
but uh shortcuts something if you're saying git push origin main okay so get push origin main you wanna let's say you create a let's say basically you are creating you're writing long long commands again and again it may be possible to have just a shortcut command for that those are known as aliases those are also saved over here somewhere okay alliance like some something like this this is commented out right now there's a one more one more folder where all these files are i can say cat in the etc folder there is a zs hrc
there you go okay so ps1 is another environment variable that is used to do what uh used to add information to your uh particular this thing the shell okay the command prompt so percentage n basically means new line okay percentage h it will sorry dash h it will show like the host name and stuff and uh if you want to just always let's say whenever you log in you want to see the working directory which i am doing right now for that you can write dash w w for example okay so these are all the
special characters and stuff so using the ps1 you can basically um change it okay customize it accordingly so make sure you check it out and uh that way you can you can do it all right so there's one more known as a z profile so i'm using z shell so there's like all these files z profile is available over here right so it's saying system wide profile for interactive logging csh logging shelves okay so here's a dot z profile it's basically overrides uh user specific uh things that you put over here that will override this
thing okay so i just say cat this thing so this basically has the original c the path variables and everything are set up over here so these are like system wide over here if you want to have your own user specific you can change the etc z profile file so these are just bash files you don't have to worry much about it uh you should not be having any doubts because these are just files where you put all these path variables and stuff now yeah next question kunal you mentioned about setting environment variables and all
these other things how do we actually do that where are these environment variables being saved so in files like uh z profile and if you're talking about like bash files then you may be seeing something like the you know dot bash underscore profile file will be there and uh dot bash rc file will be there which will be used for like non login shells so basically it's a sub shell of uh of the terminal folder so for example if i write bash over here so here now i'm running bash but here i'm running zsh these
are just types of shells okay using the default interactive shell is zsh and you can update it as well if you want cool so apple is now by default using zsh okay so that's basically about it so if you're using bash you can check out batch rc file and something like that i just want to mention to you so if there's anything like you're using me even or whatever and you want to you know to include like okay the always include like java path or whatever so you can just edit this file you can go
to vim and you can edit this file you can say whim edit this file here you can include it in the path variable export path basically means it will be exported and it will be used like in the command prompt okay so basically you can just add stuff over here and add it over here you can see that it's actually over here uh it's it's saying that this is my new one okay this is one path colon another path colon the existing path okay because path variable may be also available in some other uh files
right the system wide files or something like that that's why it's saying okay remaining one also added over here that is why when you echo path you exit out of it oops so here you see this is the first one so this is the first one after this this one that you see is the one that is located in some other file which is this okay so that's basically about it and uh check out these files like oops library did not wanna i don't wanna change that that looks good all right cool so whenever this
happens like whenever we install like new applications and command line tools we would have to add these things okay we would have to add these things okay instead of adding it like in the files you can also you can also do something like export my path is equal to something like kunal or something environment variable okay my variable i believe i would have to do it like this and then i can say echo my path so your own environment variable you have set but this is not permanent okay when you close it it will be
gone okay when you close the terminal it will be so right now it's not showing anything so so it's only valid for this particular session all right so that was just like some basics of it and uh now let's look at you know um some uh more practical stuff like how do you work with your terminal and uh some of the important important commands and uh something that's gonna be useful to us more practically okay so now let's start with you know working with commands the first one is very simple one print working directory it
basically shows you know which directory i'm in right now so i'm in my users uh the kundalini desktop folder there's a tutorial folder so i'm in that all the commands i execute right now will be done from this so for example the next command which is list all the files that are available in this folder can you see any files in this folder no so it will show empty ls empty cool one more thing i want to share is that you can add tags as well arguments as well so list all the hidden files for
example so for that you can say dash a so you can see this this is one hidden file over here what is this dot and double dot dot means current directory and double dot means previous directory okay so these are also parts that are mentioned that's why they are mentioned in blue color okay cool so let's go to like some other file so over here let's try it out in the main folder okay so i can say ls let's say it shows this thing but if i say list dash a it's actually going to show
me all the hidden files also these are all the hidden files as you can see okay there's one more if you want to see more information you can say ls dash a so sorry dash l the l argument this is basically going to show more and more information okay there you go cool so it shows the users and the group owners of the file the size and the date information and everything okay yeah like the permissions and stuff mentioned which we'll talk more about later and everything okay read write execute delete so and so forth
okay um you can also combine so i can say list all the hidden files and also long details so now you have long long details for hidden files also okay cool these are all the folders in the home directory that's true all the folders in home directory so next command we already looked into it change directory if you want to go into some other folder so i can say change directory into downloads tab and that will autocomplete so now you're basically in downloads okay download is empty right now cool so this is change directory so
there's one more thing known as like relative path dot means the current directory dot dot means the previous directory okay so if i say change directory into current directory only nothing will change it will be staying in that one directory if i say change directory into the previous directory it will go one back what was one back one back was actually this thing home okay sound good if we take one back again it's basically in users root after that no this is a first folder okay cool so if i'm doing something like home and if
i'm doing change directory downloads so now i'm in downloads and i want to go let's say back to pictures so what you can do is you can say con change directory in the previous directory there's something called pictures now you're directly in pictures okay previous directory pictures okay so you can say this is actually a very like pipe okay my photos library cool that's basically about it right um yeah and you can also power pass a path over here okay you can pass the entire like path over here as well home or whatever applications and
so on so forth okay entire path you can also pass okay so one more thing i wanted to share with you is uh if you do list uh dash r so it will also show all the files that are in sub directories so for example um i go to let's say let's say we try to see what's in library okay that sounds good i go into library and i say list all the files that are available over here that's fine um list all the files that are available in him there's only like one file so
let's see if i go into the helm folder so i say list all the files that are available in hem folder all the recursive as well like folder inside of folder inside of files or whatever so as you can see in the plugins there's this in the plugins there's one more called helm date tree because i was working with daytree and you can see um this particular folder has one more folder has one more folder which has all these files so all the sub directories are also listed okay cool um there's one more thing there's
uh there's one more file that is known as a very handy file sorry a very handy command which is known as cat command okay so cat is basically um short for concatenate and it's uh it's used to you know list all the contents that are available in the file in the standard output okay so for example go into this folder i go into this folder want to see what is written in plugin.tml okay i want to see that so i can just say you can either open it or you can say cat plugin.yaml so it's
just going to list all the things that are listed in the plugin.eml okay if i write something like cat something like hello so it's going to create a hello file okay my name is kunal so it says my name is cool so that's basically it and uh here you can see what happened was that you're saying this this basically is known as like output where do you want to output it so i'm saying cat hello it's saying hello does not exist so it's creating that okay and after that whatever you're writing is being written over
here okay if i just delete this if i say cat pile dot txt sync file.txt file created okay now write something like my name is kunal it's actually going to be written over here you can see this file.txt file contains my name is kunalinit all right you can keep writing my surname is or whatever when i click enter if i just do if you want to exit out of something you can do control c okay now if i just try to print it catfile.txt it says my name is okay so it did not take the
one that was like in enter and that's why this is not like the way to do it i'll teach you how like you can do it in a nice way in a better way but one more thing i want to share is let's say you create another file say cat 2 dot txt thing like this and you add something like i am a teacher or something like that you move out of it say cat2.txt so it contains i am a teacher basically if you do something like this cat pile.txt and as many files as you
want let's say i'm putting two files put this into a third file total.txt so now if i print total.txt you can see it contains both the file contents so if you want to merge all the contents of one or more files you can say print whatever is in this so i just do something like this it's just printing it first is printing this then it's printing this i'm saying okay you are printing it it's fine if you just put it like this it will print it in the command line but i don't want you to
print it into this i'm saying put it inside a new file so this funnel thing basically means like you're sharing the output to something else okay so for example you had something like echo command okay echo basically prints whatever you say so i can say hello world it's printing hello world but i don't want you to print it over here i want you to print it over in let's say file.txt if i cat file.txt now it's overridden or it's totally replaced by hello world okay so i hope you are able to understand the meaning of
this symbol cool all right okay there's one more handy command known as the man command so if you wanna know information about a particular command you can say man let's say echo so it's saying it writes arguments to standard output you can provide some strings or whatever or something like that okay cool i just press q to quit it so one more thing i want to say is that if you have something like let's say cat file.txt it contains this so you can also tunnel okay you can also tunnel so basically cat pile.txt this is
going to give me some output i want to use this output okay i want to use this output and let's say i want to translate it like from lowercase to uppercase so there's a command known as translate you can say man pr what does tr do translate characters so it just translates the characters string1 and string2 what does it contain you'll have to put uh the characters in string one and string two okay so you can see all these are the special characters and everything that i mentioned over here as well let's try it out
so i can say catfile.txt okay don't print it actually do something with it so translate all these smaller cases to uppercases and let's say we store it in a new file called upper.txt now if i press cat upper.txt all capitals very simple right so this is known as like tunneling okay so i call it a tunnel but it's like known as a pipe so basically what is a pipe pipe is basically that the output of the first file okay it's basically going to act as the input for the second file sorry the output for the
first command it's going to act as an input for the second command all right and this one is known as redirection so it's basically used to redirect the output automatically it will print on the command line i'm saying no redirect the output to a new file okay that's basically about it there there's another other other commands as well like for example if you wanna have large command okay you do realize that if i say list if i just say something like this only cat pile.txt okay and i wanna add a new command but in the
new line if i press enter right now it will execute it but i don't want to execute it i want to add a new file new command in a new line for that you can use this concatenation now i can write new command over here okay so these are basically known as like how you can chain various commands and i'll do like a dedicated tutorial on this on in this video itself let's say let's say we will do it afterwards uh but that's basically about it okay let's move forward okay now let's learn about how
you can like create files and folders and you know rename files and move files and delete files or whatever this is an important one uh let's see right now we have four files that's uh that's nice and we're in the tutorial folder let's say i want to create another folder over here so i'm i can use the make directory command dir make directory and i can say test so a test folder is created now sound good so that's the make directory come on you just put the path and that's where you can get it if
i say make directory you know um random hello so what is happening it's saying that random does not exist so what you can do is uh you can say something like mkdir random cool and then you can say mkdir random hello so now you can see inside random hello directory will be present okay so let's say we have the random inside that we have hello and inside hello we create another folder called testing okay or i can say something like inside hello okay something like that and now what i want to do is we are
inside we are here random and hello and we have inside hello so we are right now at random and there's one known as hello inside it what if i want to create a middle one over here for that you can use the dash b command so i can say mkdir dash p which is the parents command okay so we can create a directory between two directories directory means folder so what happened over here a middle one was created so random inside random a middle was created inside middle will be having a hello okay but the
original hello will remain as it is this hello will remain it's not like it's moving okay it's not like it's it's like moving somewhere or whatever okay this will remain here and here we have middle hello cool all right so that's the make directory command okay so if you want to create files for example right now i'm in my random uh not random let's see we are in tutorial right now i'm gonna create a new file okay for that there's a touch command touch something like uh names.txt if i say touch houses inside let's say
inside test folder i want to create houses.txt so inside test folder i'll be having houses.txt okay so that's the touch command cool you can also open these up you can use the open one in the you know in mac if you open and just write a file name or a folder over here okay so you can open it as well if i say open current directory it's just opening current directory okay you can open files and stuff as well all right uh the next command is the copy command you can make copy of files so
i'm in my tutorial let's say right now for that i can use the cp command i can say copy file.txt as a copy pile.txt so you're going to make a copy of it okay all the contents that were available here will be available over here if i just write some contents over here if i say echo hello world inside file.txt now if you print file.txt you can say it says hello world now i make a copy of it and i say print copy file dot txt that also contains hello world okay so that's the copy
command obviously there's so many linux commands and tools and stuff you know that we are going to be looking into so we're going to cover like a lot but one more thing i want to want you to get out of this session is that uh try to explore yourself there'll be so many commands that you will find find you know that we might not cover and so many commands that will come on but for getting started we are covering the most important basic ones and also with like we'll also cover some devops related commands as
well okay so the next command is the move command as the name suggests used to move files around so mv and by the way you want to check out you know what every command does man mv okay so it used to move files and as you can see all the arguments and stuff what all the flags do right well all the options do so if you wanna don't want to overwrite an existing file you can use the dash n okay so so many tags are available as well all right and source and target and directory
or whatever okay so let's try to do it so i can say move names.txt inside random moved okay names.txt is now inside randoms if you do something like this if you say move file.txt to you provide another name over here you don't provide a directory you don't provide a folder provide another name you say new name dot txt so what is happening you can see file.txt was removed and a new name was txt was created so basically it's renamed it using the move file you can rename commands like this okay sound good you can use
like wildcard characters and stuff as well that i'll teach you more when we use the find command but that is basically about it okay and if you want to move uh and rename the file at the same time for example then you can do something like let's say move uh if i just go into random okay i go inside random what is inside my names.txt nothing i can put i am in names.txt not cat so echo i am in names.txt put it inside names.txt okay so i'm in names.txt now what i want to do is
i want to move and rename at the same time names.pxt in the previous directory i want to move it as what i want to move is add new names dot txt just add your path along with the name as well new names.txt new names.txt sorry cat new names i'm in names.txt so you can see names.txt file has been moved and renamed at the same time if you want to remove a file you can use the remove command remove um what do you want to remove copy file.txt notice something it will not go in here bin
it will be removed permanently okay so please have some questions on that okay cool now if you want to do the copy command with like directories uh you can uh you can do that as well so if you want to copy let's say another directory uh you know what we what we can do is if i say something like copy um i can say or i can just say let's just look into the cp command okay in the second synopsis form the contents of each name source file is copied to the destination target directory this
is fine this is fine this is fine let's see some tags over here okay so if the source file designates a directory means if you're trying to copy a directory then cp copies the directory and the entire subtree connected at that point means all the subfolders will also be copied okay but in dash r mode cp will continue copying even if errors are detected so we can do this i can say copy my test and random so inside my random i have test now and it copied all the things that were inside it also okay
sound good so all the ones of tests were copied inside random okay you can rename as well if you're trying to move the directory test and just rename it renamed test it will be renamed same thing that happened with files okay if you're in a mover directory you can say move rename test into random now it's moved not copied moved okay and i can say move in the random i have a renamed test move that into the current directory make sense it now came outside you want to delete a directory so you can say something
like remove all the sub directories and everything in it let's say you want to remove renamed test okay because if you just do remove rename test this is going to give an error because remove command is for what files but you are trying to delete a folder so you have to specify hey i am trying to delete a folder please delete the folder okay sometimes it may be possible a file will not get deleted something happens like okay this is open or whatever for that you can say f the f flag okay use the flag
which is force flag okay so that's how you can work with files and all these other all these other okay the next command is the sudo command which means super user do so for some commands you may require administrative uh like uh you know permissions so only the admins they can like do so for example you want to access some important files or whatever for that you have to obviously add your password for that command you can use sudo okay so sudo if i say echo hello world so echo for example is not a really
you know you can't do any damage with that so it's by default does not ask me for my password but sometimes like if you just write sudo um man sudo so you can see uh you can execute the command as the administrator okay if i add it over here because i already in this shell i already had it so i can create new one and here i can say sudo echo hello world so now it's asking me for my password password entered and then command executed all right so an example for this will be coming
like when you actually do some you know administrative work which will be happening quite a lot when we learn about okay and stuff so make sure you subscribe and uh stay tuned all right the next is the df command so df command is basically you can check out the systems disk space usa space usage so you can say df so these are all the volumes and everything that are available going to check it out in a more like you know good manner so here is my capacity that is like four percent is being used and
uh available is this much so on and so forth it's actually showing it in percent and the the capacity and everything is in percentage and the available use of i3 or whatever this is in kbs if you want to see it in mbs you can say dash m that will show you it in mbs okay so you can say man df command so display the free disk space okay so disk space usage is something it shows us um you can check it out in gigabyte like blocks as well so if i say something like uh
it says human readable as well so man human readable oh sorry not this df in human readable format and in gigabytes let's say for example okay sound good so this is almost 2 tb for example that's true it's my my passport which is a external hard drive i have okay 62 gbs have been used okay and this is how much available this is the total one okay so that's the df command similarly there's a du command you can say mandu so it shows the display the disk usage statistics okay so let's check it out du
command okay so this basically shows the disk usage statistics for uh the the files that i have over here so df shows the heart that the drives and everything the storage capacities and du shows the uh one second you go to dash h argument so if you want to see how many bytes it is so this particular one is zero bytes or like oh we don't have anything in it this middle one a random middle which is a folder it's of eight kb's this random totally the entire random folder is uh 24kbs and the current
directory which is a tutorial folder is 52 kb okay so that's the du command cool let's move forward now next is the head command let's see that okay so next we have the head command so head command basically uh it's used to view the first few lines of like any file by default it's going to show i believe 10 but you can change this range with the head let's say if i say let's first write something down so if i say vim something like total dot txt okay i just write something over here i am
kunal and then i can say something like um rahul karan sachin a bit just adding random stuff over here community classroom literary teleport lens sibo battle snake willow right um stream so on and so forth okay i will do a dead as a different tutorial on vim you can double click and write it out to yourself but uh vim is very you know simple to learn like not not that complicated so you can find plenty of stuff online for that okay head uh total.txt so it's displaying the first 10. we're going to say head only
display to me the first four let's say it's only displaying the first four similarly you have the tail command which displays the you know from the from the behind like for the for the last one so you can say something like uh tail total dot txt okay so it's just playing the last 10. okay you can say similarly show me the last two last two okay so that's basically about it so one more uh which is known as the diff command and check it out so it compares the files line by line okay so if
i say diff um total.txt and 2.txt so here you can see that what is happening it basically compares the contents of both the files line by line and it will output the lines that will not match for example okay um okay so sometimes we want to like so you'll be like why do we need this file why do we need this command so often times you know we make some alterations and without rewriting the entire source code we need to see like what are the differences made between two files sometimes we need to use this
diff command for that all right let's move forward similarly there's a locate command that lets us you know finding files i can say locate uh all the files that end with dot txt so you can say star dot txt the star is basically wildcat like anything can come over here so you can have like dot txt files so it's saying all the txt files are mentioned okay if i just copy this file let's say i'm trying to find this so i can say locate this file switching it's in this folder it actually creates a local
like database as well inside our pc or computer like inside a folder and uh you can check it out so any file you want to find you can use the locate command for that okay next we have an important command known as the find command so what is the find command obviously you can find stuff with it okay so if you just write let's say simple stuff find in current directory all the things mentioned in the current directory you have found okay so if you want to find in the parent directory in the previous directory
all the things that we have found in the previous directory all right so that's basically about it and no not really we can find like in particular directories as well find in the random directory in the random directory all these files are present even hidden files it's showing me all right so that's uh it's pretty cool okay now what if you want to find all the directories and not the files for example so you can say find in the current directory type should be a folder or a directory so now middle is a folder random
is a folder hello is a folder test is a folder hello is a folder in random and hello inside inside hello is also a folder so now it's not listing me the files it's only listing me the folders similarly if you want to find all the files and not the not the directories you can use the f tag so now it's showing me all the all the files okay cool so that's basically about it and if you want to find uh files with like particular names or something so find in the current directory type should
be file and the name should be something like let's say 2.txt so it's saying in the current directory there is 2.txt okay you can also find all the files that start with two for example to star two dot txt you can also find all the text files star dot txt star basically means what star means everything can come over here wildcard so anything can come over here dot txt okay so these are all the files all the text file it's listing okay sound good if you had a text file in random as well uh some
file dot pxt then also you print this it will show all the files in random also we have some file.txt in current directory we have this or what okay so that's basically about it and uh one more thing is that this name is not case sensitive sorry this name is case sensitive but if you don't want to have case sensitive then you can have i name that will not be case sensitive okay you can also find files on the basis of like dates so you can say type is file and min dash 20. so basically
so basically all the files that were modified uh less than 20 minutes ago show me that so all these files were modified less than 20 minutes ago similarly you can do something like plus 15 so all the files that were modified more than 15 minutes ago okay sound good cool so m means modified more than okay that's fun uh you can also combine this you can say find that was modified more than two minutes ago and let's say less than 10 minutes ago so there is no such file that was modified like this okay cool
and you can also add days over here so you can say find in current directory type is file uh you can say dash m time uh minus 10. so that was modified less than 10 days ago all the files because i'm just started recording it right now okay cool um you can also use like uh you know um for seconds like uh two for like minutes and days as well for that you can say you can say man find and add like minutes and days you can also use regex and stuff which we'll talk more
about later okay so here we go b min b new b time okay a min a time and m min ac mean or something like that okay so so many stuff over here okay so many stuff you can use like c min and c time and stuff so c min is for minutes similarly you can use c time for dates all right um you can also say something like that only find the files that are in the current directory and not in the sub directory so you can say find in the current directory type is
equal to file and you can say max depth is equal to 1 so now it's only showing files in this directory it's not going recursively if you want to allow one more subfolder you can take max step is equal to 2 or something like that you can also search by size you can say find in current directory uh where the size is let's say 1 mb there's no such file like that so i can just say k for example more than 1 kb so these are all the files that are more than 1 kb similarly
g you can use for gb and m you can use for mb again you can use a minus for uh like less than okay very very simple stuff you can also find some files that are empty you can say find in current directory all the files that are empty so these are all the text files that are empty very easy okay we'll learn more about permissions later um so read write and execute permissions or you know things like that um so you can also find files based on permissions you can say dot permissions read write
execute so all the files that have read write and execute permissions there are no such files there are no such files but read and if you do something like okay and when we're talking about files we obviously have to talk about permissions so there are three types of permissions read write and execute okay and the three types of people like who are using your computer one is the user the user can be any single person an account on a computer whatever you have many many users uh second one is like a group so a group
is basically like uh a particular like entity so for example uh in a particular user there can be many groups like a pseudo group so that's the super user okay and the last one is others means all the other people like yes or whatever so read write and execute for these three particular folks you'll learn more about this when you explore the linux file structure but let's say i want to change 2. ext i want to see the permissions or whatever or of upper dot txt so upper.txt so for three people it has right now
read and write permissions for for group it has read permission only for others also it has read permission only upper dot txt you can change it in two ways first is you know the alpha numeric characters so you can say you can use the command cs mod chmod you can say user read write and execute group read and execute only and others only read for example only read for let's say upper.txt there you go sound good cool so one thing i want to mention over here is that uh you can also use uh you can
also use like um the numbers okay so basic idea over here is that it's gonna use uh octal numbers so digits from like zero to seven uh if you if you're not aware of like binary numbers check out the binary numbers uh tutorial that i did so basically i can say chmod three numbers so if i say 777 and then i write upper.txt so read write execute read write execute rewrite execute to all is basically what happened what is this 777 so this basically means user group and other okay it's divided into three categories read
write and execute so 4 stands for read 2 stands for write and 1 stands for execute 4 stands for read 2 stands for write and 1 stands for execute so if you want to have let's say read and execute permissions so you will have four plus one five okay so if you put five over here so you can see read and execute permissions only why because read is 4 execute is 1 and write is 2 ok and 0 stands for no permission 0 stands for no permission okay so i put something like this 0-0 no
permission to rest of the groups okay so i believe you are able to understand what this 777 thing represents this is for every particular type of person uh user group or user group and other and each seven is made out of four plus two plus one so if there you write something like just 4 it means that you will only have read permission if you write something like 1 and you will only have execute permissions if you write just 3 so you will have 2 plus 1 write and execute permission so on and so forth
okay so that is basically the idea you can learn more about chmod you can say man mod change file mode access okay let's move forward okay similarly you can also change the user so for example if i say what are all the current files users sorry not users owners so currently which is my like account name so you can check you who am i which which person you are logged in as i'm logged in as my user like if i want to give this new names.txt file the access to let's say root okay so i
can change owner c-h-o and root to i would have to add sudo in this so let me try this change owner root upper dot txt it's saying operation not permitted because you're changing root permissions so you would have to log in as that sudo there you go so now if i do this has root permissions okay so root user has this permission so i say cat upper dot txt permission denied only root person can have it okay cat i can say sudo cat upper.txt now as a root user i can do it so you know
what this group is right so this is like the owner owner sudo is the group other means other i hope you're able to understand the difference between three so now when i write sudo over here it's basically running a command as a different user if i don't write sudo it's running the commands as the current user who is the current user who am i kunal kushwa okay so only root can have permission and sudo is the one that allows us to run as root that's change owner command some folks may have known what is root
we don't know it so it's pretty simple it's like the super user account in the unix-based systems and um you know they're like posix systems and it's basically used for administrative purposes and has the most highest number of access rights in the in the system all right cool and it's called root as you may know okay so i can say something like uh if i'm setting the permissions where did it go change mod of upper dot txt let's say 777 ah sudo okay now basically i want to find all the files whose permissions are let's
say 777 upper dot txt has all the permissions to seven seven seven okay cool there's one more thing i want to show you is that if you find a few files you say you find in current directory type is file and name is let's say all the text files you find all the text files and you want to do something with these test files okay so you want to delete all these text files so you can say something like dash execute okay now here you write your command remove after that you add a placeholder okay
so if we were running this command on like a normal file or directly like remove this file or directory we would put like the name of that file and directory and stuff after the the command that we have written okay but since we are using the find command we have to so for example what do you do you say something like remove dash rf file name after it you will write it but since we are saying okay we don't have the name right now the name we are actually getting from the find command for that
you have to add a placeholder like this plus plus basically means all the commands all the outputs you'll be getting they will be running this command on that output so when i ran this particular command it showed me these many files so all of these will be going into this placeholder plus this thing plus this thing plus this thing so all of these files will be deleted from my system if i run this command done so sometimes you may want to rename a lot of files together something like that um you can use the dash
execute exec tag okay so that's basically about okay now let me show you another important command this is a pretty pretty useful one um for that we need some text files so i'm just going to create some i'm going to say touch names.txt and let's say surnames.txt or something like that okay and i can say companies.txt okay so let's say i put in names.txt i say canal [Music] for now okay and i say in companies.txt i put something like uh co community classroom dirty teleport lens um google amazon um battlesnake twilio elastic etc etc just
some random companies okay so grab basically means global regular expression print okay and it allows us to search for some text so right now you've learned how to tell how to search files but what if you want to search for things written in the file for that you use grip okay very handy command so it allows us to search for like some text within our files in our system and it's case sensitive okay so um we can see like the version of grep you can say grep dash v so in here uh bsd graph we
are using it's a version of grip mac uses the bst graph linux usage good uses gnu um and you can see the version using this okay cool so we want to search something in files all right uh so let's say you want to search for kunal in names.txt it's available over there okay so it's basically going to print names.txt okay let me add you know the complete name or no okay but if you want to search the complete word so let's say you want to search the complete word then you can say something like grep
dash w complete word that is available in search for that as well because right now if you just search for let's say kunal kush this will also show if you don't add the complete word kunal kush is present but if you want it to be a complete word kush is not a word kushwah is a word that's why over here when i said print the word kunal kush it's saying no nothing exists like that is there kunal kush is not there so kunal with word is there kunal kush as a word is not there okay
so that's basically about it and if you want to be uh like case sensitive okay not case sensitive for example if you say grep lowercase canal in names.txt it's not showing it but if you add the tag dash i then it's showing it now it's not case sensitive you can also combine the words like no combine the tags not case sensitive and should be a word okay something like that okay so what if we want to find a line number so you can say grep show me the line number say kunal in names.txt kunal does
not exist kunal exists in line number one okay if you say show me the line number for approve in names.txt it's saying line number three apoor exists okay so that's basically about it you can combine these as well you can combine all the three okay all the three tags we learnt um there we go all right so that is the grep command you can also see like a certain number of lines that come like before r so before the match that we are making so if you say something like grep dash b something like three
and then you say rahul names.txt so it's also going to show the previous three lines that come before rahul all right cool but here i know that it's names.txt what if i don't know that rahul exists in names.txt whatever i want to search for every single file that is available for that i can say gap grep let's say rahul in the current directory all the files there's nothing to stop here my siri went on not sure why never mind that so grep rahul in the current directory all the text files so you can see names.txt
in line number four we have rahul okay you can also search recursively you can also add like the recursive tag in directories also if you want to search in directories you can add dash r over here so for example if i put names over here and i remove this so right now it's not showing anything but if i add the recursive tag in the current directory now we are seeing it okay if i remove the recursive tag then we are not seeing it okay so using the recursive tag you can check it out okay so
let's move forward you can also check out what files contain these matches so let's say i say with the l tag okay and i say kunal in the current directory so you can say in the randomnames.txt contains this file all the files that contain kunal will be available over here okay you can also count how many files are available that with that contain kunal so you can see names.txt file it appears one time and the rest it appears zero times okay so that's basically about it you can also pipe the output of like one command
into other commands in grep so you can search for like the history or something like that so if you check out history history if you check it out it's going to show you all the history of all the commands that we have been using but you say history pipe grep let's say something like just grep something like let's say which command list command something like that okay so here it's showing the history of all the commands that were list commands okay can you see all the commands that were like this showing all the commands that
were like this this is known as like piping i'll teach you more about this later like how you can join its stuff so this will be doing in the end um i'll show you in in detail how this works okay cool but i've already taught you about piping uh in the previous lecture and sorry in the previous uh part of this video so i believe that should be that should be clear okay you can also use regex to search so you can say grep dash p and here you can put your regex names.txt okay sorry
capital p here will go your regex red x means regular expressions you can also use the regular regular expressions command so regular expressions are basically just like you know they match a particular pattern so if you want to find all the emails or you want to find all the phone numbers or whatever so you can say grep dash pp basically means that pearl compatible uh uh regular expressions so basically this is going to work um you know um let's let's let's check it out so if i'm trying to find all let's say the words in
companies.txt there you go okay if you're not if you're trying to search for like phone numbers in linux i believe it's capital p here i will use small p but uh do check it out so four numbers so you can say the digit uh like three digits over here then a dash again three digits over here then a dash and again four digits over here okay dash t means so i'll do another video on like regex later on right now it's not that important so you can google it about yourself okay so that was about
the grep command you can also set up aliases like i mentioned alias if i write so these are all the aliases that i have available right now okay so uh gup is get pull and rebase or whatever so l is basically ls and all these tags and whatever md is make directory okay in like the dash p tag that we already learned rd is remove directory so where are all these things available so you can check out you can say touch your sector z z oh sorry why am i doing touch i want to do
cat okay so it's it's somewhere like i believe in the home directory i'm using z shell so it will be z profile using bash it will be what bash rcn bash underscore profile okay zsh rc it contains some somewhere over here okay alliances you can set over here somewhere but if i talk about like z profile if i say vim z profile i can put some alias over here so the set the the i can say alliance g palm is equal to get push origin main i'd have to open up a new one okay git
push origin main is running it's saying it's not a git repository that's why it's giving an error but you can see that the command is running okay git push origin main command is running so this is basically how you can set aliases if you set an alias over here lis something is equal to some command then it will not be permanent it will be only for that session okay so that's basically what alliances are using like uh linux and stuff so you can check out your own bash rc file and stuff like that um so
if you put that line over here and path variables over there it will work perfectly fine you just have to restart your terminal okay uh let me show you some like tips and tricks as well before we move on to some other you know not so basic command these are like the basic ones so if you're writing something like gate push origin main or something like this okay and you wanna clear the entire thing or if you wanna let's say not that um if you wanna do something like let's say you want to move to
the beginning so you can do dash dash dash dash or you can do control a control a you will move to the first of the so you can see my cursor is now at the very first start if you want to move to the end control e we will move to the end and uh you can also do something like you want to remove everything let's say after the cursor you want to remove main so you can say control u sorry not control u get push control k i believe control k will remove or everything
after the cursor will be removed control u will remove everything in general for autocomplete you can use something like tab okay a tab is used for auto completion um you can scroll through like various commands like using the up and down key this is very standard stuff previous commands and you can also run previous commands if you just do something like uh history okay so in history you have let's say command this one 2747 you want to run this command so you can say exclamation 2747 so it's going to run that command okay it's going
to put it over here then you can run it all right so that's uh how you can do it from like history if i do something like this so it's gonna run the previous find command what was the previous find command that you had okay so it's gonna run that one um that's basically about it i think and uh you can also search for commands using control r and now you can search for like the previous commands like this where was ls used or something okay so ctrl r you can search previous commands gate where
gate or whatever i've used okay so that's basically about okay let's say you have run a few commands ls something like that you want to clear the entire thing you can use command l i believe uh sorry command k in mac and you can you control l like it will clear the entire screen in your like linux and windows and stuff so if i do command k as well in mac it will remove everything command k remove everything or i can do clear clear command can be used as well one more thing i want to
show you you can use multiple commands in a single line using this okay so if you say get add dot colon git commit minus m message colon gate push origin main you can see three commands are in the same line using so one by one they will be running right now it's gonna say that it is not a git repository so it will give me the error but if you wanna learn about git uh make sure you check it out the the video i did it's pretty pretty interesting all right people are loving that one
okay so that those were some like uh shortcuts that you can use now let's look at some other commands so this one known as the sort command if i sort it in like reverse order so basically if i just say sort in like reverse order companies.txt it's going to print me all the companies.txt in sorted order we just want to see all this all this is the original order but if you want to see that you know sort companies.txt if i just write that let's see it's displaying it in a sorted manner dash r means
reverse sorting okay there's one more flag called dash f so this basically uh this cares about like incense this case uh this just case insensitive sorting okay so not case sensitive and there's one called n so this basically you can see it also it it it will basically return the results uh in the numerical order okay so we have numbers and stuff so you can use the n1 okay cool okay the next command is the jobs command it basically will display all the current jobs that are you know running along with the statuses uh so
basically what is the job a job is a a process that is started by the shell so right now we see that there you know none are running and the next one is the ping command we have seen this in like the networking course google.com okay so basically for your connectivity status you can uh use this command and it's basically going to connect us like to the server and get all the information so what are these tags time to live and sequence numbers and everything we have covered in the networking course okay you can also
use the uh the wget command so if you just check out wget so get basically means that uh you can download files from the internet using wget i believe you would have to download it yeah command not found wkit so if you download it you can download it okay so i can do something like blue install wget it's gonna install that it's gonna update it so while we're talking about this you may have heard like in linux you write something like sudo apt-get install or whatever so app cat is basically like a command line tool
that will help you in uh you know handling packages in linux and stuff and it's just going to retrieve the packages and install it so you have like so many package managers you have like uh you know there's there's yum as well if you're using centos or fedora so you can use sudo yum install w kit so these are like package managers and we can talk more about that as well um you can you can learn more about it and uh you can so you see this is you know red hat package managers and so
many other package managers that you can check out cool so app is there yum is there and rpm is there for example right debian package manager is there cool so it's installing it and downloading it so using wget we can download any file from the internet okay so till that time i'll just find a url so i can say simple pdf file url this is a simple pdf file try to download that okay so you can also you can use all the like commands and stuff like you can use all the flags and download it
like you know uh save it for a particular name now it's installing it i think that's done okay so in the tutorial i can say wget url and it's downloaded the pdf file how cool is that that's it pdf file downloaded as you can see over here this one as you can see okay you can use a man wget command so you can see that here it will show you all the tags and stuff that you can use with it okay all the tags and stuff that you can use with it okay you can say
wget dash o or circle and you can add a file name like my file dot pdf url i think it's uh oh i think not circle yeah output so myfile.pdf is downloaded all right so that's basically about it you can also use the uh you know the top command in order to find like what all processes that are running and how many cpu usage they are consuming so top so you can see all of these processes are running obs is running right now safari is running my item is running finder is running so many things
are running right um this is the process id this is the percentage of cpu it's taking number of times it has been up and like threads and stuff and all these other things are mentioned over here this is like in total 413 processes are running why is it important because sometimes it may put also port numbers okay and the memory so everything is mentioned over here so if you check out like something like let's open something like um like to-do list is a to-do list is running safari is running copy this 475 okay so if
i just do something like this so this is a top command but if i do something like kill process id so it's going to kill this it's actually going to stop it so kill can be used for that okay i'm not going to do it because i don't want to close it over here in my system right now while i'm recording so if you use the kill process id command then you can do that so that was the top command let me open up like ubuntu over here docker run ubuntu here if i run the
top command here you can see that it is only showing two processes okay but in reality on this computer so many processes are running so this is a little bit of a teaser for future so the container has no idea about what things are going outside of it okay so a little bit of a teaser okay you can use the you name command as well okay so ubuntu is using which kernel linux kernel so basically it gives you information about your linux system so here it's saying that linux and in mac what what is the
like kernel that it's having like what is it darwin okay okay so what is darwin darwin is an like a unix-based operating system that is being used in macbooks until we all know ubuntu is what ubuntu is a linux distro and it uses linux so here we have linux over here okay that's basically about it okay you can also zip a few files into a particular you know compressed version so if i want to zip for example uh files dot zip and i wanna zip let's say companies.txt okay so this is now zipped want to
say files to zip companies.txtn let's say i have files.txt so it's adding both the files into files2.zip i can unzip this as well i can say unzip files to dot zip okay ah it all it already has it so it's asking me hey uh the files that you're trying to unzip are already like available over here so what i can do is i can either say like you want to replace it i can say yes sure replace it um yeah or i can just quit right now and i can say something like i can put
it in random okay go into random and i can say unzip piles2.zip so you can see unzipped two files are now available to me how cool is that all right so that's the zip and unzip command okay the next command is the host name command so i can say host name it's gonna give me like the the host name and it's basically used to obtain like the domain name system name like the dns name and you can also get information about this domain so for example you can get information about the you know like your
own host or network right um if you just write let's say a tag of i over here this will give you the ip address for this okay so this is the ip address of my like whatever docker container or whatever things i'm running okay so you can use a lot of tags in it and uh work with it so yeah that's basically about it and uh you can do the man hostname command and see what all various tags are available for it okay and since we talked about like different like users exist so right now
this one is let's say uh this one so if i say something like i want to add a new user for example so i can use the command user add something like uh user so now i've added a new user i can set a password for this i can say password set for this user i can say one two three four five one two three four five so now a new user is added and a password is added for them as well okay so you can use the user command you can also delete the user
i had one user created kunal so i can say user delete kunal so now kunal is deleted if i try to delete it again it says kunal does not exist okay so that's basically about it but if you're talking about the these user commands and things like that you you may you may feel like let's let's see if there's like a way to find all the users that are available or check all the users or information about those so let me first tell you like some of the commands related to like operating system and system
so if we talk about let me just remove this if i talk about you name so it's saying it's you know saying the linux kernel you want to check the type over here so it's saying gnu linux okay if i check the architecture i'm using an m1 mac so ah arc 64. okay it has over here uh if you want to check the kernel version you can get the kernel version as well okay um you can get the other stuff as well there's a etc it should contain an os release so here you can get
all the information about the operating system sound good you can also get the cpu details you can do something like ls cpu so this is all the cpu details okay sound good but if i add a new terminal if i run it on my ls cpu the command not found for this i'll have to install it nevermind so here you can see the cpu details obviously these are the ones that i have assigned it to it so i've assigned it to two cores so it's saying two cores okay uh you can also see the memory
that is free so you can check something like pre-memory okay re-dash h and check it out okay used and free memory over here i'm not having it installed so i'm running it on my docker okay that's also one of the great ways okay you can also check your virtual memory so you can say virtual memory start okay so there's your virtual memory cool you can add some some tags over here let's say i want to display it in mbs and things like that okay so virtual memory and swap memory and everything mentioned over here don't
worry about like what these are right now you can google but later on as we go we will obviously cover these things in detail okay okay and similarly if you're talking about groups then uh i can check out id over here like this so this is having own id okay my own like kunal kushwa has the id of you know 501 or something like that okay um so you can use the id command as well if you just say add some tags over here so this is just going to print the id and if you
add it like this it's going to print all the group ids okay and if you just do r it will uh in default format it may not be able to print but it's basically used to print the uh the the real ids instead of like these numbers and stuff so let me show you one more thing uh let me show you something like uh you already checked out uh about about users right so you can use the this command you can check out the user if user exists so canal exists or not it does not
exist but does user exist yeah we created it and the id that it gave it to was 1001 okay you can also set the password oh we can get the get the information about that okay inside the password using the wget command that we had like uh you know previously okay um you name command yeah user add command sorry the user add and user password password add this command password so this is what you can use to set the password okay um you can create like new groups and stuff and you can check out the
id of it as well so id of user if you want to check it oops id there you go okay user id group id and all the groups and stuff okay okay and you can also list all the open files you can say lsof okay so this is going to list all the open files so you can say it has your own like uh the file description it has the current working directory over here okay it has the user name okay so if i just put it again and i close it really fast so that
you can see yeah so you can see the process id user is there what is this fd the file uh descriptor basically okay and the type is available over there devices available and other things are available okay so this is how we can use the command okay so all the files that are like currently opened by any of the processes in the system you can check it out over here if you want to check out just for kunal as well so for that you can do something like uh set the user to kunal kushwa these
are all the ones that are available like opened by the user kunal kashwa okay so this is basically it okay let's see some some of the networking commands let's say check for example uh so you can say ns uh lookup we actually covered this and i can say google.com there you go okay so ip address if you want to check it out um for a particular domain you can check it out like that okay um you can also check out like um um so if i'm saying and just look up this thing and i copy
this and i say ns look up this thing that also works the same way okay it's also giving more me the information of this same thing okay and one thing one more thing i want to share with you is like if you want to print let's say all the ports that are currently up like listening so you can say net start okay active foods okay in addition to this one more commands like if config so if you want to learn more about the ifconfig networking command you can check out the networking uh session i did
right so check that out and uh there's also one known as the said command so i can say man said so it's basically a stream editor we'll be learning more about this later on like when we work with logs for example right so when we have some logs then we can work with that as well similarly there's a cut command you can check it out man cut okay so you can cut out selected portions of each line of a particular file okay something like that so you can say something like you can say cut and
you can say dash c you can say one to two for my companies.txt there you go column wise okay so it's saying that basically let's select the first two columns of the files this file company source you can see only two columns are available over here this is pretty handy when it comes to like you know working with the log files and things like that okay cool okay there are other commands like telnet and stuff that you can use to connect to remote host ssh commands uh this is something we looked into the uh you
know um the boot camp uh sorry the uh yeah the computer networking course so definitely highly recommend you all to check out that video if you want to get familiar with networking and commands in that video we learnt a lot of networking specific commands as well okay so the idea is not to like give every single command over here that will be happening as we move forward my firm believing is like only use the comma only learn about the commands that you're gonna use and as we move forward we'll be learning so many docker commands
cube ctl commands so does it really make sense to teach you those right now no this is just an introductory session and i'm basically telling you how things work uh feel free to explore yourself as well and as we move forward as we learn about various tools we'll be learning about various more commands as well okay other useful commands include the sss command so use the ssh username at ip address and then you put your password or whatever so basically when we do kubernetes i'll be teaching you multi-node infrastructures uh for that we'll be using
cevo instances and i'll be like ssh into that so make sure you you know like share and subscribe and uh yeah we talked about like sudo and all these other things you can also learn more about like package managers we learned about like you know app cat and stuff um yum and all these other things and we saw the you know how to use the disk space and everything there's one more command you can check out which is known as edge top it's not available over here let me check for this no i would have
to uh run it so basically the idea is that uh you can check out all the resources that are being consumed for with the edge top command and uh if you you can install it and uh you can check out what are all the processes basically that are eating up all your resources okay so that's basically about it um you can check out ps ox as well so here you can see all the you know processes and everything that you have the process id available over here okay process id so you can use this process
id id to do a lot of lot of nice things okay cool okay so that was about it but like uh commands you can learn from like anywhere let me teach you how to work with like operators and stuff okay in commands how do you combine various commands so first is the and operator so it's basically used to run a command in the background so that other commands can be like executed so if i say ping google.com and ping com classroom dot org there you go okay sound good can stop it over here okay so
what is happening is that it sends like it will create a process in the background so that other commands can be running and here you can see like since this is running in the background you can run like other commands as well it's known as like child process creation if i say i'm just going to hide this one okay so if you want to see it so you can see that uh it's running in the background ping google.com so the first one that i did was running in the background it checked by ps process id
so it's not stopping right now even with control c because it's running in the background so i can say kill process id so now it's terminated okay so that's basically the and operator um you can also use and operator so android operator basically the command that is succeeding this operator um will only execute when the previous one is finished executing okay so for example you may want to do something like uh you want to you may want to execute a command if the previous command is successful so i can say echo first and and echo
second so only when first is completed second will be executed only when this command is successful then only this command will run first was successful then second was successful okay we already talked about the semicolon operator when you want to add multiple multiple commands you can use the semi semicolon operator and there's also one known as logical like or operator or we've learned about it in bitwise stuff so basically the command that is after the or operator will only execute if the execution of the previous command fails okay it's like an else statement so here
i can say or this so you can see this did not execute because this was finished successfully so if i can say something like a failed command something i pass something like this this will fail hence second is running okay we also saw about the pipe so when we talked about grab we saw about the pipe basically it will send the output that was in the first command the second command so when we're using grep we we learned about the pipe one as well cool there's one more known as not so basically not is used
to not is a negation and we can use it to for example like delete all the files except one particular file okay so if i say something like change into my desktop in my tutorial okay and in my tutorial i have these files surnames.txt file.txt or whatever so let's say i want to remove all the files except not which file except surnames.txt missing the eliminator let me check let me check one second okay similarly you can learn about the not operator as well so linux if you do something like remove all the files except for
names.txt it will remove all the files except names.txt okay so that's the not operator and other than that you can you know this one i already mentioned to you echo hey inside names.txt now names.txt is going to contain hey init so you can append basically output from one to another you can see it now contains hay in the end okay if you remove this thing if you just write something like this as i showed you previously if you remove this only one then in that case it will override it okay now it only contains hey
but if you want to append then use double double okay so that's about that and we also saw how you can like concatenate various uh various commands as well like line by line so using this this one we talked about that so that's that's that's done cool okay similarly there's like the combination operator so for example if you want to if you want to mention a few commands that you only want to execute when the first command has executed so if you say echo hey if this is executed so this is executed um i can
add it in this like if this is executed then then execute these commands you can say echo i and echo i am good cool so this is used to group these commands okay it's a combination operator cool so if this particular thing succeeds then you will be able to add this like run this entire command okay so that's basically about it uh there's like a bunch of bunch of things you can do you can learn about precedence and stuff but uh i think like overall you will get the understanding of it not by like following
as many tutorials as you want but applying it into practice you don't have to know every single command you're not going to miss out on anything learn by doing know the commands with which you will be working with for example when we learn about git you will learn about git commands when when we learned about docker you'll learn about docker commands when you learn about kubernetes you'll learn about kubernetes commands when you do system administration you learn about system administration commands okay so just have a basic understanding of these things right now don't learn anything
like um in advance okay only do things when you're working with those okay so since for example we did the git tutorial so many git commands are covered in that okay more than enough for you and similarly when you do docker we'll cover docker commands when we do cumulatives we'll do kubernetes commands you don't have to sit and memorize these commands with writing or reading a book these things come naturally okay so very important stuff is chill relax a little bit and uh explore try out different things one disclaimer i would like to give is
that don't run any command from the internet uh without knowing what it does okay so if you don't run something like remove minus rf in the current directory so this is going to remove everything from my root okay don't do that um yeah that's pretty much about it and in the next videos we'll learn more about like uh you know continue the devops bootcamp and more and more commands will be coming more and more command line tools will be coming so don't worry we'll be going step by step when we learn about docker activities and
stuff make sure you like share subscribe you can take a selfie not a selfie a screenshot and share on socials share about your learnings i shared about the blog that i have started on hash note you can do as well you can use dev.2 whatever you want but just document your learning run the learning in public initiative share it on twitter by devops with kunal we have a nice little bot join the learning in public initiative check out all the links in the description join our community sign up for the newsletter so many things are
going on so many events are going on have fun and have fun in computer science and i'll see you in the next one make sure you like share and subscribe and share on social and with your friends and yeah happy learning [Music]