Is there a way to run linux bash commands in android (particularly 4.1.2 rooted or not rooted)? Will it void the warranty from phone manufacturers?
Yes, I use Terminal Emulator for Android. This works well for me, and comes pre-installed in Cyanogenmod. I particularly like pairing it with WiFi Keyboard, so I can use a real keyboard. These are both open source, although I've provided Google Play links. This drops you into
sh by default, but I have
bash installed too.
As for voiding warranty, you'll have to check your specific manufacturer's warranty.