Posts

wc Command

Image
WC Command This command is one of the daily use commands in Linux operating system, it should be known to every Linux user.  With the help of this command, we can find out how many newlines, words and bytes are present in the file. Suntax : $wc [OPTION].... [FILE] ...... FILE :- Here we write the name of the file for which we want to find the number of newlines, words or bytes. OPTION :- In this, we write the name of the options, which tell that after all we have to find the number of newlines, number of words or number of bytes of that file.    There are many options of this command, we will know all these options in turn, as well as tell about how to use it.  OPTIONS :- * -c (or --bytes ) :-  It is used to find the size of the file in bytes. * -m (or --chars) :-  Used to find the number of characters present in the file. * -l ( or --lines) :-  It is used to find the number of newlines in a file. * -L (or --max-line-length ) :- It is used to find the size of the line with maximum widt

mkdir command

Image
mkdir command This command creates new directory if directory already exists then displays error. In this post, we will teach you about how to create a directory And we will discuss about other important feature of this command. So let's learn ...  Syntax: $mkdir  [options]  dir1 dir2  1. mkdir dir1:-  it creates a directory. you want to create multiple directories at once, then you can do something like this  There are three dir1,dir2,dit3 poli files created here.  2. mkdir -p dir/dir1 :- We discuss about it by taking an example so that it is easy for you to understand. We are currently in a directory named c ontact , it means our current working directory is contact.  Four directories exist inside the current working directory:- dir , dir1, dir2, dir3 . Now we want to create directory named subpoto  inside photo directory but directory named photo itself does not exist in current working directory (contact).  The -p (--parent)option is helpful in such situations.  With the help

cat command

Image
  cat command cat = concatenate  In this section, what is cat command and why we use it and what are its options, we will give detailed information about all these questions by giving examples.so let's learn  A.what is cat command ? it concatenates files and displays them on the screen.  This means that this command continuously displays the contents of the files one after the other, so that we think that this content is present inside the same file which is displayed on the screen. B. why use cat command ? We can have many files present, by opening these files, we use its contents for useful work.Sometimes these files prefer to view the contents of all the files together instead of opening one file at a time, this command is very useful at that time. Apart from this, there are some other important features of this command, which will be known further. C. operation with its options  In this we will discuss the cat command with its option. Within this, we will tell the main purpose

touch command

Image
touch command  Use this command to change the access and modification time of the file. Creates an empty file if the file does not already exist.In this, what is the access and modification time and how do we change this time. Along with this, how to create empty files, you will know in detail about all these.  *Access and modification time is also called time stamps. 1.what is the access time? The last time the file was access or read . We read the file through some commands like cat, vi and nano. Keep in mind that only you have to open it and not make any kind of change to the content inside it.    2. What is modification time:- The time when the content inside the file was last modified. In this, we open the file and modify its content.  3. Why are we use touch command ?  We access and modify the file by opening it, the access and modification time also changes in its reflection. But without accessing and modifying the file, its access and modification time can be changed and this w

What is Redirection Operator ?

Image
Redirection Operator Both the symbols > and >> are called redirection operators in Linux. Redirection operator is used to save the output after running a command to a file. Let us understand what these two operators are ? 1.  >  Operator Whenever you run the command, then the output comes on the screen,  if you want to store the output on the screen in a file, then you can do it through this operator. * This operator should be used only with commands that output to the screen.  * It overwrites the output of the command inside the file. *If the file does not already exist then it creates the file and then stores the output in this file. Syntax : $ (command ) > File_Name Example:-  Tittle : ls -l Command Output   In above picture you can see the output of ls command, now we will store this output in a file.  Tittle : uses of > operator   Using this Redirection operator ( > ) , we have directly stored the output in a file named " redirection.txt ". Tittle :

ls command

Image
About ls command full form = list  With the help of ls command, list the contents present inside the directory.  Command: ls [OPTION] [FILE_PATH] Note: Default value of FILE_PATH is current working directory. Some useful options with examples are given below - 1. ls  :  Lists files and directories present inside a directory with no options. 2. ls -a (or ls --all):  Some files are hidden inside the directory, they are called hidden files. In such a situation, with the help of  -a(--all) option, you can list all types of files whether hidden or not. OR   When we ran ls command then .f.txt , .k.txt files and .game directory were not display but with the help of -a( --all)  option all files are display. 3. ls -l :  With the help of this command, the files present inside the directory can be displayed in long format.   Several columns are visible here, the first character of the first column indicates the type of file. The file types are shown below:- d : directory  -  : ordinary file l 

ifconfig command

Image
Ifconfig command :-  Whenever we connect one computer to another computer or other device, then we need IP address. And every computer has a network interface card and we assign IP address to this card.  With the help of this command, it is used to give IP address and netmask to the network interface and enable or disable the network interface, so let us see how to do all this. What is enabling or disabling a network interface?  Allowing the data to be received over the network or sent over the network is called enabling interface, on the contrary, the process is called disabling. Syntax:  ifconfig  [options]  [interface] 1. How to view network interface card information ? Syntax: $ifconfig  -a With the help of -a (--all) option, ifconfig displays all network interfaces whether enabled or disabled. In the picture you can see that there are three network interfaces eth0,lo and wlan0.  Above red line in wlan0 is written UP in flags=4163<UP, BROADCAST, RUNNING, MULTICAST> it means i