Introduction
The command line interface in Grails 3.0 significantly differs from the command line interface in earlier versions of Grails. It includes APIs for calling Gradle for build-related tasks and for executing code generation.
When you type: grails <<command name>>, Based on the profile of the active application, Grails searches the profile repository. Commands are read from the web profile and the base profile from which it inherits if the profile is for a web application.
Since command behavior profiles are specific, the web profile may provide different behavior for the run-app command than a profile for running batch applications.
Interactive Mode
The Grails command line has an interactive mode option that keeps the JVM running and speeds up command execution. Type "grails" at the command line to start interactive mode, and then use TAB completion to retrieve a list of commands:

If you want to open a file while within interactive mode, you can utilize the open command, which will TAB complete file paths:

Even better, the open command can open the most recent test and dependency reports, respectively, thanks to the logical aliases "test-report" and "dep-report." In other words, type open test-report to open the test report in a browser. You can even open several files simultaneously: Open test-report test/unit/MyTests.groovy will open the MyTests.groovy source file in your text editor and the HTML test report in your browser.
After using the create-* instructions, class names can also be completed using TAB:

If you need to run an external process whilst interactive mode is running you can do so by starting the command with a !:

Note that with ! (bang) commands, you will get file path auto-completion - ideal for external commands that work on the file system such as 'cat', 'ls', 'git', etc.
Enter the exit command to leave the interactive mode. The interactive mode console will close when the Grails application has been launched with run-app typically because the JVM will also close. The program running in forked mode, which means it uses a different JVM, would be an exception to this rule. In that instance, the application will continue to execute even when the interactive mode console shuts down. Use the quit command to end an application currently executing in forked mode and exit interactive mode. The interactive mode will close after the quit command stops the operating application.
Also see, wc command in linux




