1
vote
Get a list of all user's commands from a non-interactive shell
Turns out, I was quite close to the solution. I was confusing login shells and interactive shells. Different things. Instead of $SHELL --login, all I needed to do was $SHELL -i. The following will ...
1
vote
Basename of the root directory: why does it return the root directory itself?
Certainly / is a leading directory component and has not been removed. ... php's basename() function returns the empty string for that case.
Frame challenge: how about something like /path/to/some/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
command × 1053linux × 243
bash × 188
command-line × 174
shell × 148
shell-script × 74
terminal × 68
files × 37
find × 34
ssh × 28
sed × 26
scripting × 26
ubuntu × 25
ls × 24
path × 24
process × 21
debian × 20
centos × 18
text-processing × 17
directory × 17
pipe × 17
variable × 17
grep × 16
sudo × 16
alias × 16