what is the right way to shutdown ubuntu using the command line? [duplicate]

The right way to shutdown Ubuntu using the CLI(Command Line Interface) is sudo shutdown now.


You can shutdown safely running:

sudo poweroff

I suggest using shut down preceded with sync - probably old school but it commits unwritten data to disk - especially useful in multiuser systems. Linux System Administrators Guide