Rahul's answer is relevant to your question, because what you want is a) not a good idea and b) probably only possible by creating a custom shell. Executables like ls
are separate, stand-alone programs that handle their arguments by themselves - if you'd want to prevent users from using ls -l
, you would have to write and compile your own custom ls
. As you can probably imagine, that would not be easy and it would also take a lot of time, because you have to do that for every single command that you want to change.
You could maybe try to replace the whole shell (in your case probably bash
) completely with a different shell that filters the commands of your users. For example, it could try to remove the -l
from ls
command lines before actually calling ls
. This isn't as easy as it sounds though, because shells and also the commands that you can run from a shell usually have a very powerful and complex syntax, and trying to filter that will probably leave holes and break stuff.
I think that this can be possible since there are some commands like chsh
or passwd
which a standard user can run them, but he get permission denied when he runs chsh root
or passwd -a -S
.
That's something else entirely, because these programs are written that way. If you'd want to change their behaviour just as you want to change the behaviour of ls
, you would have to modify their source codes and recompile them.