answersLogoWhite

0


Best Answer

the unix phylosophy is "do a single job correctly" . due to this the authors / creatorscreated unix commands simpler. to do complex tasks the simpler commands are combined. for example

head command is used to displasy the top ten or required number of lines from a file "file"

tail commandis used to displasy the lastten or required number of lines from a file "file"

but if i require to lines from 3rd line to 10th line i does not have the command to do this

i combine head & tail commands

head -10 file | tail -7

by

rami reddy

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Unix has developed under the philosophy of keeping things simple. That is, complex tasks should be split into smaller tasks, each performed by a different program. Unix uses a concept of 'pipes,' where output from one program is fed into another for further processing. Consider the following example:

Let's say we need to count some votes stored in a text file. On each line there is a name. Each vote takes up one line; if "Jack" was voted 12 times, then 12 lines of the file will be "jack". Instead of writing a program to do this, we can break this up into small pieces. The logic required is as follows:

  1. Sort the list in alphabetical order
  2. Count how many times each name appears
  3. Sort the result in descending numerical order

In Unix, this would be accomplished by the following commands:

  1. sort
  2. uniq -c
  3. sort -rn

String these commands together, and you get:

$ sort | uniq -c | sort -rn

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why do Unix commands perform simple tasks rather than more complex ones?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why are Unix commands simple rather than complex tasks?

UNIX commands are designed to be simple in the first place; they basically do one task per command. To make a more powerful sequence, just put (or pipe) several commands together in a sequence. The ability to use many of the commands in different scenarios just by the command sequence is very powerful; the individual commands do not have to be that powerful or complex, but the result of using several of them in a row makes for a very powerful system.


What was the first piece of stage machinery called?

the Stage itself . this is a platform from which to mount equipment and to Perform on . this can be a simple platform or a very complex arrangement of complex machinery


What is complex but is based on units that are simple?

A computer is an example of something complex that is based on simple units. The computer consists of basic components like transistors and logic gates, which work together to perform complex functions like processing data and running software.


What is a simple complex carbohydrate?

There is no such thing as a simple complex carbohydrate. Carbohydrates are either simple or complex; they cannot be both.


What is a CISC processor?

"CISC" stands for Complex Instruction Set Computer, CISC processor can execute complex instructions in one or more clock cycles. It is meant to differentiate it from a RISC or Reduced Instruction Set Computer, which can only perform one simple instruction in (usually) one clock cycle. A CISC is meant to have many machine level commands carried out as part of a single assembly command. The assembly command is broken into a series of "micro-code" commands which are executed internal to the processor by a "micro-code sequencer".


When was Simple Complex created?

Simple Complex was created in 2003.


What kind of food can be simple or complex?

Food that can be simple or complex is carbohydrates.


Meaning of simple to complex in childcare?

what does simple to complex mean for childcare


Is eukaryote simple or complex?

They are complex.


Is an egg a simple or a complex carbohydrate?

Eggs would be a complex carbohydrate.


Are prokaryotic simple or complex?

Simple


Are flatworms simple or complex?

Simple