I am quite new to Linux and started using KDE Linux as my main os. I was wondering why does my Linux system start up with running programs and processes from the last session when I start it up again? I like to use the terminal a lot and I just like to use the "poweroff" command in the terminal. My friend told me to use the "shutdown 0" command but it didn't help. Is there a better way to shutdown my system so it would start up with any programs or processes running from the recent session?
There's a setting in KDE where you it can save a session, so that if you leave some applications open, on next startup, it'll reopen those same application again. You're looking to start with an empty session.
shutdown -P now
But make sure your bios settings are correct and that it's not hard-wired to go into a sleep/standby mode as it seems to be doing.
When your friend suggested using
shutdown 0, perhaps the intended command was actually meant to be:
sudo init 0
you need to use
sudo shutdown -h now or
sudo shutdown -h 35 if you want to shut it down after 35 minutes
It is also very handy to disable sudo for shutdown command so you can run it as a simple user.