Using Flask send_to_directory, not being able to download the correct file - python-3.x

I am working on a Flask app that processes input and creates a file at the end. I am trying to download that file using send_to_directory().
Route:
#app.route('/file-diff', methods=['GET','POST'])
def file_diff():
if request.method == "POST":
results = process_request(ip_a=request.form.get("ip_a"), chk1=request.form.get("chk1"), ip_b=request.form.get("ip_b"), chk2=request.form.get("chk2"))
path,filename = os.path.split(results)
print(app.config["DOWNLOADS"])
# outputs - /cache/app_bd/app/downloads
print("Path to file = {}".format(path))
# outputs - Path to file = /cache/app_bd/app/downloads
print("Filename = {}".format(filename))
# outputs - Filename = diff_results
try:
return send_from_directory(directory=app.config["DOWNLOADS"], path=filename, as_attachment=True)
except FileNotFoundError:
abort(404)
return redirect(request.url)
return render_template("file_diff.html")
Directory Structure:
:/cache/app_bd# ls -lR
drwxr-xr-x 7 root root 4096 Apr 13 13:00 app
-rw-r--r-- 1 root root 783 Apr 13 16:29 config.py
-rw-r--r-- 1 root root 174 Apr 11 16:22 requirements.txt
-rw-r--r-- 1 root root 92 Apr 13 12:48 run.py
./app:
-rw-r--r-- 1 root root 309 Apr 13 12:14 __init__.py
-rw-r--r-- 1 root root 2024 Apr 13 15:35 file_utils.py
drwxr-xr-x 2 root root 4096 Apr 13 13:02 downloads
drwxr-xr-x 2 root root 4096 Apr 12 16:13 scripts
drwxr-xr-x 6 root root 4096 Apr 13 13:00 static
drwxr-xr-x 2 root root 4096 Apr 12 16:11 templates
-rw-r--r-- 1 root root 1717 Apr 13 17:05 views.py
./app/downloads:
-rw-r--r-- 1 root root 85008 Apr 13 17:05 diff_results
The above code works but downloads file_diff.html itself. The expected file to download is diff_results.
What was tried?
Setting path="app/downloads and filename=filename inside send_to_directory()
Setting send_from_directory(app.config["DOWNLOADS"], filename=filename, as_attachment=True)
Setting send_from_directory(app.config["DOWNLOADS"], filename, as_attachment=True)
None of the above changes helped in downloading the correct file (diff_results).
Is it mandatory to have a route like -
#app.route('/download/<filename>', methods = ["GET", "POST"])
def download(filename):
Am I missing something?

Related

Patch command not working - can't find file to patch

