Why does the find command blow up in /run/?

Solution 1:

The permissions:

$ stat -c %a /run/user/1000/gvfs
500

So only the owner has execute permission (which allows directories to be searched). But, you used sudo and root has all possible permissions, right? Actually you found the exception:

This answer by Gilles on Unix and Linux SE explains why permission is denied for root that directory, which is a mountpoint for FUSE:

Managing trust boundaries with FUSE filesystems is difficult, because the filesystem driver is running as an unprivileged user, as opposed to kernel code for traditional filesystems. To avoid complications, by default, FUSE filesystems are only accessible to the user running the driver process. Even root doesn't get to bypass this restriction.

If you run the find command without sudo (as your own user, UID 1000) you will not get that error, because you own the directory, but you will get other permission errors instead, so, use sudo and take Gilles' advice:

If you're searching for a file on local filesystems only, pass -xdev to find.


Easiest way to check python versions:

$ python --version
Python 2.7.12+
$ python3 --version
Python 3.5.2+

Solution 2:

There is several ways to find what version of python you have. Here are two ways you'll get both Python 2 and Python 3 versions:

Python Specific

First just run python and python3 with the option --version

$ python --version
Python 2.7.12
$ python3 --version
Python 3.5.2

This is specific for python, but a lot of other programs use a similar method.

General for any package/program

A more general method is to see what package is installed. dpkg -l will list out all your packages, but you can specify what packages you are looking for. For just python and python3 use the following:

$ dpkg -l 'python'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version         Architecture    Description
+++-=====================-===============-===============-================================================
ii  python                2.7.11-1        amd64           interactive high-level object-oriented language 
$ dpkg -l 'python3'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version         Architecture    Description
+++-=====================-===============-===============-================================================
ii  python3               3.5.1-3         amd64           interactive high-level object-oriented language 

As an extra titbit. If you'd like to find all the packages that has a name starting with python, you can use wildcard character * like this:

$ dpkg -l 'python*'

That will print a lot of lines with packages.