Ls command

I know you can create a new file in the linux terminal with the touch command. I was wondering if ls can be used as an alternative to create a new file. For example, is ls filename the same as touch fillename?

No, ls will list files and directories. you can use it to find certain file patterns, extensions, etc. you can use it w/ grep for pattern matching too.

See here for examples.

I did ls + a new file and it worked on my terminal. It seems that it is the same thing as touch.

1 Like