I suspect this has to do with my
-F Display a slash ('/') immediately after each pathname that is a directory, an asterisk ('*') after each that is executable, an at
sign ('@') after each symbolic link, an equals sign ('=') after each
socket, a percent sign ('%') after each white-out, and a vertical bar
('|') after each that is a FIFO.
for f in `ls *.sh`
wc -l $f
wc: foo.sh*: open: No such file or directory
wc: bar.sh*: open: No such file or directory
There is no need to use
ls in order to generate a list of matching files. You can just use the pattern directly:
for f in *.sh do wc -l $f done
This also has the advantage to work with filenames that contain spaces.
Generally speaking: the output of ls is for human consumption, it should never be parsed. Usually file lists can be generated directly with globbing and any information
ls might provide can be retrieved by other means (e.g.
That being said:
-F is not enabled by default, hence why there is an option for that. I suspect that
ls is an alias. You can check with
whence -v ls
While oh-my-zsh by default creates an alias to
-F is not part of the settings.
If you just want to use an unmodified
ls (maybe with different options) you can prepend the
command precommand modifier:
This will run the external command
/bin/ls) instead of an alias or a function.
If you want to get rid of
-F permanently, you can either overwrite it somewhere at the very end of your configuration. Or you track down where it is set and change it there. This command might help in finding where the alias is set:
grep -r $(whence ls) ~/.zshrc ~/oh-my-zsh.sh ~/.oh-my-zsh
Depending on your setup there might be additional configuration files.