Permissions

Bash: An Easier Way to Check File Permissions (Octal Mode & Stat)

File permissions on Linux can be a pain. You can either understand them in symbolic mode (basically, alphabet soup--i.e., drwxrwxrwx), or you can master them in octal mode (i.e., 777--which roughly translates to "Open the gates of Mordor!"). While symbolic mode might acutually be the more human-readable format; octal mode feels a bit more intuitive, and in my experience is what I see referenced more often on the interwebz (i.e., StackOverflow). The problem?--Linux generally defaults to symbolic mode on the command line--such as when you run ls -l. Here's a short script that helps cope with this. Run it, and it'll give you the permissions for a file, directory, or contents of a directory in octal mode.

Lost in Translation

First off: I'll assume this isn't your first time dancing the permissions tango--i.e., you have a basic understanding of symbolic and octal permissions. So, I won't go into the nitty gritty, here, of what each and every number combination means--let alone the existential implications of what your permissions should be for any given use-case.

Ubuntu: Déjà Dup Backup Failed to Execute Child Process

It's just the way of Linux, especially on legacy hardware: every now and then you screw things up beyond repair--like when you change graphics drivers and can no longer access a login screen. I recently got myself in a pinch and, after hitting my head against a wall for several hours, decided that I'd look at reinstalling Ubuntu and restoring from a Duplicity/Deja Dup backup. Unfortunately, my first attempts to restore the backup presented me with an error that seems to be somewhat common. The fix, as often seems to be the case, was a simple permissions change.

Background

I should know better than to mess with drivers on my old Mac Pro -- the hardware is finicky at best. Out of curiosity, though, I decided the other day to switch to an Nvidia driver. Big mistake!--I soon found myself unable to get to the login screen, and attempts to even get into the command line weren't particularly fruitful (an issue, I suspect, with the boot disk being encrypted).

Ubuntu: Disk Permissions & Multiple User Profiles

This is probably a no-brainer for advanced Linux users, but for newbies it may strike as awkaward that if you create/partition a disk with one user on your computer, another user won't automatically have "access" to it. This is a good opportunity to revisit the function of permissions in Linux--a quick review of Users and Groups.

TL;DR

When creating a partition, the "Disks" application/utility sets permissions to 700 by default (read/write/execute access for the disk owner only). You'll want to change that if you've got multiple users who need to access the disk on your computer. I'll discuss solutions below.

Git Error: Unable to Unlink Old <FILE> -- Permission Denied

A branch management error that can seemingly come out of nowhere. Don't worry, there's an easy fix for this one. The key may be in understanding the real power of Sudo in Linux.

TL;DR -- check file permissions; on Linux?--maybe don't use Sudo with Git!

This error is almost definitely a permissions issue. In my case, outlined herein, the problem stemmed from a blatant abuse of sudo. Let's break it all down.