3 ms·
It isn't what I think it is? Oh. Then it must be: command ls -F directory | grep -v '[/@]$' | nl | tail -n 1 | cut -f 1 (-:
by JdeBP 3y ago
It isn't what I think it is?
Oh.
Then it must be:
command ls -F directory | grep -v '[/@]$' | nl | tail -n 1 | cut -f 1
(-:
- chias 3y agoThis doesn't work. Try setting up a folder as follows: touch first$'\n'file touch .hidden$'\n'file mkdir folder$'\n'. touch folder$'\n'./another$'\n'file mkdir normal touch normal/whatever This folder has two files in it, or four if you count files in subdirectories. Your solution incorrectly outputs 3.
- JdeBP 3y agoAs clearly stated, the above is not what I think the way to do it is.