JTerm supports basic Unix/Linux commands
ls [dir]
- list files and directories (+Linux options). Example:
> ls -la /home # show output in terminal > ls -la > a.txt # redirect output to a.txt > ls -la >> a.txt # append output to a.txt > ls /home | # put to memory (pipe) > printPipe # print memory pipe
ed
- start a simple editor. Argument is a file or URL. Example: >ed a.txt- open a txt file in editor. The editor has a syntax highlighting for all major file types.
pwd
- show the current directory
cd
- change the current directory
mv [file1] [file2]
- move file to another file
cp [file1] [file2]
- copy from file1 to file2
rm [file]
- file or directory
rm -r [dir]
- delete folder (and sub-folters) recursively (attention!)
cat [file]
- print the content of the file
echo “text”
- print the content of the String
print “text”
- print the content of the String
wc [OPTION] FILE
- Print newline, word, and number of characters for each FILE. Example:
wc [file]
- print the number of lines
The options can be:
-w
- number of words
-m
- number of characters
wget URL
- download a file from the web using URL
find [option] [dir] [pattern]
- find a file or directory recursively. Examples:
> find -d * # all directories starting from the current
> find -f *.jar # all files in the current directory
> file -f /user/ *.jar # all files starting from directory user.
> file -i /user/ *.jar # all found entries ignoring the caseThe following standard Unix/Linux options can be used:
-i (--ignoreCase) -z (--print0) -r (--regex) -d (--typeDirectory) -f (--typeFile) -s (--typeSymlink) -m (--timeModified) -o (--timeOlder)No mixing options is currently allowed. One can also use
> file
and >> file
to redirect the outputs
to files. You can also keep the ouputs in pipe using |
command. This is an example:
> find *.jar >> file # append all outputs to file > find *.jar | # put the output to pipe > printPipe # print the pipe
grep [OPTIONS] PATTERN [FILE]Options are:
-i --ignoreCase
- match lines ignoring the case when comparing the strings
-v --invertMatch
- invert the match result, that is, a non-matching line is written to the output and a matching line is not
-n --lineNumber
- prefix each line of output with the line number within its input file
-c --count
- suppress normal output; instead print a count of matching lines for each input file
-l --matchingFiles
- suppress normal output; instead print the name of each input file
-x --wholeLine
- select only those matches that exactly match the whole line
The options can be mixed (2 levels). Examples:
grep -i "test" build.xmlsearches for word "test" inside the file "build.xml" You can redirect the outputs to files using > and >> operands.
file.jar
which will run Java program from the given Jar file.
Example: > wget http://jwork.org/jterm/ekit.jar > ekit.jarPress enter to launch this jar file. It will start an HTML editor from the file "ekit.jar". As you can see, JTerm treat jar files as executable "exe" files.
All such commands should work under Windows, since they are mapped to the corresponding bsh commands.
> updateIt will download the updated version and exit the application. Then you can start it again.
!
in front of any external program. Examples:
!latex - will execute latex !make - will execute make file !gv - will start gv
To execute a BeanShell script, just type "script.bsh". This will execute this script (i.e. you do not need to use the standard BeanShell source command).
User scripts written in BeanShell can be put to the "macros"
directory. For example, there is a script test.bsh. Run it as:
test();