Skip to main content

Shell Scope

The commands within the shell: scope are used to provide terminal window commands in the OSGi shell.

Shell Scope commands
Command Parameters Description
shell:alias command Creates an alias to a command.
shell:cat [options] [paths or urls] Displays the content of a file or URL. Where paths or urls is a list of file paths or urls to display separated by whitespace (use - for STDIN)
shell:clear   Clears the console buffer.
shell:completion [mode] Displays or changes the completion mode on the current console session. Where mode is the completion mode to set. The valid completion modes are: global, first, subshell.
shell:date [options] [format] Displays the current time in the given FORMAT.
shell:each values function Executes a closure on a list of arguments. Where:
  • values is the collection of arguments to iterate on
  • function is the function to execute
shell:echo [options] [arguments] Echoes or prints arguments to STDOUT, separated by whitespaces.
edit    
shell:env variable [value] Gets/sets the value of a console session variable.
shell:exec command Executes system processes.
shell:grep [options] pattern Prints lines matching the given pattern, in regular expression.
shell:head [options] [paths or urls] Displays the first lines of a file. Where paths or urls is a list of file paths or urls to display separated by whitespaces.
shell:history   Prints commands history.
shell:if condition ifTrue [ifFalse] If/Then/Else block.
shell:info   Prints system information.
shell:java [options] className [arguments] Executes a Java standard application.
less    
shell:logout   Disconnects shell from current session.
more    
shell:new class [args] Creates a new java object.
shell:printf format arguments Formats and prints arguments.
shell:sleep [options] duration Sleeps for a defined duration then wakes up. The default time unit is millisecond, use -s option to use second instead.
shell:sort [options] [files] Writes sorted concatenation of all files to standard output, separated by whitespaces.
shell:source script [args] Runs a script. Where:
  • script is a URI pointing to the script
  • args are arguments for the script
shell:stack-traces-print [print] Prints the full stack trace in the console when the execution of a command throws an exception.
shell:tac [options] Captures the STDIN and returns it as a string. Optionally writes the content to a file.
shell:tail [options] [path or url] Displays the last lines of a file. Where path or url is a file path or url to display.
shell:threads [options] [id] Prints the current threads (optionally with stacktraces).
shell:watch [options] command Watches & refreshes the output of a command.
shell:wc [options] [files] Prints newline, word, and byte counts for each file.
shell:while condition function Loops while the condition is true.Where:
  • condition is the condition of the loop
  • function is the function to execute

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!