This is the standard output of ls -ln | nl
wolf@linux:~$ ls -lh | nl
1 total 24
2 -rw-rw-r-- 1 wolf wolf 186 Sep 24 22:18 01.py
3 -rw-rw-r-- 1 wolf wolf 585 Sep 24 22:21 02.py
4 -rw-rw-r-- 1 wolf wolf 933 Sep 24 22:26 03.py
wolf@linux:~$
Instead of starting the number from total 24
, would it be possible to start it from the actual files/directory which is the second line?
Desired output
wolf@linux:~$ ls -lh | nl
total 24
1 -rw-rw-r-- 1 wolf wolf 186 Sep 24 22:18 01.py
2 -rw-rw-r-- 1 wolf wolf 585 Sep 24 22:21 02.py
3 -rw-rw-r-- 1 wolf wolf 933 Sep 24 22:26 03.py
wolf@linux:~$
ls -lh | tail -n +2 | nl
would probably be cleaner. – Ángel Sep 26 '20 at 00:04