Support us .Net Basics C# SQL ASP.NET Aarvi MVC Slides C# Programs Subscribe Download

Customize Command Prompt

Suggested Videos
Part 1 - What is Angular CLI | Text | Slides
Part 2 - Installing Angular CLI | Text | Slides
Part 3 - Angular CLI Create new project | Text | Slides

In this video we will discuss how to customise command prompt window. You might be wondering why are we talking about customising Command Window in an Angular CLI course. As we know, Angular CLI is a command line tool. We run it using the command prompt window. If we know how to customise the command prompt window to suit our needs, then we have better experience using the Angular CLI. 



If you already know, how to customise the command prompt window, you may skip this video.

As far as Angular CLI is concerned, the most useful command I think is, ng --help. When we type this command in the command prompt window and hit enter key, it displays all the Angular CLI commands and the options we can use with these commands.


As we scroll up in the command prompt window, notice we are not able to see all the commands and their associated options. To fix this we have to increase the buffer size. To increase the buffer size there are 2 simple steps

Step 1 : Right click on the "title bar" of the command window and select "Properties" from the context menu
Customize Command Prompt

Step 2 : Click on the "Layout" tab and set the "Height" property to 9999 under "Screen Buffer Size" section, and click "OK"
increase number of lines in command prompt

With this change in place, execute that same command ng --help. Notice now we can see all the commands and their associated options.

There is lot of help text displayed on the screen. If you want to find a specific command you can use the search feature of the command window. To use the search feature, right click on the "title bar" of the command window and select "Edit" from the context menu. You can then use the "Find" window to search for the command you are looking for.

To redirect the output of ng --help command to the windows clipboard, use the CLIP command as shown below.
ng --help | clip

Once you have the output copied in the clipboard you can paste it anywhere you want it. For example in a notepad, word document etc.

You can also redirect the output directly to a text document using the following command. This command creates a text document with name MyTextDoc.txt  in the folder where you have executed the command. This text documents will have the output of the command ng --help.
ng --help >MyTextDoc.txt

Similarly you can also redirect the output to a word document.
ng --help >MyWordDoc.doc

From the properties window of the command prompt you can also change the cursor size, font size, font colour and background colour.

In our next video we will discuss all the options we can use with the Angular CLI's "ng new" command

angular cli tutorial for beginners

No comments:

Post a Comment

It would be great if you can help share these free resources