Use the below command to check the path
mysql> SHOW VARIABLES LIKE "secure_file_priv";
+------------------+-----------------------+
| Variable_name | Value |
+------------------+-----------------------+
| secure_file_priv | /var/lib/mysql-files/ |
+------------------+-----------------------+
1 row in set (0.02 sec)
then export to this path like
select * from TABLE where age > '30' INTO OUTFILE '/var/lib/mysql-files/age.csv';