Answer blatantly copied from our sister site:
You need to run this command with root privileges. You can do that in several ways:
1) Elevate one command to uid 0 rights with the
> sudo purge
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Enter your account's password and it should run the purge command.
If you do not want to enter a password, add
%localaccounts ALL=NOPASSWD: /usr/sbin/purge to sudoers. (From a shell run
sudo visudo, press i, type or paste the text, press escape, and type
:wq.) Then use a Run Shell Script action that runs sudo purge.
2) Log in as root and issue the command.
Optionally after enabling the root account
3) From your terminal prompt (a bash shell) type
su -, the root password and then
Apple probably made the decision for security purposes. The only disadvantage is you have to type in your admin password. The advantage is, for non-admin users, they can not run this command and potentially harm their OS.
Usually commands that require sudo in order to run at all are potentially destructive or invasive. Two other commands with this requirement are