New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Electrical Circuits I

by: Bella Pollich

Electrical Circuits I ELET 1300

Bella Pollich
GPA 3.76


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in Electrical Engineering

This 13 page Class Notes was uploaded by Bella Pollich on Saturday September 19, 2015. The Class Notes belongs to ELET 1300 at University of Houston taught by Staff in Fall. Since its upload, it has received 50 views. For similar materials see /class/208319/elet-1300-university-of-houston in Electrical Engineering at University of Houston.

Similar to ELET 1300 at UH

Popular in Electrical Engineering


Reviews for Electrical Circuits I


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/19/15
An Introduction to the Linux Command Shell For Beginners Presented by Victor Gedris In CoOperation With The Ottawa Canada Linux Users Group and ExitCerti ed Copyright and Redistribution This manual was written with the intention of being a helpful guide to Linux users who are trying to become familiar with the Bash shell and basic Linux commands To make this manual useful to the widest range of people I decided to release it under a free documentation license with the hopes that people benefit from it by updating it and redistributing modi ed copies You have permission to modify and distribute this document as speci ed under the terms of the GNU Free Documentation License Comments and suggestions for improvement may be directed to Vic gedris org This document was created using an Open Source office application called Open Of ce The le format is nonproprietary and the document is also published in various other formats online Updated copies will be available on Vic Gedris39 web site http Vic dyndns org1 For more information on Open Office please visit http www openoffice org Copyright 2003 Victor Gedris Permission is granted to copy distribute andor modify this document under the terms of the GNU Free Documentation License Version 11 or any later version published by the Free Software Foundation with no Invariant Sections with no FrontCover Texts and with no BackCover Texts A copy of the license is available from the Free Software Foundation39s website httpwwwfsforqcopvleftfdlhtml Document Version 12 20030625 10 Introduction The purpose of this document is to provide the reader with a fast and simple introduction to using the Linux command shell and some of its basic utilities It is assumed that the reader has zero or very limited exposure to the Linux command prompt This document is designed to accompany an instructorled tutorial on this subject and therefore some details have been left out Explanations practical examples and references to DOS commands are made where appropriate 11 What is a command shell A program that interprets commands Allows a user to execute commands by typing them manually at a terminal or automatically in programs called shell scripts A shell is not an operating system It is a way to interface with the operating system and run commands 12 What is BASH BASH Boume Again SHell Bash is a shell written as a free replacement to the standard Boume Shell binsh originally written by Steve Boume for UNIX systems It has all of the features of the original Boume Shell plus additions that make it easier to program with and use from the command line Since it is Free Software it has been adopted as the default shell on most Linux systems 13 How is BASH different from the DOS command prompt Case Sensitivity In LinuxUNIX commands and filenames are case sensitive meaning that typing EX IT instead ofthe proper exit is a mistake vs In DOS the forwardslash is the command argument delimiter while the backslash is a directory separator In LinuxUNIX the is the directory separator and the is an escape character More about these special characters in a minute Filenames The DOS world uses the eight dot three filename convention meaning that all files followed a format that allowed up to 8 characters in the filename followed by a period dot followed by an option extension up to 3 characters long e g FILENAME TXT In UNIX Linux there is no such thing as a file extension Periods can be placed at any part of the filename and extensions may be interpreted differently by all programs or not at all 14 Special Characters Before we continue to learn about Linux shell commands it is important to know that there are many symbols and characters that the shell interprets in special ways This means that certain typed characters a cannot be used in certain situations b may be used to perform special operations or c must be escaped if you want to use them in a normal way Character Description Escape character If you want to reference a special character you must escape it with a backslash first Example touch tmp f ilename Directory separator used to separate a string of directory names Example usrsrclinux Current directory Can also hide files when it is the rst character in a lename Parent directory User s home directory Represents 0 or more characters in a filename or by itself all files in a directory Example pic 2 0 0 2 can represent the files pic 2 0 0 2 picJanuaryZ 0 0 2 picFebZ 92002 etc Represents a single character in a filename Example hello txt can represent hellol txt helloz txt but not hello22txt Can be used to represent a range of values eg 0 9 A Z etc Example hello 0 2 txt represents the names helloO txt hellol txt and hello2 txt I Pipe Redirect the output of one command into another command Example ls l more gt Redirect output of a command into a new file If the file already exists overwrite it Example ls gt myfilestxt gtgt Redirect the output of a command onto the end of an existing file Example echo quotMary 555 l 2 3 4 gtgt phonenumbers txt lt Redirect a file as input to a program Example more lt phonenumbers txt Command separator Allows you to execute multiple commands on a single line Example cd var log less messages ampamp Command separator as above but only runs the second command if the first one finished without errors Example cd var logs ampamp less messages amp Execute a command in the background and immediately get your shell back Example find name core gt tmpcorefilestxt amp 15 Executing Commands The Command PATH Most common commands are located in your shell s PATH meaning that you can just type the name of the program to execute it Example Typing ls will execute the ls command Your shell39s PATH variable includes the most common program locations such as bin usrbin usrXl 1R6 bin and others To execute commands that are not in your current PATH you have to give the complete location of the command Examples homebob myprogram program Execute a program in the current directory bin program Execute program from a personal bin directory Command Syntax Commands can be run by themselves or you can pass in additional arguments to make them do different things Typical command syntax can look something like this command argument argument argument file Examples ls List les in current directory ls l Lists les in long format ls l color As above with colourized output cat filename Show contents ofa le cat n filename Show contents ofa le with line numbers 20 Getting Help When you re stuck and need help with a Linux command help is usually only a few keystrokes away Help on most Linux commands is typically built right into the commands themselves available through online help programs man pages and info pages and of course online 21 Using a Command39s BuiltIn Help Many commands have simple help screens that can be invoked with special command ags These ags usually look like h or help Example grep help 22 Online Manuals Man Pages The best source of information for most commands can be found in the online manual pages known as man pages for short To read a command s man page type man command Examples man ls Get help on the ls command man man A manual about how to use the manual To search for a particular word within a man page type word To quit from a man page just type the Q key Sometimes you might not remember the name of Linux command and you need to search for it For example if you want to know how to change a file39s permissions you can search the man page descriptions for the word permission like this man k permission If you look at the output of this command you will find a line that looks something like chmod l change file access permissions Now you know that chmod is the command you were looking for Typing man chmod will show you the chmod command39s manual page 23 Info Pages Some programs particularly those released by the Free Software Foundation use info pages as their main source of online documentation Info pages are similar to man page but instead of being displayed on one long scrolling screen they are presented in shorter segments with links to other pieces of information Info pages are accessed with the info command or on some Linux distributions pinf o a nicer info browser For example info df Loads the df info page 30 Navigating the Linux Filesystem The Linux lesystem is atreelike hierarchy hierarchy of directories and les At the base of the lesystem is the directory otherwise known as the root not to be confused with the root user Unlike DOS or Windows lesystems that have multiple roots one for each disk drive the Linux lesystem mounts all disks somewhere underneath the filesystem The following table describes many of the most common Linux directories 31 The Linux Directory Layout Directory Description The nameless base of the lesystem All other directories les drives and devices are attached to this root Commonly but incorrectly referred to as the slash or directory The is just a directory separator not a directory itself bin Essential command binaries programs are stored here bash ls mount tar etc boot Static les of the boot loader dev Device les In Linux hardware devices are acceessd just like other les and they are kept under this directory etc Hostspeci c system con guration les home Location of users personal home directories e g home susan lib Essential shared libraries and kernel modules proc Process information pseudo lesystem An interface to kernel data structures root The root superuser home directory sbin Essential system binaries fdisk fsck init etc tmp Temporary les All users have permission to place temporary les here usr The base directory for most shareable readonly data programs libraries documentation and much more usrbin Most user programs are kept here cc find du etc usr include Header les for compiling C programs usr lib Libraries for most binary programs usr local Locally installed les This directory only really matters in environments where les are stored on the network Locallyinstalled les go in usrlocalbin usrlocallib etc Also often used for software packages installed from source or software not of cially shipped with the distribution usrsbin Nonvital system binaries lpd useradd etc usr share Architectureindependent data icons backgrounds documentation terminfo man pages etc usrsrc Program source code Eg The Linux Kernel source RPMs etc usrX11R6 The X Window System var Variable data mail and printer spools log les lock les etc 32 Commands for Navigating the Linux Filesystems The rst thing you usually want to do when learning about the Linux lesystem is take some time to look around and see what39s there These next few commands will a Tell you where you are b take you somewhere else and c show you what39s there The following table describes the basic operation of the pwd cd and ls commands and compares them to certain DOS commands that you might already be familiar with Linux Command DOS Command Description pwd Cd Print Working Directory Shows the current location in the directory tree cd Cd chdir Change Directory When typed all by itself it returns you to your home directory cd directory cd directory Change into the speci ed directory name Example cd usrsrclinux cd N is an alias for your home directory It can be used as a shortcut to your home or other directories relative to your home cd cd Move up one directory For example if you are in homevic and you type cd you will end up in home cd Return to previous directory An easy way to get back to your previous location 15 dir w List all les in the current directory in column format 15 directory dir directory List the les in the speci ed directory Example ls varlog 15 1 dir List les in long format one file per line This also shows you additional info about the le such as ownership permissions date and size 15 a dir a List all les including hidden les Hidden les are those les that begin with a eg The bashhistory le in your home directory 15 1d A long list of directory but instead of showing directory the directory contents show the directory s detailed information For example compare the output of the following two commands ls l usrbin ls ld usrbin ls usrbind dir d List all les whose names begin with the letter d in the usrbin directory 40 Piping and ReDirection Before we move on to learning even more commands let39s sidetrack to the topics of piping and redirection The basic UNIX philosophy therefore by extension the Linux philosophy is to have many small programs and utilities that do a particular job very well It is the responsibility of the programmer or user to combine these utilities to make more useful command sequences 41 Piping Commands Together The pipe character is used to chain two or more commands together The output of the first command is piped into the next program and if there is a second pipe the output is sent to the third program etc For example ls la usrbin less In this example we run the command ls la usrbin which gives us a long listing of all of the files in usr bin Because the output of this command is typically very long we pipe the output to a program called less which displays the output for us one screen at atime 42 Redirecting Program Output to Files There are times when it is useful to save the output of a command to a file instead of displaying it to the screen For example if we want to create a file that lists all of the MP3 files in a directory we can do something like this using the gt redirection character ls l homevicMP3 mp3 gt mp3 files txt A similar command can be written so that instead of creating a new file called mp3files txt we can append to the end of the original file ls l homevicextraMP3smp3 gtgt mp3filestxt 50 Other Linux Commands The following sections describe many other commands that you will nd on most Linux systems I can t possibly cover the details of all of these commands in this document so don t forget that you can check the man pages for additional information Not all of the listed commands will be available on all Linux or UNIX distributions 51 Working VWth Files and Directories These commands can be used to find out information about les display les and manipulate them in other ways copy move delete Linux Command DOS Command Description file Find out what kind of le it is For example file binls tells us that it is a Linux executable le type Display the contents of a text le on the screen For example cat mp3files txt would display the le we created in the previous section head Display the rst few lines of atext le Example head etcservices tail Display the last few lines of a text le Example tail etcservices tail f Display the last few lines of a text le and then output appended data as the le grows very useful for following log les Example tail f varlogmessages lt3P copy Copies a le from one location to another Example cp mp3files txt tmp copies the mp3 lestxt le to the tmp directory mv rename ren move Moves a le to a new location or renames it For example mv mp3 files txt tmp copy the le to tmp and delete it from the original location rm del Delete a le Example rm tmp mp3 files txt mkdir md Make Directory Example mkdir tmp myf iles rmd ir rd rmdir Remove Directory Example rmdir tmp myf i les 52 Finding Things The following commands are used to nd les ls is good for nding les if you already know approximately where they are but sometimes you need more powerful tools such as these Linux Description Command which Shows the full path of shell commands found in your path For example if you want to know exactly where the grep command is located on the lesystem you can type which grep The output should be something like bingrep whereis Locates the program source code and manual page for a command if all information is available For example to find out where ls and its man page are type whereis ls The output will look something like ls binls usrsharemanmanllslgz locate A quick way to search for les anywhere on the filesystem For example you can nd all les and directories that contain the name mozilla by typing locate mozilla find A very powerful command but sometimes tricky to use It can be used to search for les matching certain patterns as well as many other types of searches A simple example is find name mp3 This example starts searching in the current directory and all sub directories looking for les with mp3 at the end of their names 53 Informational Commands The following commands are used to nd out some information about the user or the system Linux Command Explanation ps Lists currently running process programs w Show who is logged on and what they are doing id Print your userid and group id s df Report lesystem disk space usage Disk Free is how I remember it du Disk Usage in a particular directory du s provides a summary for the current directory top Displays CPU processes in a fullscreen GUI A great way to see the activity on your computer in realtime Type Q to quit free Displays amount of free and used memory in the system cat proccpuinfo Displays information about your CPU cat procmeminfo Display lots of information about current memory usage uname a Prints system information to the screen kernel version machine type etc 54 Other Utilities Here are some other commands that are useful to know Linux Command Description clear Clear the screen echo Display text on the screen Mostly useful when writing shell scripts For example echo Hello World more Display a file or program output one page at a time Examples more mp3filestxt ls la more less An improved replacement for the more command Allows you to scroll backwards as well as forwards grep Search for a pattern in a file or program output For example to nd out which TCP network port is used by the nfs service you can do this grep quotnfsquot etcservices This looks for any line that contains the string nfs in the file etc services and displays only those lines lpr Print a file or program output Examples lpr mp3 files txt Print the mp3f11estxt file ls la lpr Print the output ofthe ls la command sort Sort a file or program output Example sort mp3 files txt su Switch User Allows you to switch to another user s account temporarily The default account to switch to is the rootsuperuser account Examples su Switch the root account su Switch to root and log in with root39s environment su larry Switch to Larry s account 55 Shortcuts to Make it all Easier When you start using the Bash shell more often you will appreciate these shortcuts that can save you very much typing time Sh ortcnt Description UpDown Arrow Keys Scroll through your most recent commands You can scroll back to an old command hit ENTER and execute the command without having to retype it history command Show your complete command history TAB Completion If you type a partial command or filename that the shell recognizes you can have it automatically completed for you if you press the TAB key Try typing the first few characters of your favourite Linux command then hit TAB a couple of times to see what happens 4439 Complete recent commands with Try this Type followed by the first couple of letters ofa recent command and press ENTER For example type find usrbin type f name m and now type lfi Search your command history with C TRL R Press CTRL R and then type any portion of a recent command It will search the commands for you and once you find the command you want just press ENTER Scrolling the screen with Shift PageUp and Page Down Scroll back and forward through your terminal 60 Further Reading Link Address Description httgwwwoclugonca Ottawa Canada Linux Users Group A group with an active mailing list monthly meetings and much more httgwwwexitcertifiedcom Ottawa39s source for Sun training and the host of OCLUG s technology seminars httgwwwfsforg The Free Software Foundation Documentation source code and much more for many programs commonly found on Linux systems httElinuxorgmtarticleterminal A Beginner39s Bash Another very good introduction to Bash httEwwworeillycomcatalogbashZ An excellent book if you want to learn how to customize Bash and use it for shell script programming


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Jennifer McGill UCSF Med School

"Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.