#RaspberryPi – Using “please” instead of “sudo”, a very Canadian command line of work for #Linux

Hi!

I’ll write this down, so I don’t forget in the near future. I’m not a Linux user, and that’s amazing. Every day I learn something new, mostly while I’m working with Python, Visual Studio Code and Raspberry Pi.

So, I received a couple of brand new Raspberry Pi 4, and now it’s time to test them. And of course, most of this job is via SSH / command line. I’m not an expert (yet) on Raspberry Pi user permissions, however I started to realize when I need to use “sudo” to get things done.

If you search for sudo definition, you may find something similar to this one:

Sudo stands for either “substitute user do” or “super user do” (depending upon how you want to look at it)

https://www.lifewire.com/what-is-sudo-2197466

Today, I’ve learned the power of the “alias” command, and how it can be used to have a more polite conversation with my device. In example, I can create an alias for sudo, named “please” and then this happen.

alias please="sudo"

This is a very polite way to display my Raspberry Pi4 CPU information

raspbery pi 4 using please instead of sudo display cpu information

Or another polite way to display Disk information for the Raspberry Pi 4

raspbery pi 4 using please instead of sudo display disk information

You get the idea.

Happy Coding!

Greetings @ Toronto

El Bruno

Twitter source

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.