I'm unable to apply the following patch from github into my docker container. I get the error can't find file.
https://patch-diff.githubusercontent.com/raw/ManageIQ/manageiq-providers-ansible_tower/pull/267.patch
root#0fec7605d8b9 manageiq-providers-ansible_tower-d5ec9817e49c]# patch < 267.patch
can't find file to patch at input line 16
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|From 36f36d6a9985d8df27ae35cbe13bf47f16309a69 Mon Sep 17 00:00:00 2001
|From: Adam Grare <adam#grare.com>
|Date: Thu, 14 Oct 2021 10:55:39 -0400
|Subject: [PATCH 1/3] Fix merge_extra_vars with nil variables
|
|---
| .../ansible_tower/automation_manager/configuration_script.rb | 2 +-
| .../automation_manager/configuration_workflow.rb | 2 +-
| .../providers/ansible_tower/automation_manager/job.rb | 4 ++--
| 3 files changed, 4 insertions(+), 4 deletions(-)
|
|diff --git a/app/models/manageiq/providers/ansible_tower/automation_manager/configuration_script.rb b/app/models/manageiq/providers/ansible_tower/automation_manager/configuration_script.rb
|index d133a97..83bad07 100644
|--- a/app/models/manageiq/providers/ansible_tower/automation_manager/configuration_script.rb
|+++ b/app/models/manageiq/providers/ansible_tower/automation_manager/configuration_script.rb
--------------------------
File to patch: q
q: No such file or directory
Skip this patch? [y] ^C
The files are inside the following directory
/opt/manageiq/manageiq-gemset/bundler/gems/manageiq-providers-ansible_tower-d5ec9817e49c
I'm trying to apply patch from within this directory. All the files are inside the app directory.
[root#0fec7605d8b9 manageiq-providers-ansible_tower-d5ec9817e49c]# ls -l
total 92
-rw-r--r-- 1 root root 20923 Dec 18 09:28 267.patch
drwxrwxr-x 1 root root 4096 Nov 29 01:44 app
drwxrwxr-x 3 root root 4096 Nov 29 01:44 bin
drwxrwxr-x 2 root root 4096 Nov 29 01:44 bundler.d
-rw-r--r-- 1 root root 5734 Jul 13 18:25 CHANGELOG.md
drwxrwxr-x 2 root root 4096 Nov 29 01:44 config
-rw-r--r-- 1 root root 603 Jul 13 18:25 Gemfile
drwxrwxr-x 5 root root 4096 Nov 29 01:44 lib
-rw-r--r-- 1 root root 11358 Jul 13 18:25 LICENSE.txt
drwxrwxr-x 2 root root 4096 Nov 29 01:44 locale
-rw-r--r-- 1 root root 6630 Jul 13 18:25 manageiq-providers-ansible_tower.gemspec
-rw-r--r-- 1 root root 339 Jul 13 18:25 Rakefile
-rw-r--r-- 1 root root 1735 Jul 13 18:25 README.md

Unexpected bash readable test result with GitHub Actions

MWE
I have a GitHub Actions workflow that recently stopped working without me making changes. The error:
==> ERROR: /etc/makepkg.conf not found.
Aborting...
This is from running # sudo -Eu builder makepkg --printsrcinfo.
Source
Logs
The order of the logs seem to be wrong but it is correct in an earlier log (possibly due to ls -l having a large output).
The source of this error seems to be libmakepkg/util/config.sh.in:
# Source the config file; fail if it is not found
if [[ -r $MAKEPKG_CONF ]]; then
source_safe "$MAKEPKG_CONF"
else
error "$(gettext "%s not found.")" "$MAKEPKG_CONF"
plainerr "$(gettext "Aborting...")"
exit $E_CONFIG_ERROR
fi
I added the following to my entrypoint script:
echo "Writing SRCINFO..."
# Debug
echo "---"
ls -l /
echo "---"
ls -l /etc
echo "---"
sudo -Eu builder cat /etc/makepkg.conf
echo "---"
sudo -Eu builder /bin/bash -c "[[ -r "/etc/makepkg.conf" ]] && echo 1 || echo 0"
echo "---"
sudo -Eu builder makepkg --printsrcinfo > .SRCINFO
The builder user is created in build.sh:
useradd builder -m
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
I got:
Setting permissions...
Writing SRCINFO...
---
total 52
lrwxrwxrwx 1 root root 7 Feb 1 19:19 bin -> usr/bin
drwxr-xr-x 2 root root 4096 Jan 19 01:32 boot
drwxr-xr-x 5 root root 340 Feb 7 11:58 dev
-rwxr-xr-x 1 root root 836 Feb 7 11:57 entrypoint.sh
drwxr-xr-x 1 root root 4096 Feb 7 11:58 etc
drwxr-xr-x 6 root root 4096 Feb 7 11:58 github
drwxr-xr-x 1 root root 4096 Feb 7 11:57 home
lrwxrwxrwx 1 root root 7 Feb 1 19:19 lib -> usr/lib
lrwxrwxrwx 1 root root 7 Feb 1 19:19 lib64 -> usr/lib
drwxr-xr-x 2 root root 4096 Jan 19 01:32 mnt
drwxr-xr-x 2 root root 4096 Jan 19 01:32 opt
dr-xr-xr-x 159 root root 0 Feb 7 11:58 proc
drwxr-x--- 2 root root 4096 Jan 19 01:32 root
drwxr-xr-x 1 root root 4096 Feb 7 11:58 run
lrwxrwxrwx 1 root root 7 Feb 1 19:19 sbin -> usr/bin
drwxr-xr-x 4 root root 4096 Feb 1 19:19 srv
dr-xr-xr-x 12 root root 0 Feb 7 11:58 sys
drwxrwxrwt 2 root root 4096 Jan 19 01:32 tmp
drwxr-xr-x 1 root root 4096 Feb 7 11:57 usr
drwxr-xr-x 1 root root 4096 Feb 1 19:19 var
---
total 640
-rw-r--r-- 1 root root 0 Jan 19 01:32 arch-release
drwxr-xr-x 3 root root 4096 Feb 1 19:19 audit
-rw-r--r-- 1 root root 28 Dec 20 18:44 bash.bash_logout
-rw-r--r-- 1 root root 618 Dec 20 18:44 bash.bashrc
-rw-r--r-- 1 root root 447 Dec 2 16:02 bindresvport.blacklist
drwxr-xr-x 2 root root 4096 Dec 16 14:38 binfmt.d
drwxr-xr-x 4 root root 4096 Feb 1 19:19 ca-certificates
-rw------- 1 root root 722 Jan 19 01:32 crypttab
drwxr-xr-x 2 root root 4096 Feb 1 19:19 default
drwxr-xr-x 2 root root 4096 Jan 7 19:51 depmod.d
-rw-r--r-- 1 root root 685 Jan 31 20:31 e2scrub.conf
-rw-r--r-- 1 root root 97 Jan 13 22:50 environment
-rw-r--r-- 1 root root 1362 Jan 20 21:31 ethertypes
-rw-r--r-- 1 root root 126 Jan 19 01:32 fstab
-rw-r--r-- 1 root root 2584 Feb 6 00:09 gai.conf
-rw-r--r-- 1 root root 626 Feb 7 11:57 group
-rw-r--r-- 1 root root 610 Jan 31 00:20 group-
-rw------- 1 root root 558 Feb 7 11:57 gshadow
-rw------- 1 root root 546 Jan 31 00:20 gshadow-
-rw-r--r-- 1 root root 73 Jan 19 01:32 host.conf
-rw-r--r-- 1 root root 13 Feb 7 11:58 hostname
-rw-r--r-- 1 root root 174 Feb 7 11:58 hosts
-rw-r--r-- 1 root root 714 Dec 8 17:48 inputrc
drwxr-xr-x 2 root root 4096 Feb 1 19:19 iproute2
drwxr-xr-x 2 root root 4096 Feb 1 19:19 iptables
-rw-r--r-- 1 root root 20 Jan 19 01:32 issue
drwxr-xr-x 3 root root 4096 Feb 1 19:19 kernel
drwxr-xr-x 2 root root 4096 Jul 7 2020 keyutils
-rw-r--r-- 1 root root 369 Jan 14 00:32 krb5.conf
-rw-r--r-- 1 root root 18096 Feb 7 11:57 ld.so.cache
-rw-r--r-- 1 root root 117 Jan 19 01:32 ld.so.conf
drwxr-xr-x 1 root root 4096 Feb 7 11:57 ld.so.conf.d
-rw-r----- 1 root root 191 Jan 13 22:33 libaudit.conf
drwxr-xr-x 2 root root 4096 Feb 1 19:19 libnl
-rw-r--r-- 1 root root 17 Jan 31 00:19 locale.conf
-rw-r--r-- 1 root root 18 Jan 31 00:19 locale.gen
-rw-r--r-- 1 root root 9984 Feb 6 00:09 locale.gen.pacnew
-rw-r--r-- 1 root root 5645 Sep 7 13:42 login.defs
-rw-r--r-- 1 root root 5792 Jul 1 2020 makepkg.conf
-rw-r--r-- 1 root root 812 Jan 31 20:31 mke2fs.conf
drwxr-xr-x 2 root root 4096 Jan 7 19:51 modprobe.d
drwxr-xr-x 2 root root 4096 Dec 16 14:38 modules-load.d
-rw-r--r-- 1 root root 0 Jan 19 01:32 motd
lrwxrwxrwx 1 root root 12 Feb 7 11:58 mtab -> /proc/mounts
-rw-r--r-- 1 root root 767 Dec 2 16:02 netconfig
-rw-r--r-- 1 root root 2717 Feb 6 00:09 nscd.conf
-rw-r--r-- 1 root root 328 Jan 19 01:32 nsswitch.conf
drwxr-xr-x 1 root root 4096 Feb 7 11:57 openldap
lrwxrwxrwx 1 root root 19 Feb 1 19:19 os-release -> /usr/lib/os-release
-rw-r--r-- 1 root root 3264 Feb 7 11:57 pacman.conf
-rw-r--r-- 1 root root 2883 Jul 1 2020 pacman.conf.pacnew
drwxr-xr-x 1 root root 4096 Feb 7 11:57 pacman.d
drwxr-xr-x 1 root root 4096 Feb 7 11:57 pam.d
-rw-r--r-- 1 root root 744 Feb 7 11:57 passwd
-rw-r--r-- 1 root root 699 Jan 31 00:20 passwd-
drwxr-xr-x 2 root root 4096 Feb 1 19:19 pkcs11
-rw-r--r-- 1 root root 1020 Jan 19 01:32 profile
drwxr-xr-x 1 root root 4096 Feb 7 11:57 profile.d
-rw-r--r-- 1 root root 3171 Jan 3 17:14 protocols
-rw-r--r-- 1 root root 1814 Jul 7 2020 request-key.conf
drwxr-xr-x 2 root root 4096 Jul 7 2020 request-key.d
-rw-r--r-- 1 root root 649 Feb 7 11:58 resolv.conf
-rw-r--r-- 1 root root 1634 Feb 6 00:09 rpc
-rw-r--r-- 1 root root 139 Jan 19 01:32 securetty
drwxr-xr-x 2 root root 4096 Feb 1 19:19 security
-rw-r--r-- 1 root root 297708 Jan 3 17:14 services
-rw------- 1 root root 375 Feb 7 11:57 shadow
-rw------- 1 root root 346 Jan 31 00:20 shadow-
-rw-r--r-- 1 root root 83 Jan 19 01:32 shells
drwxr-xr-x 2 root root 4096 Feb 1 19:19 skel
drwxr-xr-x 5 root root 4096 Feb 1 19:19 ssl
-rw-r--r-- 1 root root 3975 Jan 26 18:34 sudo.conf
-r--r----- 1 root root 3160 Feb 7 11:57 sudoers
drwxr-x--- 2 root root 4096 Jan 26 18:34 sudoers.d
-rw-r--r-- 1 root root 6169 Jan 26 18:34 sudo_logsrvd.conf
drwxr-xr-x 2 root root 4096 Dec 16 14:38 sysctl.d
drwxr-xr-x 1 root root 4096 Feb 7 11:57 systemd
drwxr-xr-x 2 root root 4096 Dec 16 14:38 tmpfiles.d
drwxr-xr-x 1 root root 4096 Feb 7 11:57 udev
drwxr-xr-x 1 root root 4096 Feb 1 19:19 X11
-rw-r--r-- 1 root root 642 May 7 2020 xattr.conf
drwxr-xr-x 1 root root 4096 Feb 1 19:19 xdg
drwxr-xr-x 2 root root 4096 Feb 1 19:19 xinetd.d
---
#!/hint/bash
#
# /etc/makepkg.conf
#
...
SRCEXT='.src.tar.gz'
---
0
---
==> ERROR: /etc/makepkg.conf not found.
Aborting...
(The contents of /etc/makepkg.conf was concatenated.)
I also accidentally did [[ -r "/etc/makepkg.conf" ]] && echo 1 || echo 0 (as root) and I also got 0.
How is it possible that a file is not readable yet I can cat it? I also tried running the exact same commands in a local container and couldn't reproduce this issue, but this has happened every GitHub Actions run since it started.
This makes me think the Actions setup is causing an issue, but nothing seems odd there:
/usr/bin/docker build -t 442333:35a065f0b9f356b32f2852ba2f6b7296 -f "/home/runner/work/visual-studio-code-insiders-arch/visual-studio-code-insiders-arch/./.github/actions/pkg/Dockerfile" "/home/runner/work/visual-studio-code-insiders-arch/visual-studio-code-insiders-arch/.github/actions/pkg"
/usr/bin/docker run --name a065f0b9f356b32f2852ba2f6b7296_baf94b --label 442333 --workdir /github/workspace --rm -e pythonLocation -e LD_LIBRARY_PATH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/visual-studio-code-insiders-arch/visual-studio-code-insiders-arch":"/github/workspace" 442333:35a065f0b9f356b32f2852ba2f6b7296
Thanks for sharing this. I have precisely the same problems.
I added the following in my Dockerfile
RUN sed -i 's/\tif \[\[ -r $MAKEPKG_CONF \]\]; then/\tif \[\[ -f $MAKEPKG_CONF \]\]; then/' /usr/share/makepkg/util/config.sh
which replaces the check for read permission (-r) for the check whether the file exists and is a regular file (-f).
now my github action gets over this particular location, but fails with the next check:
==> ERROR: You do not have write permission for the directory $BUILDDIR (/tmp/aurutils).
Aborting...
This is not a solution and does not answer what's the underlying issue, but I hope it helps anyways.
This issue is caused by using glibc >= 2.33 on the container and an outdated version of the Docker engine on the host.
You can fix it by patching glibc in your container:
patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst
curl -LO https://repo.archlinuxcn.org/x86_64/$patched_glibc
bsdtar -C / -xvf $patched_glibc
Thanks to lxqt-panel for the workaround.

NodeJS child_process: npm - command not found

In my bundled Electron app, I have it extract a node project to a location. There is a script that is supposed to run npm install and when I run it through spawn, I get an error saying npm isn't found.
The code I'm using is:
const process = spawn('my_script.sh', {shell: 'bin/bash', detached: true});
#!/bin/bash
cd <location of package.json>
npm install
In the process of trying to debug this, I've done the following:
The command is able to be run when I pull up a new command line and running which npm points to /usr/bin.
I checked the PATH variable from the script that is run by spawn (putting echo $PATH) and it returns:
/snap/<app_name>/x1/usr/sbin:
/snap/<app_name>/x1/usr/bin:
/snap/<app_name>/x1/sbin:
/snap/<app_name>/x1/bin:
/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games:
/snap/<app_name>/x1/gnome-platform/usr/bin
which includes /usr/bin
I then printed the contents of /usr/bin from the script (added ls -l /usr/bin) and noticed that npm, node, and yarn were not in it. I then opened a new window and ran the command directly and the list was substantially longer then what was returned by the script
The result of ls -l /usr/bin when ran from the script (missing node, yarn, npm, and countless other files):
-rwxr-xr-x 1 root root 51384 Jan 18 2018 [
-rwxr-xr-x 1 root root 22696 Sep 27 2018 aa-enabled
-rwxr-xr-x 1 root root 22696 Sep 27 2018 aa-exec
-rwxr-xr-x 1 root root 22608 Mar 5 11:23 addpart
-rwxr-xr-x 1 root root 35032 Jan 18 2018 arch
lrwxrwxrwx 1 root root 4 Jul 7 05:47 awk -> mawk
-rwxr-xr-x 1 root root 55512 Jan 18 2018 b2sum
-rwxr-xr-x 1 root root 39096 Jan 18 2018 base32
-rwxr-xr-x 1 root root 39096 Jan 18 2018 base64
-rwxr-xr-x 1 root root 35000 Jan 18 2018 basename
-rwxr-xr-x 1 root root 7115 Jun 6 2019 bashbug
-rwxr-xr-x 1 root root 34952 May 3 06:30 bootctl
-rwxr-xr-x 1 root root 67672 May 3 06:30 busctl
lrwxrwxrwx 1 root root 3 May 23 2018 captoinfo -> tic
-rwxr-xr-x 1 root root 3329 Jun 4 12:25 catchsegv
-rwxr-xr-x 1 root root 853 Jul 15 2016 cautious-launcher
-rwxr-sr-x 1 root shadow 71816 Mar 22 2019 chage
lrwxrwxrwx 1 root root 11 Jun 18 2017 chardet3 -> chardetect3
-rwxr-xr-x 1 root root 389 Jun 18 2017 chardetect3
-rwxr-xr-x 1 root root 14336 Jan 22 08:40 chattr
-rwxr-xr-x 1 root root 63672 Jan 18 2018 chcon
-rwsr-xr-x 1 root root 76496 Mar 22 2019 chfn
-rwxr-xr-x 1 root root 30800 Mar 5 11:23 chrt
-rwsr-xr-x 1 root root 44528 Mar 22 2019 chsh
-rwxr-xr-x 1 root root 35000 Jan 18 2018 cksum
-rwxr-xr-x 1 root root 10240 May 23 2018 clear
-rwxr-xr-x 1 root root 10312 Jun 6 2019 clear_console
-rwxr-xr-x 1 root root 390 Jan 15 10:35 cloud-id
-rwxr-xr-x 1 root root 394 Jan 15 10:35 cloud-init
-rwxr-xr-x 1 root root 2108 Jan 14 14:27 cloud-init-per
-rwxr-xr-x 1 root root 47200 Aug 4 2017 cmp
-rwxr-xr-x 1 root root 39128 Jan 18 2018 comm
lrwxrwxrwx 1 root root 11 Jul 15 2016 compose -> run-mailcap
lrwxrwxrwx 1 root root 35 Aug 7 2018 console-conf -> ../share/subiquity/console-conf-tui
-rwxr-xr-x 1 root root 1565 Jul 7 05:45 core-sshd-host-keygen
-rwxr-xr-x 1 root root 6332 May 27 14:15 c_rehash
-rwxr-xr-x 1 root root 51416 Jan 18 2018 csplit
lrwxrwxrwx 1 root root 6 May 11 09:40 ctstat -> lnstat
-rwxr-xr-x 1 root root 43224 Jan 18 2018 cut
-rwxr-xr-x 1 root root 10224 Jun 11 13:25 dbus-cleanup-sockets
-rwxr-xr-x 1 root root 236584 Jun 11 13:25 dbus-daemon
-rwxr-xr-x 1 root root 22520 Jun 11 13:25 dbus-monitor
-rwxr-xr-x 1 root root 10224 Jun 11 13:25 dbus-run-session
-rwxr-xr-x 1 root root 26608 Jun 11 13:25 dbus-send
-rwxr-xr-x 1 root root 14320 Jun 11 13:25 dbus-update-activation-environment
-rwxr-xr-x 1 root root 10224 Jun 11 13:25 dbus-uuidgen
-rwxr-xr-x 1 root root 20142 Oct 25 2017 deb-systemd-helper
-rwxr-xr-x 1 root root 4434 Oct 25 2017 deb-systemd-invoke
-rwxr-xr-x 1 root root 22608 Mar 5 11:23 delpart
-rwxr-xr-x 1 root root 2550 Apr 1 2018 dh_bash-completion
-rwxr-xr-x 1 root root 145752 Aug 4 2017 diff
-rwxr-xr-x 1 root root 63704 Aug 4 2017 diff3
-rwxr-xr-x 1 root root 47296 Jan 18 2018 dircolors
-rwxr-xr-x 1 root root 30904 Jan 18 2018 dirname
-rwxr-xr-x 1 root root 153952 Sep 5 2019 dpkg-deb
-rwxr-xr-x 1 root root 100568 Jan 18 2018 du
-rwxr-xr-x 1 root root 7297 Apr 13 2018 ec2metadata
lrwxrwxrwx 1 root root 11 Jul 15 2016 edit -> run-mailcap
lrwxrwxrwx 1 root root 8 Jul 7 05:47 editor -> vim.tiny
-rwxr-xr-x 1 root root 35000 Jan 18 2018 env
lrwxrwxrwx 1 root root 8 Jul 7 05:47 ex -> vim.tiny
-rwxr-xr-x 1 root root 39128 Jan 18 2018 expand
-rwxr-sr-x 1 root shadow 22808 Mar 22 2019 expiry
-rwxr-xr-x 1 root root 47288 Jan 18 2018 expr
-rwxr-xr-x 1 root root 75992 Jan 18 2018 factor
-rwxr-xr-x 1 root root 18728 Mar 22 2019 faillog
-rwxr-xr-x 1 root root 26704 Mar 5 11:23 fallocate
-rwxr-xr-x 1 root root 238080 Nov 5 2017 find
-rwxr-xr-x 1 root root 30880 Mar 5 11:23 flock
-rwxr-xr-x 1 root root 43192 Jan 18 2018 fmt
-rwxr-xr-x 1 root root 35000 Jan 18 2018 fold
-rwxr-xr-x 1 root root 18512 Aug 9 2019 free
-rwxr-xr-x 1 root root 30856 Jun 4 12:25 getconf
-rwxr-xr-x 1 root root 31224 Jun 4 12:25 getent
-rwxr-xr-x 1 root root 14408 Mar 5 11:23 getopt
-rwsr-xr-x 1 root root 75824 Mar 22 2019 gpasswd
-rwxr-xr-x 1 root root 437264 Jan 10 2019 gpgv
-rwxr-xr-x 1 root root 35000 Jan 18 2018 groups
-rwxr-xr-x 1 root root 21883 Apr 13 2018 growpart
-rwxr-xr-x 1 root root 43224 Jan 18 2018 head
-rwxr-xr-x 1 root root 2514 Feb 2 2018 helpztags
-rwxr-xr-x 1 root root 30904 Jan 18 2018 hostid
-rwxr-xr-x 1 root root 18504 May 3 06:30 hostnamectl
lrwxrwxrwx 1 root root 7 Mar 5 11:23 i386 -> setarch
-rwxr-xr-x 1 root root 63744 Jun 4 12:25 iconv
-rwxr-xr-x 1 root root 43224 Jan 18 2018 id
-rwxr-xr-x 1 root root 59464 May 23 2018 infocmp
lrwxrwxrwx 1 root root 3 May 23 2018 infotocap -> tic
-rwxr-xr-x 1 root root 145664 Jan 18 2018 install
-rwxr-xr-x 1 root root 26704 Mar 5 11:23 ionice
-rwxr-xr-x 1 root root 26768 Mar 5 11:23 ipcmk
-rwxr-xr-x 1 root root 26704 Mar 5 11:23 ipcrm
-rwxr-xr-x 1 root root 51280 Mar 5 11:23 ipcs
lrwxrwxrwx 1 root root 19 Nov 11 2017 iptables-xml -> /sbin/xtables-multi
-rwxr-xr-x 1 root root 10280 Dec 30 2017 ischroot
-rwxr-xr-x 1 root root 47320 Jan 18 2018 join
lrwxrwxrwx 1 root root 16 Jul 7 05:47 jsondiff -> python3-jsondiff
lrwxrwxrwx 1 root root 17 Jul 7 05:47 jsonpatch -> python3-jsonpatch
lrwxrwxrwx 1 root root 19 Jul 7 05:47 jsonpointer -> python3-jsonpointer
lrwxrwxrwx 1 root root 18 Jul 7 05:47 jsonschema -> python3-jsonschema
-rwxr-xr-x 1 root root 4508 Jan 28 2018 kernel-install
-rwxr-xr-x 1 root root 43088 Mar 5 11:23 last
lrwxrwxrwx 1 root root 4 Mar 5 11:23 lastb -> last
-rwxr-xr-x 1 root root 18504 Mar 22 2019 lastlog
-rwxr-xr-x 1 root root 7786 Feb 25 2018 lcf
-rwxr-xr-x 1 root root 5422 Jun 4 12:25 ldd
lrwxrwxrwx 1 root root 9 Jul 7 05:46 less -> /bin/less
lrwxrwxrwx 1 root root 13 Jul 7 05:46 lessecho -> /bin/lessecho
lrwxrwxrwx 1 root root 13 Jul 7 05:46 lessfile -> /bin/lessfile
lrwxrwxrwx 1 root root 12 Jul 7 05:46 lesskey -> /bin/lesskey
lrwxrwxrwx 1 root root 13 Jul 7 05:46 lesspipe -> /bin/lesspipe
-rwxr-xr-x 1 root root 30904 Jan 18 2018 link
lrwxrwxrwx 1 root root 7 Mar 5 11:23 linux32 -> setarch
lrwxrwxrwx 1 root root 7 Mar 5 11:23 linux64 -> setarch
-rwxr-xr-x 1 root root 22888 May 11 09:40 lnstat
-rwxr-xr-x 1 root root 50592 Jun 4 12:25 locale
-rwxr-xr-x 1 root root 10240 Jan 30 06:28 locale-check
-rwxr-xr-x 1 root root 22600 May 3 06:30 localectl
-rwxr-xr-x 1 root root 338744 Jun 4 12:25 localedef
-rwxr-xr-x 1 root root 47792 Mar 5 11:23 logger
-rwxr-xr-x 1 root root 30904 Jan 18 2018 logname
-rwxr-xr-x 1 root root 10240 Jan 22 08:40 lsattr
-rwxr-xr-x 1 root root 71760 Mar 5 11:23 lscpu
-rwxr-xr-x 1 root root 71760 Mar 5 11:23 lsipc
-rwxr-xr-x 1 root root 35232 Mar 5 11:23 lslocks
-rwxr-xr-x 1 root root 63568 Mar 5 11:23 lslogins
-rwxr-xr-x 1 root root 43088 Mar 5 11:23 lsmem
-rwxr-xr-x 1 root root 38992 Mar 5 11:23 lsns
-rwxr-xr-x 1 root root 125416 Apr 3 2018 mawk
-rwxr-xr-x 1 root root 30864 Mar 5 11:23 mcookie
-rwxr-xr-x 1 root root 43224 Jan 18 2018 md5sum
lrwxrwxrwx 1 root root 6 Jan 18 2018 md5sum.textutils -> md5sum
-rwxr-xr-x 1 root root 10312 Mar 5 11:23 mesg
-rwxr-xr-x 1 root root 35098 Apr 9 2018 miniterm
-rwxr-xr-x 1 root root 63672 Jan 18 2018 mkfifo
-rwxr-xr-x 1 root root 189432 Jul 5 2018 mksquashfs
-rwxr-xr-x 1 root root 865 Jul 7 05:45 mkswapfile
-rwxr-xr-x 1 root root 26704 Mar 5 11:23 namei
lrwxrwxrwx 1 root root 4 Jul 7 05:47 nawk -> mawk
-rwsr-xr-x 1 root root 40344 Mar 22 2019 newgrp
-rwxr-xr-x 1 root root 35000 Jan 18 2018 nice
-rwxr-xr-x 1 root root 43288 Jan 18 2018 nl
-rwxr-xr-x 1 root root 35000 Jan 18 2018 nohup
-rwxr-xr-x 1 root root 35000 Jan 18 2018 nproc
-rwxr-xr-x 1 root root 31008 Mar 5 11:23 nsenter
-rwxr-xr-x 1 root root 26696 May 11 09:40 nstat
-rwxr-xr-x 1 root root 63736 Jan 18 2018 numfmt
-rwxr-xr-x 1 root root 67800 Jan 18 2018 od
-rwxr-xr-x 1 root root 723944 May 27 14:15 openssl
lrwxrwxrwx 1 root root 14 Jul 7 05:47 pager -> ../../bin/less
-rwxr-xr-x 1 root root 88144 Mar 5 11:23 partx
-rwsr-xr-x 1 root root 59640 Mar 22 2019 passwd
-rwxr-xr-x 1 root root 35032 Jan 18 2018 paste
-rwxr-xr-x 1 root root 35000 Jan 18 2018 pathchk
lrwxrwxrwx 1 root root 6 Oct 25 2018 pdb3 -> pdb3.6
lrwxrwxrwx 1 root root 23 Apr 17 20:56 pdb3.6 -> ../lib/python3.6/pdb.py
-rwxr-xr-x 2 root root 2097720 Nov 19 2018 perl
-rwxr-xr-x 2 root root 2097720 Nov 19 2018 perl5.26.1
-rwxr-xr-x 1 root root 26712 Aug 9 2019 pgrep
-rwxr-xr-x 1 root root 39128 Jan 18 2018 pinky
lrwxrwxrwx 1 root root 5 Aug 9 2019 pkill -> pgrep
-rwxr-xr-x 1 root root 18656 Jun 4 12:25 pldd
-rwxr-xr-x 1 root root 30808 Aug 9 2019 pmap
-rwxr-xr-x 1 root root 71960 Jan 18 2018 pr
lrwxrwxrwx 1 root root 11 Jul 15 2016 print -> run-mailcap
-rwxr-xr-x 1 root root 30904 Jan 18 2018 printenv
-rwxr-xr-x 1 root root 51384 Jan 18 2018 printf
-rwxr-xr-x 1 root root 35424 Mar 5 11:23 prlimit
lrwxrwxrwx 1 root root 28 Oct 15 2018 probert -> ../share/probert/bin/probert
-rwxr-xr-x 1 root root 71928 Jan 18 2018 ptx
-rwxr-xr-x 1 root root 10312 Aug 9 2019 pwdx
-rwxr-xr-x 1 root root 7812 Oct 25 2018 py3clean
-rwxr-xr-x 1 root root 12119 Oct 25 2018 py3compile
lrwxrwxrwx 1 root root 31 Oct 25 2018 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root 8 Oct 25 2018 pydoc3 -> pydoc3.6
-rwxr-xr-x 1 root root 79 Apr 17 20:56 pydoc3.6
lrwxrwxrwx 1 root root 12 Oct 25 2018 pygettext3 -> pygettext3.6
-rwxr-xr-x 1 root root 21547 Apr 17 20:56 pygettext3.6
-rwxr-xr-x 1 root root 372 Sep 25 2017 pyjwt3
lrwxrwxrwx 1 root root 9 Oct 25 2018 python3 -> python3.6
-rwxr-xr-x 2 root root 4526456 Apr 17 20:56 python3.6
-rwxr-xr-x 2 root root 4526456 Apr 17 20:56 python3.6m
-rwxr-xr-x 1 root root 1018 Oct 28 2017 python3-jsondiff
-rwxr-xr-x 1 root root 3661 Oct 28 2017 python3-jsonpatch
-rwxr-xr-x 1 root root 1342 May 1 2016 python3-jsonpointer
-rwxr-xr-x 1 root root 398 Nov 15 2017 python3-jsonschema
lrwxrwxrwx 1 root root 10 Oct 25 2018 python3m -> python3.6m
lrwxrwxrwx 1 root root 3 Jul 7 05:47 rcp -> scp
-rwxr-xr-x 1 root root 26696 May 11 09:40 rdma
-rwxr-xr-x 1 root root 47320 Jan 18 2018 realpath
-rwxr-xr-x 1 root root 14408 Mar 5 11:23 rename.ul
-rwxr-xr-x 1 root root 14408 Mar 5 11:23 renice
lrwxrwxrwx 1 root root 4 May 23 2018 reset -> tset
-rwxr-xr-x 1 root root 38992 Mar 5 11:23 resizepart
-rwxr-xr-x 1 root root 10312 Mar 5 11:23 rev
-rwxr-xr-x 1 root root 30 Jul 11 2017 rgrep
lrwxrwxrwx 1 root root 3 Jul 7 05:47 rlogin -> ssh
-rwxr-xr-x 1 root root 208 May 11 09:40 routef
-rwxr-xr-x 1 root root 1656 May 11 09:40 routel
lrwxrwxrwx 1 root root 3 Jul 7 05:47 rsh -> ssh
lrwxrwxrwx 1 root root 6 May 11 09:40 rtstat -> lnstat
-rwxr-xr-x 1 root root 35000 Jan 18 2018 runcon
-rwxr-xr-x 1 root root 18161 Jul 15 2016 run-mailcap
lrwxrwxrwx 1 root root 8 Jul 7 05:47 rview -> vim.tiny
-rwxr-xr-x 1 root root 10469 Dec 30 2017 savelog
-rwxr-xr-x 1 root root 100496 Mar 4 2019 scp
-rwxr-xr-x 1 root root 30792 Mar 5 11:23 script
-rwxr-xr-x 1 root root 26704 Mar 5 11:23 scriptreplay
-rwxr-xr-x 1 root root 51296 Aug 4 2017 sdiff
lrwxrwxrwx 1 root root 11 Jul 15 2016 see -> run-mailcap
-rwxr-xr-x 1 root root 2442 Mar 12 2018 select-editor
-rwxr-xr-x 1 root root 1209 Mar 12 2018 sensible-browser
-rwxr-xr-x 1 root root 1109 Mar 12 2018 sensible-editor
-rwxr-xr-x 1 root root 433 Mar 12 2018 sensible-pager
-rwxr-xr-x 1 root root 47288 Jan 18 2018 seq
-rwxr-xr-x 1 root root 18784 Mar 5 11:23 setarch
-rwxr-xr-x 1 root root 10312 Mar 5 11:23 setsid
-rwxr-xr-x 1 root root 43088 Mar 5 11:23 setterm
-rwxr-xr-x 1 root root 153960 Mar 4 2019 sftp
lrwxrwxrwx 1 root root 6 Mar 22 2019 sg -> newgrp
-rwxr-xr-x 1 root root 47320 Jan 18 2018 sha1sum
-rwxr-xr-x 1 root root 55512 Jan 18 2018 sha224sum
-rwxr-xr-x 1 root root 55512 Jan 18 2018 sha256sum
-rwxr-xr-x 1 root root 59608 Jan 18 2018 sha384sum
-rwxr-xr-x 1 root root 59608 Jan 18 2018 sha512sum
-rwxr-xr-x 1 root root 59608 Jan 18 2018 shred
-rwxr-xr-x 1 root root 55480 Jan 18 2018 shuf
-rwxr-xr-x 1 root root 26704 Aug 9 2019 skill
-rwxr-xr-x 1 root root 18512 Aug 9 2019 slabtop
lrwxrwxrwx 1 root root 3 Mar 4 2019 slogin -> ssh
lrwxrwxrwx 1 root root 32 Jul 7 05:47 snap -> /snap/snapd/current/usr/bin/snap
lrwxrwxrwx 1 root root 20 Jul 7 05:47 snapctl -> ../lib/snapd/snapctl
lrwxrwxrwx 1 root root 5 Aug 9 2019 snice -> skill
-rwxr-xr-x 1 root root 113120 Jan 18 2018 sort
-rwxr-xr-x 1 root root 55936 Jan 18 2018 split
-rwxr-xr-x 1 root root 727848 Mar 4 2019 ssh
-rwxr-xr-x 1 root root 346248 Mar 4 2019 ssh-add
-rwxr-sr-x 1 root crontab 362640 Mar 4 2019 ssh-agent
-rwxr-xr-x 1 root root 1456 Jan 16 2018 ssh-argv0
-rwxr-xr-x 1 root root 10658 Oct 2 2017 ssh-copy-id
-rwxr-xr-x 1 root root 420000 Mar 4 2019 ssh-keygen
-rwxr-xr-x 1 root root 420000 Mar 4 2019 ssh-keyscan
-rwxr-xr-x 1 root root 80088 Jan 18 2018 stat
-rwxr-xr-x 1 root root 47288 Jan 18 2018 stdbuf
-rwsr-xr-x 1 root root 149080 Jan 31 11:18 sudo
lrwxrwxrwx 1 root root 4 Jan 31 11:18 sudoedit -> sudo
-rwxr-xr-x 1 root root 56128 Jan 31 11:18 sudoreplay
-rwxr-xr-x 1 root root 39104 Jan 18 2018 sum
-rwxr-xr-x 1 root root 1558792 May 3 06:30 systemd-analyze
-rwxr-xr-x 1 root root 10312 May 3 06:30 systemd-cat
-rwxr-xr-x 1 root root 14408 May 3 06:30 systemd-cgls
-rwxr-xr-x 1 root root 30816 May 3 06:30 systemd-cgtop
-rwxr-xr-x 1 root root 22600 May 3 06:30 systemd-delta
-rwxr-xr-x 1 root root 10304 May 3 06:30 systemd-detect-virt
-rwxr-xr-x 1 root root 43104 May 3 06:30 systemd-mount
-rwxr-xr-x 1 root root 10304 May 3 06:30 systemd-path
-rwxr-xr-x 1 root root 88136 May 3 06:30 systemd-resolve
-rwxr-xr-x 1 root root 43080 May 3 06:30 systemd-run
-rwxr-xr-x 1 root root 18504 May 3 06:30 systemd-socket-activate
-rwxr-xr-x 1 root root 14408 May 3 06:30 systemd-stdio-bridge
lrwxrwxrwx 1 root root 13 May 3 06:30 systemd-umount -> systemd-mount
-rwxr-xr-x 1 root root 14328 May 23 2018 tabs
-rwxr-xr-x 1 root root 39096 Jan 18 2018 tac
-rwxr-xr-x 1 root root 67832 Jan 18 2018 tail
-rwxr-xr-x 1 root root 30800 Mar 5 11:23 taskset
-rwxr-xr-x 1 root root 35032 Jan 18 2018 tee
-rwxr-xr-x 1 root root 47288 Jan 18 2018 test
-rwxr-xr-x 1 root root 84080 May 23 2018 tic
-rwxr-xr-x 1 root root 815 Jul 7 05:47 timedatectl
-rwxr-xr-x 1 root root 22600 May 3 06:30 timedatectl.real
-rwxr-xr-x 1 root root 39552 Jan 18 2018 timeout
-rwxr-xr-x 1 root root 14424 Aug 9 2019 tload
-rwxr-xr-x 1 root root 14328 May 23 2018 toe
-rwxr-xr-x 1 root root 108304 Aug 9 2019 top
lrwxrwxrwx 1 root root 10 Jul 6 23:54 touch -> /bin/touch
-rwxr-xr-x 1 root root 18456 May 23 2018 tput
-rwxr-xr-x 1 root root 47288 Jan 18 2018 tr
-rwxr-xr-x 1 root root 39096 Jan 18 2018 truncate
-rwxr-xr-x 1 root root 22528 May 23 2018 tset
-rwxr-xr-x 1 root root 35000 Jan 18 2018 tsort
-rwxr-xr-x 1 root root 30904 Jan 18 2018 tty
-rwxr-xr-x 1 root root 15397 Jun 4 12:25 tzselect
-rwxr-xr-x 1 root root 40685 Feb 25 2018 ucf
-rwxr-xr-x 1 root root 19367 Feb 25 2018 ucfq
-rwxr-xr-x 1 root root 10722 Feb 25 2018 ucfr
-rwxr-xr-x 1 root root 39128 Jan 18 2018 unexpand
-rwxr-xr-x 1 root root 43224 Jan 18 2018 uniq
-rwxr-xr-x 1 root root 30904 Jan 18 2018 unlink
-rwxr-xr-x 1 root root 18712 Mar 5 11:23 unshare
-rwxr-xr-x 1 root root 98008 Jul 5 2018 unsquashfs
-rwxr-xr-x 1 root root 47112 Sep 5 2019 update-alternatives
-rwxr-xr-x 1 root root 10312 Aug 9 2019 uptime
-rwxr-xr-x 1 root root 35000 Jan 18 2018 users
-rwxr-xr-x 1 root root 22600 Mar 5 11:23 utmpdump
-rwxr-xr-x 1 root root 6913 Apr 13 2018 vcs-run
lrwxrwxrwx 1 root root 8 Jul 7 05:47 vi -> vim.tiny
lrwxrwxrwx 1 root root 8 Jul 7 05:47 view -> vim.tiny
-rwxr-xr-x 1 root root 1108024 Mar 18 13:29 vim.tiny
-rwxr-xr-x 1 root root 34912 Aug 9 2019 vmstat
lrwxrwxrwx 1 root root 8 Jul 7 05:47 w -> w.procps
-rwxr-sr-x 1 root tty 30800 Mar 5 11:23 wall
-rwxr-xr-x 1 root root 22952 Aug 9 2019 watch
-rwxr-xr-x 1 root root 43200 Jan 18 2018 wc
-rwxr-xr-x 1 root root 27144 Mar 5 11:23 whereis
lrwxrwxrwx 1 root root 10 Jul 6 23:54 which -> /bin/which
-rwxr-xr-x 1 root root 51416 Jan 18 2018 who
-rwxr-xr-x 1 root root 30904 Jan 18 2018 whoami
-rwxr-xr-x 1 root root 63488 Sep 17 2019 wpa_passphrase
-rwxr-xr-x 1 root root 18504 Aug 9 2019 w.procps
lrwxrwxrwx 1 root root 7 Mar 5 11:23 x86_64 -> setarch
-rwxr-xr-x 1 root root 71896 Nov 5 2017 xargs
-rwxr-xr-x 1 root root 38 Jul 7 05:47 xdg-open
-rwxr-xr-x 1 root root 886 Jul 7 05:47 xdg-settings
-rwxr-xr-x 1 root root 18552 Mar 18 13:29 xxd
-rwxr-xr-x 1 root root 30904 Jan 18 2018 yes
-rwxr-xr-x 1 root root 18488 Jun 4 12:25 zdump
A snippet of the results from running it in a command line window (includes yarn, npm, and node):
// The rest is cut off
lrwxrwxrwx 1 root root 21 Apr 29 12:37 rcp -> /etc/alternatives/rcp
-rwxr-xr-x 1 root root 149096 Apr 3 01:47 rctest
-rwxr-xr-x 1 root root 9112 Mar 26 04:23 rdiffdir
-rwxr-xr-x 1 root root 133360 Feb 13 11:21 rdma
lrwxrwxrwx 1 root root 24 Apr 29 12:37 readelf -> x86_64-linux-gnu-readelf
-rwxr-xr-x 1 root root 51544 Sep 5 2019 readlink
-rwxr-xr-x 1 root root 51576 Sep 5 2019 realpath
-rwxr-xr-x 1 root root 14568 Mar 22 10:42 recode-sr-latin
-rwxr-xr-x 1 root root 3445 Oct 23 2016 recountdiff
-rwxr-xr-x 1 root root 89 Feb 22 00:20 red
-rwxr-xr-x 1 root root 34928 Oct 23 2016 rediff
...
...
...
-rwxr-xr-x 1 root root 40360 Mar 18 2018 xvidtune
-rwxr-xr-x 1 root root 18744 Feb 29 00:29 xvinfo
-rwxr-xr-x 1 root root 39232 Feb 28 17:10 xwd
lrwxrwxrwx 1 root root 34 Apr 29 12:37 x-window-manager -> /etc/alternatives/x-window-manager
-rwxr-xr-x 1 root root 51592 Feb 29 00:29 xwininfo
-rwxr-xr-x 1 root root 35120 Feb 28 17:10 xwud
lrwxrwxrwx 1 root root 31 Apr 29 12:37 x-www-browser -> /etc/alternatives/x-www-browser
-rwxr-xr-x 1 root root 18712 Apr 15 01:40 xxd
-rwxr-xr-x 1 root root 80224 Jan 27 2019 xz
lrwxrwxrwx 1 root root 2 Apr 29 12:37 xzcat -> xz
lrwxrwxrwx 1 root root 6 Apr 29 12:37 xzcmp -> xzdiff
-rwxr-xr-x 1 root root 6632 Jan 27 2019 xzdiff
lrwxrwxrwx 1 root root 6 Apr 29 12:37 xzegrep -> xzgrep
lrwxrwxrwx 1 root root 6 Apr 29 12:37 xzfgrep -> xzgrep
-rwxr-xr-x 1 root root 5628 Jan 27 2019 xzgrep
-rwxr-xr-x 1 root root 1802 Jan 27 2019 xzless
-rwxr-xr-x 1 root root 2161 Jan 27 2019 xzmore
lrwxrwxrwx 1 root root 22 Mar 9 10:51 yarn -> ../share/yarn/bin/yarn
lrwxrwxrwx 1 root root 22 Mar 9 10:51 yarnpkg -> ../share/yarn/bin/yarn
-rwxr-xr-x 1 root root 63720 Apr 7 15:15 yelp
-rwxr-xr-x 1 root root 39256 Sep 5 2019 yes
-rwxr-xr-x 1 root root 409 Apr 10 08:47 youtube-dl
lrwxrwxrwx 1 root root 8 Apr 29 12:37 ypdomainname -> hostname
-rwxr-xr-x 1 root root 1984 Dec 13 2019 zcat
-rwxr-xr-x 1 root root 1678 Dec 13 2019 zcmp
-rwxr-xr-x 1 root root 5880 Dec 13 2019 zdiff
-rwxr-xr-x 1 root root 26840 Apr 14 14:26 zdump
-rwxr-xr-x 1 root root 29 Dec 13 2019 zegrep
-rwxr-xr-x 1 root root 135960 Feb 27 03:31 zenity
-rwxr-xr-x 1 root root 29 Dec 13 2019 zfgrep
-rwxr-xr-x 1 root root 2081 Dec 13 2019 zforce
-rwxr-xr-x 1 root root 7585 Dec 13 2019 zgrep
-rwxr-xr-x 1 root root 216256 Apr 21 2017 zip
-rwxr-xr-x 1 root root 93816 Apr 21 2017 zipcloak
-rwxr-xr-x 1 root root 50718 Mar 6 15:15 zipdetails
-rwxr-xr-x 1 root root 2953 Aug 16 2019 zipgrep
-rwxr-xr-x 1 root root 186664 Aug 16 2019 zipinfo
-rwxr-xr-x 1 root root 89488 Apr 21 2017 zipnote
-rwxr-xr-x 1 root root 93584 Apr 21 2017 zipsplit
-rwxr-xr-x 1 root root 26952 Jan 30 14:30 zjsdecode
-rwxr-xr-x 1 root root 2206 Dec 13 2019 zless
-rwxr-xr-x 1 root root 1842 Dec 13 2019 zmore
-rwxr-xr-x 1 root root 4553 Dec 13 2019 znew
So for some reason the contents of /usr/bin is different when accessed from my distros command line v. the spawned script (1745 v. 317 lines printed when adding | wc -l). Why is this the case? I can't think of any reason that would cause this behavior, and the child process docs haven't shed any additional light.

.htaccess shows up | But It doesn't exist

/var/www/html/talent-media.com/public_html/help/scp/apps/.htaccess
shows up, but there is no .htaccess file as per
[root#0rcan0mic apps]# ls -al
total 12
drwxr-xr-x. 2 root root 4096 Apr 28 00:05 .
drwxr-xr-x. 6 root root 4096 Mar 20 01:11 ..
-rw-r--r--. 1 root root 1349 Mar 20 01:11 dispatcher.php
[root#0rcan0mic apps]# pwd
/var/www/html/talent-media.com/public_html/help/scp/apps
[root#0rcan0mic apps]#
Thoughts?

why not insert a watch to the top level directory with auditctl?

With the man manual, I know some information about auditctl. But with the option -w path, I found some information as follow:
Insert a watch for the file system object at path. You cannot insert a watch to the top level directory. This is prohibited by the kernel. Wildcards are not supported either and will generate a warning.
According to my understanding, I think the command auditctl -w / could not insert a watch to the top level directory. But with my test in CentOS, I found that is OK?
The result test information:
[centos#localhost ~]$ sudo auditctl -w /
[centos#localhost ~]$ sudo auditctl -l
-w / -p rwxa
[centos#localhost ~]$ cd /
[centos#localhost /]$ pwd
/
[centos#localhost /]$ ll
total 24
-rw-r--r--. 1 root root 0 Mar 13 17:01 1
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 bin -> usr/bin
dr-xr-xr-x. 4 root root 4096 Mar 13 17:15 boot
drwxr-xr-x. 20 root root 3320 Mar 14 02:15 dev
drwxr-xr-x. 142 root root 8192 Mar 14 02:14 etc
drwxr-xr-x. 3 root root 20 Mar 13 17:12 home
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Mar 13 16:56 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Nov 5 11:38 media
-rw-r--r--. 1 root root 0 Mar 13 21:40 mmm
drwxr-xr-x. 2 root root 6 Nov 5 11:38 mnt
drwxr-xr-x. 3 root root 16 Mar 13 17:08 opt
dr-xr-xr-x. 219 root root 0 Mar 14 02:14 proc
dr-xr-x---. 6 root root 234 Mar 13 11:53 root
drwxr-xr-x. 40 root root 1180 Mar 14 02:15 run
lrwxrwxrwx. 1 root root 8 Mar 13 16:56 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Nov 5 11:38 srv
dr-xr-xr-x. 13 root root 0 Mar 14 02:14 sys
drwxrwxrwt. 42 root root 4096 Mar 14 04:04 tmp
drwxr-xr-x. 2 root root 6 Mar 13 21:40 ttt
drwxr-xr-x. 13 root root 155 Mar 13 16:56 usr
drwxr-xr-x. 21 root root 4096 Mar 14 02:14 var
[centos#localhost /]$ sudo mkdir alex
[centos#localhost /]$ sudo touch alexzl
[centos#localhost /]$ ll
total 24
-rw-r--r--. 1 root root 0 Mar 13 17:01 1
drwxr-xr-x. 2 root root 6 Mar 14 04:17 alex
-rw-r--r--. 1 root root 0 Mar 14 04:17 alexzl
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 bin -> usr/bin
dr-xr-xr-x. 4 root root 4096 Mar 13 17:15 boot
drwxr-xr-x. 20 root root 3320 Mar 14 02:15 dev
drwxr-xr-x. 142 root root 8192 Mar 14 02:14 etc
drwxr-xr-x. 3 root root 20 Mar 13 17:12 home
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Mar 13 16:56 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Nov 5 11:38 media
-rw-r--r--. 1 root root 0 Mar 13 21:40 mmm
drwxr-xr-x. 2 root root 6 Nov 5 11:38 mnt
drwxr-xr-x. 3 root root 16 Mar 13 17:08 opt
dr-xr-xr-x. 218 root root 0 Mar 14 02:14 proc
dr-xr-x---. 6 root root 234 Mar 13 11:53 root
drwxr-xr-x. 40 root root 1180 Mar 14 02:15 run
lrwxrwxrwx. 1 root root 8 Mar 13 16:56 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Nov 5 11:38 srv
dr-xr-xr-x. 13 root root 0 Mar 14 02:14 sys
drwxrwxrwt. 42 root root 4096 Mar 14 04:04 tmp
drwxr-xr-x. 2 root root 6 Mar 13 21:40 ttt
drwxr-xr-x. 13 root root 155 Mar 13 16:56 usr
drwxr-xr-x. 21 root root 4096 Mar 14 02:14 var
[centos#localhost /]$ sudo ausearch -f /
.............
.............
time->Tue Mar 14 04:17:00 2017
type=PATH msg=audit(1489479420.957:1682): item=1 name="alex" objtype=CREATE
type=PATH msg=audit(1489479420.957:1682): item=0 name="/" inode=64 dev=fd:00 mode=040555 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:root_t:s0 objtype=PARENT
type=CWD msg=audit(1489479420.957:1682): cwd="/"
type=SYSCALL msg=audit(1489479420.957:1682): arch=c000003e syscall=83 success=no exit=-13 a0=7ffeb030b435 a1=1ff a2=1ff a3=7ffeb030a370 items=2 ppid=3444 pid=5955 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=pts0 ses=1 comm="mkdir" exe="/usr/bin/mkdir" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
.............
time->Tue Mar 14 04:17:39 2017
type=PATH msg=audit(1489479459.343:1915): item=1 name="/lib64/ld-linux-x86-64.so.2" inode=33613563 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0 objtype=NORMAL
type=PATH msg=audit(1489479459.343:1915): item=0 name="/usr/bin/sudo" inode=1461019 dev=fd:00 mode=0104111 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:sudo_exec_t:s0 objtype=NORMAL
type=CWD msg=audit(1489479459.343:1915): cwd="/"
type=EXECVE msg=audit(1489479459.343:1915): argc=3 a0="sudo" a1="touch" a2="alexzl"
type=BPRM_FCAPS msg=audit(1489479459.343:1915): fver=0 fp=0000000000000000 fi=0000000000000000 fe=0 old_pp=0000000000000000 old_pi=0000000000000000 old_pe=0000000000000000 new_pp=0000001fffffffff new_pi=0000000000000000 new_pe=0000001fffffffff
type=SYSCALL msg=audit(1489479459.343:1915): arch=c000003e syscall=59 success=yes exit=0 a0=e21e00 a1=e99fb0 a2=e34670 a3=7ffe09a62fa0 items=2 ppid=3444 pid=5971 auid=1000 uid=1000 gid=1000 euid=0 suid=0 fsuid=0 egid=1000 sgid=1000 fsgid=1000 tty=pts0 ses=1 comm="sudo" exe="/usr/bin/sudo" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
----
Why the man manual does not support insertion a watch to the top level directory, but the test is OK?
I think this problem is that it limit to insert a watch on the top level directory not the child directory or file. for example, if you want to insert a watch to root directory, it is prohibited, but it could add the watches to child directory and file at the same time.

Resources