Open command prompt and program

Command Prompt is a powerful tool in the Windows operating system that allows users to interact with the computer system through the command line interface. The command prompt allows you to perform a variety of system administration tasks and programming operations. The following will introduce how to open the command prompt and give some common programming command examples.

How to open the command prompt:

  1. Use shortcut keys: Press the Win key + R key on the keyboard to open the Run dialog box, then enter "cmd" and press the Enter key to open the Command Prompt window.
  2. Use the Start menu: Click the Windows Start menu, find the "Windows System" folder, find "Command Prompt" in it and click to open it.
  3. Use the search function: Click the search box on the left side of the Windows Start menu, enter "Command Prompt", and then click "Command Prompt" in the search results to open it.

Once you successfully open the command prompt window, you can start programming in it. Here are some examples of commonly used programming commands:

  1. Compile and run the program:

    • C/C++ program: Use gcc or g++ compiler to compile C/C++ source code, for example:
      gcc hello.c -o hello
      
      Then run the resulting executable:
      hello.exe
      
    • Java program: Use javac compiler to compile Java source code, for example:
      javac HelloWorld.java
      
      Then run the generated bytecode file:
      java HelloWorld
      
  2. Directory and file operations:

    • Switch directory: make

おすすめ

転載: blog.csdn.net/ByteJolt/article/details/133414223