You can run any ADB command on your phone without ever connecting it to a PC.
ADB, Android Debug Bridge, is a command-line utility included with Google's Android SDK. ADB can control your device over USB from a computer, copy files back and forth, install and uninstall apps, ...
Rooting an Android phone gives you deeper access to the operating system, allowing you to change system files and settings and install applications that integrated tightly with the operating system.