# about the general format of shell command



## jronald (Mar 20, 2010)

For example, in tcsh, `ls -R .` can't be written as `ls . -R`.
I think `ls . -R` is better, some reasons:
1. parameters makes sense when the object that the command operats on is determined first.
2. In practice, for a newbie, if I have to type the parameters first, I may forget the object (path name for ls) after do a complicated combinaton of paramters, and have to reference the object again.
If parameters come first, what are the benifits?


----------



## Alt (Mar 20, 2010)

Even if your idea have real benefit, they will NEVER change it cus backward compatibility.
You can give many targets in current syntax
ls -R /home/alt/ /home/jronald


----------



## Beastie (Mar 20, 2010)

It has nothing to do with the shell itself. The shell only parses the command line and stores the different parameters (separated by spaces) so that the *applications* can use them. It doesn't understand or care about the order. In other words, you'd have to change every single application, not the shell.
By looking at ls(1)'s man page, or any other application that operates on files (cp, mv, grep, ln, etc.), you can see they always expect options first and file names last.


----------



## phoenix (Mar 21, 2010)

And, if you look at just about any Unix application, you will notice that the syntax is always the same:

*command options paths*


----------

