You are not logged in.
Pages: 1
ls file lister utility doesn't work correctly if current directory contains filenames beginning with "-" sign.
If I use plain command "ls" it works fine, however when I try "ls *.*" I get an error message:
ls: invalid option -- '0'
Try 'ls --help' for more information.Offline
You can use `--' to signal end of options, in particular, `ls -- *`. This is a universally applicable trick.
This silver ladybug at line 28...
Offline
Alternatively, you can include the current directory in the path.
e.g.
ls ./-0Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
What is the benefit of 'ls *.*' over 'ls'?
I can't reproduce your problem. Can you post an example ls output of said directory?
Is your 'ls' aliased to something?
Offline
'ls *.*' lists files with extensions.
Try the following:
touch ./-0.txt
ls *.*Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Fun fact: Chet Ramey (the Bash maintainer) puts a file named "-i" in the bash source, to pass "-i" to rm / cp by passing "*" to it.
This silver ladybug at line 28...
Offline
'ls *.*' lists files with extensions.
Try the following:
touch ./-0.txt ls *.*
Sigh. Of course.
I don't know what was I thinking.
I should have posted the files I created to test it:
$ ls
-1 -2 -3 4 5 6<shakes head>
Offline
Pages: 1