Free Essay

Unix Input and Output

In:

Submitted By paradox30
Words 614
Pages 3
Jason Martin
CS126-1501A-02 Unix Fundamentals
01/12/2015

UNIX Commands – Input and Output
1.) The cd or “change directory” command will show you where you are currently at within the directory structure. The command is intended to allow a user to move throughout the shell’s directory structure to add, delete, or to make any necessary changes to a file system. In this example, since the cd command was only used without any path, then it will keep a user in the current directory.
2.)
The mkdir or “make directory” command allows the user to create a directory within the directory structure or file system. In the above command the intention was to create a directory named apache in the file system. As you can see with the ls command, apache is now a directory within the home or root directory.
3.)
The cd APACHE command is intended for the user to access or choose the APACHE directory. However, UNIX is case sensitive and sense the directory is lowercase (apache), you receive a no such file or directory.
4.)
The cd apache command is similar to the previous command, however, when this specific command is entered in the shell, it moves the user into the apache directory within the file system. You can determine which directory you are in by seeing ~/apache#. This shows that you are in the apache directory within the root or home directory.
5.)
The pwd command shows the user the path to the current directory that they are working in. In the screenshot above, you can see that I’m in the apache directory and by using the pwd command I can see the specific path to the apache directory. The path is /root/apache. So I’m in the apache directory within the root or home directory. 6.)
The command cd ../../../../../../../etc sends the user to the /etc directory as this can be verified with the ls command which shows all the files such as configuration files in the etc file. The ../ signifies going back a directory in the file system, so in this particular case we are going back in the structure numerous times. No matter how many times you use the command to go back a directory, when the etc command is added it will direct you to the /etc directory.
7.)
The cd /etc command’s output is identical to the previous command cd ../../../../../../../etc. Both commands will send you to the etc file directory which can be confirmed by the files in the etc directory. You can refer back to question 5 and notice the same files to ensure that it is the same etc file within the directory structure.
8.)
The cat passwd command in this instance will display the contents of the etc password file within the file system. You can see the etc password file in the above screenshot. The cat command is a display command so we want to display or show the password file and since we are in the /etc directory it will show the /etc password list.
9.
The more passwd command is a convenient way to see more of a specific file which is too large to view in the shell. In the above example with the password file of etc. If you want to see if there is more to a file such as a text file you can use this command. As you can see at the bottom there is more highlighted in white and the percentage of what you have seen of the file so far. By pressing enter, this will increase, allowing the user to view more of the file line by line.

Similar Documents

Premium Essay

Casestudy

