| Not sure on why this comment got down-voted. If it's because I did not explain how to do that, there is howto do it: http://mywiki.wooledge.org/BashFAQ/004
If it's because the comment on the given example... $ touch file1
$ ls -l | wc -l
1
$ touch "file 2"
$ ls -l | wc -l
2
... (?)If we were talking about "new lines in file names", or "dashes at the beginning of file names", or code injection through file names, then we could be talking of more complex solutions. But the space issues in shell are simple, and have known solutions. If you're a daily user or you're not at learning stage, spaces don't turn to be a issue. |