android rooting and security
Every app is under its own user (this is how permissions are enforced). When you "root" a device, you add an SU binary which runs tasks as the super user. Any app can run the SU binary but they have to explicitly do so. Without explicitly doing so, they continue to run as their own user.

Most (if not all) rooting methods will have an additional APK for managing what apps have access to SU, such as SuperSU. In my experience, the first time an app tries to use SU, you'll get a notification asking for access. This will allow you to deny root to apps that request it.

EDIT: I'd also like to add that you can get command line access on Android without rooting. I highly recommend Terminal Emulator if you want access from your phone. If it's connected to a computer you can use ADB to run things on your phone by running adb shell. To get ADB, you'll need to get the Android SDK and find ADB in it.