Skip to main content

Posts

Featured Post

Linux Command Line Tutorial For Beginners - Introduction

Hi Friends, Welcome to Blog , Welcome to Linux . Now first question you may ask yourself why we should learn command line, even if we have GUI ? So, Simple answer is that GUI ( Graphical User Interface ) is helpful in many task but not useful in all task, and when you learn command, you will observe that you are able to do your day to day task or any task related to programming much faster that you can do with GUI . By using command you can able to see what happening in a background when you given a something task. Before dive into the world of Linux you should know two terms i.e., Shell and Terminal. Now what is Shell? Shell is a simply a program that takes inputs from the keyboard and gives that to the operating system to perform task.It is also called as CLI ( Command Line Interface ), Now the second term is Terminal, terminal is tool which is used to pass a shell command, this is a program that open up a window and lets interacts with shell. There are different operating...
Recent posts

Linux Command Line Tutorial For Beginners - less command

Welcome to the Linux command line Tutorials, In this blog we will going to learn how we can use less command in Linux and what are the functions performed by the less command. Lets see what is less command and why we use less command, Less command is used to read files, search anything in content of file or search any pattern or any word, So,lets see how we can do it. First, Open Terminal Ctrl+Alt+t . Suppose a file contain data or content and if we want to read that content then we use cat command as we learn earlier but problem is occurred when data or content is very large in size and terminal does not allow as to read data from the starting, to resolve such type of problem we will use less command in this way : less [file_name] 1. Now terminal shows you content up to it allows to display, and if you want to see more content you can use down key which will move content by one line downward and same for upward key also. 2. Now, if you want to see content ...

Linux Command Line Tutorial For Beginners - mv command

In this Blog, we will learn how we can use mv command in Linux.   mv command is used to move files and directories. First of all open Terminal, Ctrl+Alt+t .   Syntax for mv command is: mv [options] [source] [Destination] One more feature or say use of mv command is to change directory name and rename files. So, lets see how we can do this: In above example we had changed file name text1.txt to text2.txt and the content of the file remains same as it is. Now, if you want to move a file into a particular directory then we will use command as: mv [File_name] [Directory_name]  You can see that previously dir1 contains only text1.txt file after that we can see that in that directory another file get moved text2.txt. As we already know dir1 contains text1.txt and text2.txt files and if we try to move a file whose name is same as text2.txt which is already present in that directory then it will overwrite the contain of that file as we seen in previ...

Linux Command Line Tutorial For Beginners - cp command

In this Blog, we will learn how we can use cp command in Linux. cp command is used to copy files and directories in Linux. So, lets see how we can use it. Open your Terminal Alt+Ctrl+t . Syntax for cp command is: cp [options] [source] [Destination] In above example, text1.txt file already exists in Desktop then I use cp command and give destination file name as text2.txt which does not exists but cp command created new file and copied the content of text1.txt to text2.txt. Now, if you want to copy a file into a directory then we will use command as: cp [file_name] [Dir_name] If you want to copy more than one file in a directory you can use command as: cp [1st file] [2nd file] [Dir_name ] Now if you want to copy the files to a directory in which same named file already exists and if you give same command as above then it will overwrite the content of that file in this situation you should use one option along with cp command i.e., -i which means intera...

Linux Command Line Tutorial For Beginners - rm and rmdir commands for linux

In this Blog, we will learn how we can use rm and rmdir in Linux. rm and rmdir commands are used to remove directory or directory structures. So, lets see how we can use it and what are the conditions to select one of them command. First of all open Terminal, Alt+Ctrl+t . Syntax for rmdir command is: rmdir -[option] dir_name Now take one example, I will create a directory in home directory and then I will remove it or delete it by using rmdir command. Now if you want to remove whole directory structure and if we use same command then what will happen lets see First we will create directory structure as: a/b/c/d/e   And then see what is the structure of created directory for that we are using command as ls -R Now lets use command rmdir a/b/c/d/e and again use ls -R You will observe that whatever we directory created remains as it is but last directory get removed. In order to delete whole directory structure you have to use command wi...

Linux Command Line Tutorial For Beginners - mkdir Command

In this Blog, we will learn how we can use mkdir command in Linux. mkdir means make directory, We can create directories in Linux. First of all open Terminal Alt+Ctrl+t . Syntax for mkdir command is: mkdir [directory_name] In above screenshot you can see that firstly I want to create a directory named as example in Desktop.So, I have used cd command and gone to Desktop directory and then mkdir command is used. In similar way if you want to create directory anywhere, you should go to that directory and use mkdir command. Now if you want to create sub directory of directory which is already exists, you can use command in this manner: mkdir [1st dir name] / [sub-dir name] You can see that example directory which is already exists now contains a sub-directory named as subdir. If you try to use same command for the creating sub-directory of directory which doesn't even exists it will show error that can not create directory: directory does not exists. ...

Linux Command Line Tutorial For Beginners - I/O Redirection

In this Blog, we will learn how we can use redirection in Linux. First of all What is redirection means? It means capturing output in a file using command and send it again as a input to program, file or command.  So, lets see what are the options and command we have to use for redirection. Open Terminal Alt+Ctrl+T ,  Syntax for redirection is: [output] > file_name Here > indicates the direction of output where we are going to save our output. In our previous blog we had learned how to use cat command, and here we are going to use cat command for creating a file and transferring data to that file. So, lets use first command only cat which will save the input whatever we given to it. cat > [file_name] Note one thing after > whatever file name we are giving, if that file is not exists at all then it will create file and save the output to it. To end the cat command we will use Ctrl+d . You can verify that output is saved or not by g...

Linux Command Line Tutorial For Beginners - cat command

In this post we will learn how to use cat command in Linux. cat is one of the most frequently used command in Linux and it has three functions with respect to text files : 1) Displaying text file. 2) Combining copies of text files. 3) Creating new text files. So, lets see how we can use cat command..... First of all open Terminal, Alt+Ctrl+T Syntax for cat command is : cat [option] [file name] Now lets move towards our command, give command as only : cat You will find that nothing is happened, but our cursor is blinking like this: Now type anything for example if we type Hello then press Enter it will again print the same word i.e., called as Echo . For exiting from cat command you simply press Ctrl+D, Which means end of program. cat command is not only for echoing something but along with this it is used to do many functionality. Now, if we want to display content of file on Terminal, then we will give command as: cat [file name] In above te...

Linux Command Line Tutorial For Beginners - cd command

cd (Change Directory) command is used to change current working directory. First open Terminal, Alt+Ctrl+T Lets see syntax for command cd : cd [Directory name] As I already told you that whenever we open terminal, We are in home directory. Now, if we want to change our current directory to root directory, we will simply write command as: cd / The forward / indicates that you are in root directory. For confirmation, you can type command as pwd , we discussed earlier.  Now if you want to go back to home directory use command:                                                             cd ~ Now if we are working in any directory and if we want to go one step back directo...

Linux Command Line Tutorial For Beginners - ls command

ls is a Linux shell command that lists directory contents which may be files or directories. First of all lets open Terminal, Alt+Ctrl+T ls command uses following syntax:          ls [option] [file or directory name] if we give simple ls command it will show us all directories and files present in home directory, as when we open terminal by default we are in home directory. Now if we want to see what is in Downloads directory then we simply give command as:                          ls Downloads Note one thing i.e., command line is case sensitive so we should write name of directory or file as it is. In same way you can able to see contents of any directory. If we want to see content of root directory then we will write command as: As we know / is called as root directory.      ...