Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Unix commands


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Unix commands

  1. 1. UNIX COMMANDSis -l : lists your files in long format, which contains lots of useful information, e.g. the exact size ofthe file, who owns the file and who has the right to look at it, and when it was last modified.cp filename1 filename2 : copies a filerm filename : removes a file. It is wise to use the option rm -i, which will ask you for confirmationbefore actually deleting anything.chmod options filename : lets you change the read, write, and execute permissions on your files.The default is that only you can look at them and change them. u - User who owns the file. g - Group that owns the file. o - Other. a - All. r - Read the file. w - Write or edit the file. x - Execute or run the file as a program.Tool: dirname : change directory. you basically go to another directory, and you will see the files inthat directory when you do ls. you always start out in your home directory, and you can get backthere by typing cd without arguments. cd .. will get you one level up from your current position.pwd : tells you where you currently are.grep string filename(s) : looks for the string in the files. This can be useful a lot of purposes,e.g. finding the right file among many, figuring out which is the right version of something, and evendoing serious corpus work. grep comes in several varieties (grep, egrep, and fgrep) and has a lot ofvery flexible options. Check out the man pages if this sounds good to you.mkdir dirname --- make a new directory
  2. 2. LIFE CYCLEThe Waterfall model (proposed by Royce)each activity completes before the next activity startsThere is no repetition of activities.The waterfall model is often used to plan activities within activities of more complex models.there is often a requirement to check that the outputs of each activity not only satisfy the inputrequirements but that the outputs also satisfy the ‘real-world’ requirements as wellAs can be seen, the activities still progress from left to right, with each activity ‘signed-off’ before thenext commences.But now there is validation of each stage of the implemented system.
  3. 3. Rapid Prototyping diagramMethodology - SSADM (Structured Systems Analysis and Design Methodology) aThe main premise behind prototyping is that users don’t know what they really want.The aim is to provide early ‘models’ of the final system which let users explore their needs betterthan would be possible just by talking to an analyst.There are two approaches to prototyping: • ‘throw-away’ prototypes, where early prototypes do not contribute to the final product • ‘evolutionary’ prototypes, where early prototypes build up into the final product - this is the most common form of prototyping todayThe core of prototyping is the Prototype Iteration activity, where repeated prototypes aredeveloped, evaluated by users and refinedPrototyping has advantages in that the user feels (or should feel) more involved in the developmentprocessAlso, based on the idea that it is easier to fix problems early in the development process, additionalattention is given to the earlier activities (those building up to the first prototype) - this leads tolower maintenance costs.An example given by Connell & Shafer suggests that something like 25% of the lifetime costs ofsoftware might be saved by adopting a prototyping approach.Prototyping allows users to see these errors at an early stage, thus allowing quick and cheapcorrection.Another rather significant problem is that performance of the final product may not be satisfactory,due to the piecemeal way in which it is constructedRapid prototyping methodology - DSDM (Dynamic Systems Development Method)
  4. 4. TestingUnit testing • testing and verifying single program units Integration testing • verifying the interfaces between units Regression testing • ensuring that changes do not affect existing parts of the systemSystems testing • ensuring a system meets its objectives Acceptance testing • ensures the system meets user requirements--------------------------------------------------“black box” • the tester only tests that the outputs are correct (as per the requirements specification) for given inputs“white box” • examine the internal detail of units to verify that all the ‘code’ is functioning correctly Integration testing links white and black box testing-------------------------------------------------Black-Box TestingSo, if we can’t test every possible list, how many do we need to test?We could take a statistical view of the problem, that by testing so-many lists we achieve such-and-such a probability of the module functioning correctly for any lists.Also we have to know things like whether the input list can contain duplicate values.In this case we might build ‘test cases’as follows: • a zero-length list • one element lists • lists of length = a power of 2 (this, of course, assumes that we know something about how some sorting algorithms work!) • lists of length = a power of 2 minus 1Thus a major drawback of black-box testing is that it is usually impossible exhaustively to test amodule------------------------------------------------------------------------
  5. 5. White Box TestingIf necessary, we could trace the execution of program statements during testing to ensure that everystatement has been ‘exercised’.Then we could design tests that would specifically target statements not normally executed.Estimates of the percentage of actual ‘bugs’ detectable by testing varies between 50% and 70%.-------------------------------------------------------- Integration and System TestingTested modules are added to the system one at a time - if necessary ‘stubs’ or dummy modules areused to simulate modules not yet added.Eventually the completed system emerges and can be subjected to testing to ensure that it meetsspecification and (easily forgotten) user requirements.-------------------------------------------------------Black-box testing in the context of the assignment is making sure that the pages and any cgi/phpscripts work when accessed through the browser -obviously this is vital as it is what will be seen bythe user.-------------------------------------------------------- CGIInternet "conversations" between two computers take place between a server and a client.Using the http protocol web pages are displayed on the client.CGI (Common Gateway Interface) programs run on the server (server side).1. Form displayed on client2. User enters data and ‘submits’ form to server. Data from form transmitted from client to server3. Specified CGI program starts executing and collects transmitted data4. Data processed and output page generated by CGI program. CGI program then terminates5. Output page transmitted from server to client and displayed
  6. 6. Note that there are two components to the interaction • An original (usually blank) form (loaded as a normal webpage or generated by a program) • A CGI program (called from the form)Creates a web page ‘on-the-fly’ for return to the client browser by writing appropriate HTML code tothe program output.What happens when we start a browser (eg. IE) and request an off-site link? • The name of the remote server is resolved to an IP address using one or more DNS(Domain Name Server); • The remote server is contacted on a special port (default 80) using the http protocol; • The server verifies the client has legitimate access to the data and then accesses and transmits it; • The client browser decides how to treat the document (html, audio, video etc) – often with the help of plug-in softwareHow is the Client/Server operation modified for CGI Programming?• The server provides the end user (client) with a blank HTML FORM• Via a browser (usually) the user enters text or makes preferences/selections• The user defined data (and other "hidden" information) is sent back to a CGI program on the web server• The program processes the data and writes HTML (with a MIME header) back to the server - extraheader information is added if required - and the whole is sent to the clientValues passed from forms back to CGI programs are URL Encoded------------------------------------Two methods, GET and POST exist to communicate between the client and server.GET is used to retrieve data from the server – the form data sent to the server is encoded asname=value pairs in the URL e.g.POST method is used to send information to the server – the form data is encoded within the bodyof the message passed back to the server – the CGI can receive this via the standard input ‘file’STDIN.