How to set filters when using the ExportItems command via the CommandLine


If you want to export items from your project using the CommandLine, you can use the ExportItems function to set a filter to export only the items you want. This article will provide you some examples on how to set the filter's value.



In Script mode, CommandLine reads a script file containing a list of commands and executes them. For example in the

./Talend-Studio-linux-gtk-x86 -nosplash -application org.talend.commandline.CommandLine
-consoleLog -data commandline-workspace scriptFile /tmp/myscript

Example of script file read by the CommandLine:

initRemote http:/ /localhost:8888/org.talend.administrator -ul -up passwd
logonProject -pn myProject
exportItems /tmp/


The CommandLine's help for ExportItems will give you this information:

exportItems destination ( exports items
-d (--dependencies) include dependencies
-if (--item-filter) filterExpr item filter expression


This screenshot provides more details on how to write the filter expression:



Assume there is one job named TestJob with 2 versions: 0.1 and 0.2.

If you wish to get only the 0.2 version of TestJob, you would use:

talend> exportItems / -if '(type=process)and(label=TestJob)and(version=lastVersion)'

If you want to export all version of TestJob items, remove the version filter:

talend> exportItems / -if '(type=process)and(label=TestJob)'

If you want to export the name of job and routines items that start with Test, use:

talend> exportItems /home/ggu/ -if '((type=process)or(type=routines))and(label%Test*)and(version=lastVersion)'

NOTE: There should not be any space between two filters and no space for "and" and "or": otherwise the command won't work.


Bookshelf references

You can find more details regarding the Commandline and its operating mode in our On-line documentation:

Operating modes

Script mode

Version history
Revision #:
6 of 6
Last update:
‎09-29-2018 12:11 AM
Updated by:
Labels (2)