...UNIX for DBA`s Author: Sandeep Akkasani 1. INTODUCTION TO UNIX 1.1 Single-User Systems The personal computer (PC) is a small General-purpose system that can execute programs to perform a wide variety of tasks. The PC, however, was designed for use by one person at a time, that is, it is Single-User oriented with MS-DOS as the de facto standard operating system for this range of machines. Single user systems became very popular due to the low cost hardware and wide range of software available for these machines. 1.2 Multi-User Systems As opposed to single-user systems there are also larger systems, which more than one person can use at any time. Such systems are referred to as multi-user systems. Multi-user systems would be required when a number of applications have to be run simultaneously, or common resources, like printers and disks, are to be shared by a number of users. 1.3 Hardware – Multi-User Systems While the hardware components of a multi-user system are similar to that of a singleuser system, the following differences should be noted. The CPU of a multi-user system is more powerful and has capabilities to support multi-programming and multi-tasking, two features essential for multi-user systems. The Hard disk of a multi-user system is bigger in capacity. Most multi-user systems use magnetic tape as external storage for backup of software. Single-user systems use floppies as the backup device. This is because multi-user ...

Words: 8312 - Pages: 34

Free Essay

Simulation of Grep in Linux

...Expected outcome of the study Conclusion Bibliography INTRODUCTION Grep is a powerful tool to search files for some phrase or any expression. Grep searches an input file for lines containing a match to a given pattern list. When it finds a match in a line, it copies the line to standard output (by default). We can redirect the screen output into another file and then manipulate it. Though grep expects to do the matching on text, it has no limits on input line length other than available memory, and it can match arbitrary characters within a line. If the final byte of an input file is not a newline, grep silently supplies one. Since newline is also a separator for the list of patterns, there is no way to match newline characters in a text. The syntax of the Grep command is grep [options] expression [file ( s ) ] which means “global regular expression print” This program deals with searching various patterns from a file without using grep or any other inbuilt command. It also includes searching with the help of regular expression. Besides, some of the options of grep command have also been included. REVIEW OF LITERATURE Grep is a command-line utility for searching plain-text data sets for lines matching a regular expression. Grep was originally developed for the UNIX operating system, but is available today for all Unix-like systems. Grep was created, in an evening, by Ken Thompson as a standalone application adapted from the regular expression parser he had written for ed (which...

Words: 849 - Pages: 4

Free Essay

Week Five

...While contrasting UNIX systems to Windows a few of the features discovered in UNIX incorporate: the usage of simple text for saving data; a ordered file system; UNIX manages tools for example printing equipments, mouse and keyboard and also other tools like files. The UNIX system also manages directories and procedures like files. There's only one root directory inside the UNIX operating system hierarchical tree. UNIX utilizes devices and applications via the command line in contrast to utilizing a single monolithic application which includes all the same functionality. The kernel offers services to begin and stop applications, deals with the file system that saves and arranges the computer system files and data. The kernel usually shifts data into as databases for storage and use. Both UNIX and Windows file systems are ordered and both support lengthy names as much as 255 characters. File Processing Evaluation UNIX programs that are based upon simple text files for setup use a lot of powerful devices that are utilized to process text files. Piping is widely utilized to reroute the result of one command to the input of the subsequent command. UNIX deals with most command in a consecutive order (first in first out) but the procedure may be overridden by making use of variables and alternatives (ADD). This lets commands to be installed collectively and implemented without storing all the results to an output file. UNIX utilizes commands that include: Echo - shows text...

Words: 2702 - Pages: 11

Free Essay

Sociology

...http://jozefg.ecs.fullerton.edu/public/CS906/Assignment/ |Ass # |Text Chapter |ASSIGNMENT CPSC 906 FALL 2004 |Due |Max Points | | | |Section 1 | | | | | |Note: Please provide the program assignment documentation according to | | | | | |SyllabusCS901.doc and Project Submittals.doc. | | | |1 |Ch1 |Problems: 26 p.69. Unit conversion. |09-09 |2 | | |Ch2 |Problems: 4 p.153. Stacks separated | | | |2 |Ch2 - 3 |See the exercise assignment description below |09-21 |3 | | | | |Tue | | |3 |Ch2 |Problem: 39 p.156 - provide a Gantt chart for each case and calculate AWT,| 09-30 |3 | | | |ATT and ART. Problems 44. |Thu | | | | |Provide the solution in the PowerPoint slides...

Words: 5471 - Pages: 22

Free Essay

Unix

...00.72314819 FM 10/24/00 9:55 AM Page i Sriranga Veeraraghavan Teach Yourself Shell Programming in 24 Hours A Division of Macmillan Computer Publishing 201 West 103rd St., Indianapolis, Indiana, 46290 USA 00.72314819 FM 10/24/00 9:55 AM Page ii Copyright  1999 by Sams Publishing All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. International Standard Book Number: 0-672-31481-9 Library of Congress Catalog Card Number: 98-89272 Printed in the United States of America First Printing: March 1999 01 00 99 4 3 2 1 EXECUTIVE EDITOR Jeff Koch ACQUISITIONS EDITOR Gretchen Ganser DEVELOPMENT EDITOR Hugh Vandivier TECHNICAL EDITOR Aron Hsiao MANAGING EDITOR Brice Gosnell PROJECT EDITOR Gretchen Uphoff COPY EDITORS Michael Dietsch Kelly Talbot Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams cannot attest to the accuracy...

Words: 112126 - Pages: 449

Free Essay

C Language

...UNIT 1 NOTES Digital Computer A digital computer is an electronic computing machine that uses the binary digits (bits) 0 and 1 to represent all forms of information internally in digital form. Every computer has a set of instructions that define the basic functions it can perform. Sequences of these instructions. Component of Digital Computer: (1)CPU: The Central Processing Unit (CPU) or the processor is the portion of a computer system that carries out the instructions of a Computer, and is the primary element carrying out the computer's functions. This term has been in use in the computer industry at least since the early 1960s . The form, design and implementation of CPUs have changed dramatically since the earliest examples, but their fundamental operation remains much the same. (2)ALU: an arithmetic logic unit (ALU) is a Digital computer that performs arthimatic and logical operations. The ALU is a fundamental building block of the central processing unit(CPU) of a computer, and even the simplest microprocessor contain one for purposes such as maintaining timers. The processors found inside modern CPUs and graphics processing units(CPU) accommodate very powerful and very complex ALUs; a single component may contain a number of ALUs. Mathematician proposed the ALU concept in 1945, when he wrote a report on the foundations for a new computer called the EDVAC. (3)Memory: memory is an organism's ability to store, retain, and recall information. Traditional studies of memory...

Words: 2515 - Pages: 11

Free Essay

Linux Awk

...interpreted programming language designed for text processing and typically used as a data extraction and reporting tool. It is a standard feature of most Unix-like operating systems. Awk is a utility/language designed for data extraction. If the word "extraction" rings a bell, it should because awk was one of Larry Wall's inspirations when he created Perl. Awk is often used with sed to perform useful and practical text manipulation chores, and it depends on the task if you should use awk or Perl. Awk's funny name comes from the names of its original authors, Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger. Most of you probably recognize the Kernighan name; he is one of the fathers of the C programming language and a major force in the UNIX world. One of the most simple and popular uses of awk is selecting a column from a text file or other command's output. There are many different concepts.one basic concept is $ dpkg -l | awk ' /'vim'/ {print $2} ' This command would print all packages installed that have "vim" in their names. Awk uses some internal variables to assign certain pieces of information as it processes a file. The internal variables that awk uses are: FILENAME: References the current input file. FNR: References the number of the current record relative to the current input file. For instance, if you have two input files, this would tell you the record number of each file instead of as a total. FS: The current field separator used to denote each field in a...

Words: 439 - Pages: 2

Free Essay

Os-Dos

...of the system and present the user with an interface. This layer or set of programs is the OS.” Functions of Operating System: 1. Command Interpretation 2. Peripheral Management 3. Run Time Memory Management 4. Disk Management 5. Process Management 6. Supervise the Computer System 7. Controlling input and output peripherals 8. Directing the flow of data 9. Maximize the use of hardware resources 10. To assure that number of programs can be run without human intervention 11. Scheduling and loading of programs 12. Provide appropriate response to the events 13. Handling errors and using corrective routines 14. Protecting hardware, software and data from improper use 15. Furnishing the complete records of all events and activities Types of Operating System Single-user OS: • • It is used for stand alone Computer (PC) It is further classified into two types: (1) Single-user Single-tasking (MS DOS) (2) Single-user Multi-tasking (MS Windows) Multi-user OS / Network Operation System: • • • It handles multiple users as well as multiple peripheral devices simultaneously. It also handles multiple tasks at the same time and therefore known as multi-user multi-tasking OS. Examples: UNIX, Linux, Windows (NT or Network Edition) Functions of Network Operating System: NOS do everything a stand alone OS does and more in much more complex environment. It is the heart and soul of the computer network. Apart from functions of...

Words: 2029 - Pages: 9

Free Essay

Linux

...LINUX PROGRAMMING FINAL NOTES UNIT 1ST THESE NOTES ARE AS PER SYLLABUS & WILL HELP YOU TO ACHIEVE SUCCESS IN FINAL EXAM OF MCA 5TH SEMESTER. LETS START: UNIT 1ST Linux – The Operating System: Linux is one of popular version of UNIX operating System. It is open source as its source code is freely available. It is free to use. Linux was designed considering UNIX compatibility. It's functionality list is quite similar to that of UNIX. Linux is a free distributed implementation of a Unix-like Kernel Developed by Linus Torvalds at the University of Helsinki with the help of programmers across the Internet. Linux history: * Linux features: Following are some of the important features of Linux Operating System. * Portable - Portability means softwares can works on different types of hardwares in same way.Linux kernel and application programs supports their installation on any kind of hardware platform. * Open Source - Linux source code is freely available and it is community based development project. Multiple teams works in collaboration to enhance the capability of Linux operating system and it is continuously evolving. * Multi-User - Linux is a multiuser system means multiple users can access system resources like memory/ ram/ application programs at same time. * Multiprogramming - Linux is a multiprogramming system means multiple applications can run...

Words: 6867 - Pages: 28

Premium Essay

Operating Systems

...When a computer is first built it is effectively cut-off from the world as it cannot receive input or provide output. Without an operating system a computer cannot work efficiently. The operating system has three main tasks to do:  Manage the computer resources: Input and output functions of the computer are controlled by the operating system. The operating system has to manage the CPU, how memory is allocation , access to disk drives, and many other tasks.  Interact with the user: All computers need someone to interact with it, to control it . It is the operating system's task to provide a means of doing this which is easy, consistent, flexible and structured. An operating system also allows the user of the computer to make changes as well.  Run applications: Application packages, such as word processors or spreadsheets, are what most users use on their computers, for most it is essential for their daily use of computers . The operating system provides a means of executing them, and provides the programs with tools and services. These include commands from retrieving data from a hard disk, or even to send data to a printer. LINUX The history of Linux began in 1991 with the commencement of a personal project by a student who was called Linus Torvalds. He studied at the University or Helsinki and this is where he created the new operating system. Linux is based on Unix, Unix was first released in 1971, it was entirely written in assembly language (which is a low...

Words: 293 - Pages: 2

Free Essay

Linux Cli Paper

...1) bash- is a Unix shell written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. Released in 1989, it has been distributed widely as the shell for the GNU operating system and as the default shell on Linux, Mac OS X and Darwin. 2) bsh- (Bourne shell) was the default Unix shell of Unix Version 7. Developed by Stephen Bourne at AT&T Bell Laboratories, it was a replacement for the Thompson shell. It was released in 1977 in the Version 7 Unix release distributed to colleges and universities. 3) tcsh- is a Unix shell based on and compatible with the C shell (csh). It is essentially the C shell with programmable command line completion, command-line editing, and a few other features. 4) csh- is a Unix shell that was created by Bill Joy while a graduate student at University of California, Berkeley in the 1970s. Other early contributors to the ideas or the code were Michael Ubell, Eric Allman, Mike O'Brien and Jim Kulp. The C shell is a command processor typically run in a text window, allowing the user to type commands. The C shell can also read commands from a file, called a script. 5) ksh- is a Unix shell which was developed by David Korn at Bell Labs in the early. Other early contributors were Bell Labs developers Mike Veach and Pat Sullivan, who wrote the Emacs- and vi-style line editing modes′ code, respectively. KornShell is backward-compatible with the Bourne shell and includes many features of the C shell, inspired...

Words: 1015 - Pages: 5

Free Essay

C Shell

...ROEL A. GUTAY BSIT 4-3 201010981 PROJECT IN PROGRAMMING LANGUAGES C SHELL HISTORY : The C shell (csh or the improved version, tcsh, on most machines) is aUnix shell that was created by Bill Joy while a graduate student atUniversity of California, Berkeley in the late 1970s. It has been distributed widely, beginning with the 2BSD release of the BSD Unix system that Joy began distributing in 1978. Other early contributors to the ideas or the code were Michael Ubell, Eric Allman, Mike O'Brien and Jim Kulp. The C shell is a command processor typically run in a text window, allowing the user to type commands. The C shell can also read commands from a file, called a script. Like all Unix shells, it supports filename wildcarding, piping, here documents, command substitution,variables and control structures for condition-testing and iteration. What differentiated the C shell from others, especially in the 1980s, were its interactive features and overall style. Its new features made it easier and faster to use. The overall style of the language looked more like C and was seen as more readable. On many systems, such as Mac OS X and Red Hat Linux, csh is actually tcsh, an improved version of csh. One file containing the tcsh executable has links to it as both "csh" and "tcsh" so that either name refers to the same improved version of the C shell. On Debian, Ubuntu, and their derivatives, there are two different packages: csh and tcsh. The former is...

Words: 2049 - Pages: 9

Premium Essay

C Program

...event  Computer Programming: process of planning a sequence of steps for a computer to follow  Computer Program/Program: list of instructions to be performed by a computer or understood by the computer  Steps in Program Planning & Development 1. 2. 3. 4. 5. Identification of the problem Problem Analysis Setting up an Algorithm Coding Running, Testing & Debugging Steps in Program Planning & Development 1. Identification of the problem knowing what the problem is Steps in Program Planning & Development 2.Problem Analysis     Review the problem & understand carefully what you are asked to do Determine what is given(input) and what result/information must be produced(output) Assign names to each input and output Determine the manner of processing that must be done on the input data to come up with desired output Steps in Program Planning & Development 3. Setting up an Algorithm Algorithm: a step-by-step process that if followed performs a specific task. This can be described in 2 ways: 1. natural language 2. graphical forms/notations What Is an Algorithm?  An algorithm is nothing more than a finite list of instructions on how to perform a task. It is analogous to a cooking recipe a chef might use for preparing a food. Specifically, an algorithm has the following properties. It must result in a finite series of actions.  The sequence of actions has a unique initial action.  Each action in the sequence has a unique successor.  The...

Words: 653 - Pages: 3

Premium Essay

Ch 4 Test Linux/Unix

...1. UNIX/Linux store data, such as letters, product records, or vendor reports, in flat ASCII files. _F___ 2. The command rmdir can be used to delete a directory that is not empty. _T___ 3. Moving and renaming a file are essentially the same operation. _F___ 4. When you are moving files, using the -o option with the mv command can be a good idea so that you don’t unexpectedly overwrite a destination file with the same name. _F___ 5. When you use cat to combine two files into a third file, the first line of the output contains the first line of the first file followed by the first line of the second file. __F__ 6. When you use the paste command, by default, the pasted results appear in columns separated by commas. __T__ 7. You can complete a project using awk that you cannot complete using a combination of paste, cut, sort, and join. Multiple Choice Identify the choice that best completes the statement or answers the question. __C__ 8. In UNIX/Linux, text files and binary files are considered to be ____ files. a.|executable|c.|regular| b.|document|d.|dynamic| __A__ 9. Character special files are used by input/output devices for communicating one character at a time, providing what is called ____ data. a.|raw|c.|ASCII|| b.|binary|d.|block| __C__ 10. System administrators and programmers refer to standard input as ____. a.|sin|c.|stdin|| b.|stin|d.|standardin| __C__ 11. System administrators and programmers refer to standard output as...

Words: 1554 - Pages: 7

Free Essay

Employee Welfare

...C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard. The UNIX operating system, the C compiler, and essentially all UNIX applications programs have been written in C. The C has now become a widely used professional language for various reasons. · Easy to learn · Structured language · It produces efficient programs. · It can handle low-level activities. · It can be compiled on a variety of computer platforms. Facts about C · C was invented to write an operating system called UNIX. · C is a successor of B language which was introduced around 1970 · The language was formalized in 1988 by the American National Standard Institute (ANSI). · The UNIX OS was totally written in C by 1973. · Today C is the most widely used and popular System Programming Language. · Most of the state-of-the-art softwares have been implemented using C. · Today's most popular Linux OS and RBDMS MySQL have been written in C. Why to use C? C was initially used for system development work, in particular the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as code written in assembly language. Some examples of the...

Words: 770 - Pages: 4