mysqldump is a command you invoke at the shell prompt, not within the mysql client environment.
mysql> exit$ mysqldump --all-databases > dump.sql
You must execute that command from the system shell, don't forget to use username and password to access all databases, example:
mysqldump -u root -p --all-databases > dump.sql