Command Line Interface (CLI)

 Command Line Interface (CLI)

Command Line Interface


A command line interface (CLI) is a text-based user interface (UI) used to run programs, manage computer files and interact with the computer. The use of computers is on the rise and it takes a person to use them. So the user needs to know how to use it (computer) properly. Today we will discuss a new topic. Which will help us to use our computers faster. Today we will know what (CLI) means. 

    1. What's Command line Interface?
    1. How to use the command line?
    2. What are the benefits of the command line?

    What's Command line Interface?

    There are some DOS commands inside the computer and PC DOS commands, both of which have about half a hundred commands. It is used to perform computer functions. Some of the commands are used more and some of the commands are not so significant. But as a good computer user, you must know the command line. There is currently no substitute for knowing the command line when it comes to getting a job as a good programmer. So we need to know about the command line. Here we discuss the command line in detail.

    How to use the command line?

    There are specific rules for using the command line, through which we can use the command line very easily. The standard syntax for executing DOS commands on a computer is as follows: -

    [dos-prompt]  <command name>  <source >  < target >  < switch >  <parameter>  


    The above synthesis is analyzed

    [dos-prompt]  

    The synthesizer displays the drive letter name of that part. This is because displaying the DOS prompt is inevitable when applying the DOS command. And it is not possible to apply the DOS commands to any environment other than the DOS prompt. However, there are some package programs from which the DOS command can be done. And prompt

    <command name>

    To the right of the DOS prompt where the cursor is located and from here type the command. If we want to create a new directory, we need to type its specified command. Such as: - MKDIR


    By its sign, it meant a space here. Because the command will not be effective if we do not give this space when we give the source target later.

    <source>

    This is necessary to determine the exact state of where the command will be effective. For example, we need to copy a file from a directory of a drive to be typed in the source part.

    <target>

    The target section specifies where the results of the command will be applied. For example, the copied file is used to indicate the location of the drive.

    <switch>/<parameter>

    Different switches or parameters are used to get more benefits with the help of the applied DOS command.

    This symbol represents the key on the keyboard. Because when we type a specific command for a DOS command. After completing that command, the Enter button will be required.

     Advantages of command line

    The command line has several advantages. A user will be able to do his work very quickly. However, the user needs to know in depth about the command line usage rules. Because in this command line, a user will be able to work around creating his file. So you need to know the correct rules for using commands at the command prompt and there are many benefits to using the command line. This is discussed in detail below.

    There are three ways to open a command prompt

    • Click on Windows Icon   Windows System > Command Prompt on our computer.
    • We press on our keyboard Windows Botton (    ) and type Cmd and then press Enter Button.
    • Or we press Windows Botton + R from our keyboard. Immediately a popup window will appear where I type CMD and press Enter button at the end.
    And at the same time, the Command Prompt will open on our desktop where we can use the command properly at our convenience.

    Command line

    Note: If you are a Windows user, the first drive that will show you is C:\. There are also two folders which will have \ backslash in the middle and > greater than day mark at the end. Now we will try to know in detail how to use some of the most commonly used commands on our computer and those commands.

    The name of the command Describe the commands
    CD Used to move from one directory to another.
    CD.. Periodically used to move from one directory to another.
    : Used to move from one drive to another such as: - G:.
    MKDIR / MD Used to create one or more directories.
    DIR This command is used to display what is in the directory
    DIR/O Used to display files in alphabetical order.
    DIR/W Used to enclose files/folders by third brackets.
    ATTRIB Used to hide any file/folder.
    DIR/AH Used to display any hidden files/folders.
    ECHO Used to create any file.
    TYPE Used to show what is in a file.
    RENAME Used to rename a file/folder.
    RMDIR / RD Used to delete any directory.
    TIME Used to display time.
    DATE Used to display dates.
    COPY Used to copy from one directory to another.
    DEL / ERASE Used to delete any file.
    COLOR Used to change text color.
    SYSTEM INFO Used to know system information.
    CLS Used to clean the skin.
    TREE Used to view a file/folder under a drive.
    TITLE AccUsed to change the title of the command prompt.
    HELP All commands are used for viewing together.
    EXIT To exit the command line windows.
    SHUTDOWN Used to turn off the computer.

    Note: Cage is not sensitive at Command Prompt, which is why we can complete commands with either UPPERCASE & lowercase at Command Prompt. Here the folder is called a directory.

    We will now discuss the above-mentioned commands in detail.

    CD

    I will use the (CD) command when moving from one directory to another. After we type (CD) in the command line, we must give a space. You need to specify the name of the directory you want to enter next. If we want to access a directory/file in a specific way then we have to type the name of that directory. To make it easier, after typing the first letter of a specific directory/file name, TAB we will press the button on the keyboard and then we will see the name of that directory on the screen. And if we want to see what kind of files/folders are in that directory, we DIR will type. (Enter)  After pressing the button, we will continue to display all the directories and files under that directory. If we want to do it another way, we TAB will press the button from the keyboard while we are in that directory. As a result, we will continue to display files/folders one by one. And if we find the specified file/folder then we (Enter)    will press the button from the keyboard which will create a new line. Such as: -

    Command line

    CD.. / CHDIR..

    This command is used to move us from the directory we are going to to the previous directory. Let's say we're going to the C:\Users\Hamidur Rahman\Desktop> directory now. That is, here we go to the C:\ directory (Desktop). And we want to go to the previous (Hamidur Rahman) directory. So we have to type any one of them on the command line CD.. / CHDIR.. and after typing the command . we have to press the (ENTER) button from the keyboard. Then we will now C:\ return to the directory (Hamidur Rahman). Thus, if the CD.. / CHDIR.. of a type that can be taken if the previous directory. Such as: -

    Command line

    :

    Another command that is important at the command prompt is that we : use this command to move from one drive to another. But to use this command, we first need to know how many drives we have on our computer. If you do not know, you : will not be able to use this command. Note that we can easily find out how many drives we have on our computer. For that we (My Computer) double-click on how many drives we have in our computer. Suppose we have a total of four drives in our computer such as C:\>, D:\>, E:\>, F:\> . When we first open the command prompt, we see that C:\Users\Hamidur Rahman\Desktop> there is a line on the skin of our computer. Which tells us that we are now going to C:\> drive. If we want to go to another drive we have the name of that drive and after : Let's mark. Then it will take us to that directory. Again if we want to go to another drive then we give the name of that drive and then : mark. Such as: -

    Command line

    MKDIR / MD

    Another important command at the command prompt is the command used to create a directory on our computer. Simply put, this command is used to create a specific directory. One or more directories can be easily created using this command. Now we will create a directory on the desktop which we will name (Test). For that, we open the command prompt and type MKDIR / MD name any one of them and the name of the specific directory and then press the Enter key from the keyboard. This will create a directory named Test on the desktop. Also together we can create multiple directories. Type first MKDIR / MD The names of any of these directories and a space between each name must be given. Because of this, a directory will be created with the name that will be given after each space. I think if we want to create a directory on the desktop six command prompt MKDIR / MD of any type and the (ONE TWO THREE FOUR FIVE SIX) write the (Enter) button and press it. Then a total of six directories will be created here. Such as: -

    Command line

    Also, if you want to create a directory with one or more wires, you have to give double quotations at the beginning and end of the wires (""). I want to create a directory named now New Folder. For that, after typing the command, New Folder you must give double quotations on both sides, such as: - " New Folder " Then New Folder Then a folder will be created on the name. Otherwise, double quotation was not the killer, then, New and Folder the two folders will be created.

    Warning: Where we are creating a folder named New Folder. If that directory contains a folder with the same name, New Folder will not be created in the directory with the same name. However, if given by another name.

    DIR

    We use the (DIR) command to find out what kind of drives, directories, and files we have on our computer. Now we DIR type the command in any type of drive/directory we have. The type of files/folders in that drive/directory will be displayed. Such as: -

    Command line

    DIR/O

    Using this command, the information that will be displayed to us will be displayed in alphabetical order. That is, the files and directories Ascending will be arranged in the form. Such as:- 

    Command line

    The information that is displayed after giving the command here DIRwill show the same information even if you just give the command. But, DIR and the DIR/O command displays a lot of information differently.

    DIR/W

    Another command at the command prompt is (DIR / W). Such as: -

    Command line

    ATTRIB

    One of the most commonly used commands in most the command prompt commands ATTRIB.This command is used especially to hide any file/folder we work with. We know that we use software that can be locked on our computer to hide any file/folder but we can easily hide the files/folders we have created by using this command only. But ATTRIB more is needed to use the command. The whole command is ATTRIB +H +R +S FOLDER / FILE NAME. Suppose we now have a folder on the desktop whose name Test Folderwe will hide. First, we ATTRIB +H +R +S) will type and Test Folder type with a space - enter from the keyboard Test Folder T will be hidden. To find that file/folder again, we have to type in the same rules. However, in this case, there are a few exceptional rules, such as: - By ATTRIB –H –R –S Test Folder typing it, if you enter the keyboard, you Test Folder can see it again. Such as: -

    Command line

    DIR/AH

    This command is used to indicate what kind of files/folders are hidden on a drive. If we want to easily see any hidden files/folders we have created, we can do so with this command at the command prompt. Suppose Test Folder we want to see the name of the file we created is hidden on the desktop. If we go to the specific drive and DIR/AH type this command then all the folders/files in that drive can be seen. Such as: -

    Command line

    Note: - Mention that when we find any software to hide a file/folder and use it we have to face several problems. But we can easily hide any file/folder using the command prompt.

    ECHO

    We can type different types of commands in the command prompt. However, the Echo command is very important because it is used to create any type of file. We will now index.html create a file with a name. First, we need to open the command prompt and enter the specific directory where we index.html want to create the file named. Suppose we want to create a file on the desktop. Then you have to go to the desktop and type, ECHO>index.html then index.htmla file named will be created. You New.txtcan create a file with the same name if you want. Again, index.html, if you want to write something in the name of ECHOthe file, it will be possible to write in the middle of the file using the command. For this, in the middle of the command line, we first ECHO write a space then some text we are learning today comman line interface right now . Then, > after the name of the file index.html should be written. Then when we index.html open the file with the name, we will see that a while ago we wrote in the middle of the file we are learning today common line interface right now. Can be seen here. Such as: -

    Command line

    TYPE

    This command is used to display the type of text in a file, not to open it directly, but to display it on the skin at the command prompt. Above we learned how to Index.html create a file. Now let's see how TYPE to use the command. There is a rule for using this command. First, let's type TYPE a little space with the command and then the name of the file index.html. Then all the tasks in the file will be displayed in the command prompt. Such as: -

    Command line

    RENAME

    Another command prompt command that RENAME uses this command to rename a specific file/folder. We will now rename a folder. Which Test Folderis stored in our desktop. First, open the command prompt and go to the specified directory. Then you have to type such as: - RENAME "Test Folder" MYFOLDE Here the RENAME command is typed then the folder name and the name of the new folder are typed.


    Command line

    Warning: If the file name is more than one word, " "double quotation is required.


    RMDIR / RD

    Used to delete any file/folder (Permanently). But if there is a subdirectory in the middle of a directory (RMDIR / RD) will not work. Used to delete only one directory (Permanently). However, with this command, we can permanently delete any type of file/folder in a directory. However, in this case, you have to type in a slightly different way. For example: - MKDIR /S / RD /Scommand in the directory and all files / folders (Permanently delete) can do. Such as:-

    Command line

    Note: - While I am in a directory here, I will delete all the files/directories inside it, then I will ask permission from you. If you press (Y) then all the files including that directory will be permanently deleted.

    TIME

    The command is currently used to view and change the time. Suppose a user wants to see what time it is on his computer at the command line and can do so even if he wants to change his time. To do this, first, open the command prompt and Timetype. And if you want to change the time, you have to enter it according to the specified format. Then times will change.

    Command line

    DATE

    This command is usually used to view the date. If a user wants to see today's date on his computer, he DATE can easily see the date with this command. Again, if the user wants to change the date, he can do so. If the user is given according to the specified format, the date will be changed. Such as: -

    Command line

    COPY

    The COPY the command is used to move files from one directory to another and from one disk to another. This command is also used to coordinate two or more files. Now I will copy a file from (D) drive to (E) drive. For that (D) you have to type while in the drive. COPY D:\index.html E: Then we see that the file (index.htm) in the drive (D) is copied to drive (E). Such as: -

    Command line

    Also, if you want to copy all the files in the (E) drive together, you have to type. Such as: -

    Command line



    DEL / ERASE

    This command is used to delete one or more files. The command must be executed with the status of the file. Or you can delete those files by going to a specific directory. We will now place a folder on our desktop and several files inside it and we will delete those files. For example: - If C:\Users\Hamidur Rahman\Desktop\New folder>DEL "index .html" you type the command, the name of the file (index .html) in the folder named New folder will be deleted.

    Command line

    Note: -If you want to delete all the files inside a directory, you have to type in the command line. For example: - (DEL *. *) Will then ask for permission. If we press the (Enter) button on the keyboard with (Y) then all the files in that directory will be deleted.

    Color

    We use this (COLOR) command to change the colors of the words we are typing in the command line. The color can be changed in addition to the (COLOR) command. However, there are a total of 16 colors to change the color of the font. But to see all the colors at once, type help color Such as:-

    0 = Black 8 = Gray
    1 = Blue 9 = Light Blue
    2 = Green A = Light Green
    3 = Aqua B = Light Aqua
    4 = Red C = Light Red
    5 = Purple D = Light Purple
    6 = Yellow E = Light Yellow
    7 = White F = Bright White


    However, to give the color (COLOR) command, you must first type (COLOR) and then color the signal of the color you want to color as you want to color (Green). For that we have to type (COLOR 2) first then the fonts will be colored (Green). Such as: -

    Command line


    SYSTEMINFO

    With this short command, we can collect all the information on our computer. By typing this command and pressing enter from the keyboard, we can know what kind of operating system, how many GB of RAM, how many bits, etc. Such as: -

    Command line

    CLS

    This (CLS) command is used to clear all the text on the skin of the command prompt that we are using to give commands to our computer. Suppose we are using a number of commands in our command prompt and the CLS command is used to clear the skin. Such as: -

    Command line

    TREE

    What kind of directory/file is in a drive? The command (TREE) is usually used to find out what kind of files are in a directory. Suppose we want to know what kind of file is in a directory on the desktop. For that, we will first go to the desktop and type the command (TREE). Such as: -

    Command line


    TITLE

    The command prompt we are using is named (Command Prompt) which we can change very easily. To do this, first, open the command prompt and type (TITLE) the name you want to give later. We want to give here (My Command Prompt). Such as: -

    Command line


    HELP

    This (HELP) command is used to see all the commands in a command prompt. Now open the command prompt (HELP) and type the command, we can see all the commands. Such as: -

    Command line

    EXIT

    There are several ways we can get out of the command prompt. If any of the users want to use the command prompt and exit the command prompt (EXIT) they can exit using this command. And (EXIT) with this command, pressing the (ENTER) button from the keyboard will immediately exit the command prompt page. Such as: -

    Command line


    SHUTDOWN

    The most common command of the command prompt is (SHUTDOWN). Because this command is used to shut down our computer. Not only this but with the help of this command computer can be restored. In this case, we now want to give the computer (SHUTDOWN). For this, you have to type this way. (SHUTDOWN / S) If you enter from the keyboard a popup menu will appear and after a minute the computer will shut down. In the same way, if you need to give restore the computer, you have to type. (SHUTDOWN / R) will then ask for permission in the same way and after a minute the work of the computer restorer will start.

    Command line

    Note: -If you have any suggestions about of Command Line Interface. You let us know For this, follow the Contact US page. Thank you read to the Command line interface!

    About the Author

    Hi, I have written and developed this site so that students may learn computer science related technologies easily. I'm committed to provide easy and in-depth tutorials on various technologies. No one is perfect in this world and nothing is eter…

    Post a Comment

    Thanks for your valuable feedback
    Cookie Consent
    We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
    Oops!
    It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
    AdBlock Detected!
    We have detected that you are using adblocking plugin in your browser.
    The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
    Site is Blocked
    Sorry! This site is not available in your country.