@Evangelos Nannos answer still works (BlueZ 5.50) but if you want to change bluetooth alias on the fly you may try bluetoothctl (tested on Pi Zero W running Raspbian Stretch & BlueZ 5.50)
To set new alias open terminal:
pi@raspberrypi:~ $ bluetoothctl
[bluetooth]# system-alias 'Your New BT Alias'
Changing Your New BT Alias succeeded
[CHG] Controller AA:BB:CC:DD:EE:FF Alias: Your New BT Alias
Use show to see current bluetooth settings:
[bluetooth]# show
Controller AA:BB:CC:DD:EE:FF
Name: Some_other_name #default or as PRETTY_HOSTNAME
Alias: Your New BT Alias #alias will be shown when scanning for bt devices
(...)
Reset alias and go back to using system device name with:
[bluetooth]# reset-alias
Exit bluetootctl with:
[bluetooth]# quit
With Discoverable on (yes) the device will show up during scaning as Your New BT Alias.
Take note that alias will be kept after reboot!
I've use pexpect to manipulate bluetoothctl, bash works too. There were problems registering Agent on BlueZ 5.43 via pexpect, had to upgrade to 5.50
Alternative command (note it will not return a response):
pi@raspberrypi:~ $ sudo hciconfig hci0 name 'New device name'