Posts Tagged ‘root’

If you need to find the UUID of a hard disk in Linux, to add an entry to fstab for example, you can use the blkid command. There are many other methods available, but blkid prints the UUID with the label and disk type, and doesn’t require you to enter the path to the disk. […]

Each user on a unix system is assigned a user id, or uid. You can see your uid by running ‘id -u’. root will have a uid of zero. So to check if the user running a script is root, you can simply check that id -u is equal to zero, like so: if [ […]