In this example I did use 10g XE database installed on Debian Linux.
Steps should be the same in all Linux distributions.
In this guide we make assumptions:
You have privilege to use sudo.
You have upgraded APEX to version 3.2 or above.
ORACLE_HOME enviroment variable is set.
APEX install files zip is extracted to folder /tmp/
First give write permission to install files utility folder
sudo chmod a+w /tmp/apex/utilities
Next set Java CLASSPATH environment variable
Change working directory
Then run APEXExport. Change user, password and application id accordingly
java oracle.apex.APEXExport -db localhost:1521:XE -user scott -password tiger -applicationid 31500
Now you can find application export file from /tmp/apex/utilities folder. File name is like f31500.sql, where 31500 is exported application id.
Read more about APEXExport options from readme.txt that you can find in installed files ../apex/utilities/ folder.
Check also John Scott great blog post about APEXExport utility Backing up your applications.