Feature request (ls): format file mode (permission) in base 8
Author: nfischerCreated Jan 6, 2022Updated Dec 21, 2024
Labelsfeaturelow prioritybash compat
I noticed that shx ls -l prints the file permission in base 10 (decimal). This is difficult to understand since this is represented more naturally in base 8 (octal). The ShellJS API (shell.ls('-l')) actually returns a structured object, however it includes a toString() implementation on the object as well:
https://github.com/shelljs/shelljs/blob/ad911973cdbe1a6f5f3192d215c78ce3a9060492/src/ls.js#L136-L139
Most folks relying on shell.ls('-l') are probably using the structured object rather than its stringified version. The stringified version is mostly relevant for https://github.com/shelljs/shx and https://github.com/nfischer/n_shell.
Source: shelljs/shelljs