Options in Unix


Users can control the behaviour of most Unix commands by passing them command-line options. As an example, the ls command can produce output in many formats.
 
  • Enter the command: ls -l 

  • In this case you've typed the ls command with the -l option that causes the output to be printed in the "long" format. In the long format, a lot more information is printed about each file and directory that is listed. The output contains, among other things, the owner of the file, the file size and the time of last modification. 

    As another example, the rm command accepts an option -r that allows you to delete a non-empty directory. This option causes all files and sub-directories within the directory to be deleted. This is an option that should be used with extreme caution, so that you don't inadvertently delete files that you didn't intend to. 



     
    Previous Table of Contents Continue


    Last modified: Tue Jan 6 20:38:53 EST 1998