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

Lesson 3

by: Eko Yang

Lesson 3 MTH224

Eko Yang
GPA 3.63
Probability and Statistics
Dr. Ilie Grigorescu

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

Probability and Statistics
Dr. Ilie Grigorescu
Class Notes
25 ?




Popular in Probability and Statistics

Popular in Mathematics (M)

This 31 page Class Notes was uploaded by Eko Yang on Sunday February 8, 2015. The Class Notes belongs to MTH224 at University of Miami taught by Dr. Ilie Grigorescu in Fall. Since its upload, it has received 12 views. For similar materials see Probability and Statistics in Mathematics (M) at University of Miami.


Reviews for Lesson 3


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: 02/08/15
UNIX SelfStudy 02092015 UNIX Introduction What is UNIX UNIX is an operating system which was rst developed in the 19605 and has been under constant development ever since By operating system we mean the suite of programs which make the computer work It is a stable multiuser multitasking system for servers desktops and laptops UNIX systems also have a graphical user interface GUI similar to Microsoft Windows which provides an easy to use environment However knowledge of UNIX is required for orations which aren t covered by a graphical program or for when there is no windows interface available for example in a telnet session Type s of UNIX There are many different versions of UNIX although they share common similarities The most popular varieties of UNIX are Sun Solaris GNULinux and MacOS x The UNIX operating system The UNIX operating system is made up of three parts the kernel the shell and the programs The kernel The kernel of UNIX is the hub of the operating system it allocates time and memory to programs and handles the lestore and communications in response to system calls As an illustration of the way that the shell and the kernel work together suppose a user types rm my le which has the effect of removing the le my le The shell searches the lestore for the le containing the program rm and then requests the kernel through system calls to execute the program rm on my le When the process rm my le has nished running the shell then returns the UNIX prompt amp to the user indicating that is waiting for further commands M The shell acts as an interface between the user and the kernel When a user logs in the login program checks the username and password and then starts another program called the shell The shell is a command line interpreter CLI It interprets the commands the user types in and arranges for them to be carried out The commands are themselves programs when they terminate the shell gives the user another prompt on our systems The adept user can customize hisher own shell and users can use different shells on the same machine Filename Completion By typing part of the name of a command lename or directory and pressing the Tab key the tcsh shell will complete the rest of the name automatically If the shell nds more than one name beginning with those letters you have typed it will beep prompting you to type a few more letters before pressing the tab key again History The shell keeps a list of the commands you have typed in If you need to repeat a command use the cursor keys to scroll up and down the list or type history for a list of previous commands Files and processes Everything in UNIX is either a le or a process A process is an executing program identi ed by a unique PID process identi er A le is a collection of data They are created by user using text editors running compilers etc Example of les a document report essay etc the text of a program written in some highlevel programming language instructions comprehensible directly to the machine and incomprehensible to a casual user for example a collection of binary digits an executable or binary le a directory containing information about its contents which may be a mixture of other directories subdirectories and ordinary les The Directory Structure All the les are grouped together in the directory structure The le system is arranged in a hierarchical structure like an inverted tree The top of the hierarchy is traditionally called root written as a slash Starting an UNIX terminal To open an UNIX terminal window click on the Terminal icon from Applications menu UNIX Tutorial ONE 11 Listing les and directories li iitl When you rst login your current working directory is your home directory Your home directory has the same name as your username and it is where your personal les and subdirectories are saved The ls command lists the contents of your current working directory There may be no les visible in your home directory in which case the UNIX prompt will be returned Alternatively there may already be some les inserted by the System Administrator when your account was created ls does not in fact cause all the les in your home directory to be listed but only those ones whose name does not begin with a dot are known as hidden les and usually contain important program con guration information They are hidden because you should not change them unless you are very familiar with UNIX Is a lists les that are normally hidden Is is an example of a command which can take options a is an example of an option The options change the behavior of the command 12 Making Directories mkdir make directory 13 Changing to a different directory cd change directory The command cd directory means change the current working directory to directory The current working directory may be though of as the directory you are in 14 The directories and The current directory In UNIX means the current directory so typing cd means stay where you are The parent directory means the parent of the current directory so typing cd will take you one directory up the hierarchy Note typing Cd with no argument always returns you to your home directory 15 Pathnames pwd print working directory Pathnames enable you to work out where you are in relation to the whole lesystem 16 More about home directories and pathnames Understanding pathnames To use a command on a le or directory not in the current working directory you must either cd to the correct directory or specify its full pathname your home directory Home directories can also be referred to by the tide character It can be used to specify paths starting at your home directory Commain Meaning 15 list files and dlirecteries la a list all files and directories zm cdli39r make a directory ad directery change te named directdry ed change te hemed irectery ed change te hemedirectory ed change te parent dlirectdry pee display the path ef the current directory UNIX Tutorial Two 21 Copying Files cplcopy cp le1 le2 is the command which makes a copy of le1 in the current working directory and calls it le2 cp lepathname means copy the le to the current directory keeping the name same 22 Moving les mv move mv le1 le2 moves or renames le1 to le2 To move a le from one place to another use the mv command This has the effect of moving rather than copying the le so you end up with only one le rather than two It can also be used to rename a le by moving the le to the same directory but giving it a different name mv lename directory 23 Removing les and directories rm remove rmdir remove directory To delete remove a le use the rm command You can use the rmdir command to remove a directory make sure it is empty rst UNIX will not let you remove a nonempty directory 24 Displaying the contents of a le on the screen clear clear screen Before you start the next section you may like to clear the terminal window of the previous commands so the output of the following commands can be clearly understood cat concatenate The command cat can be used to display the contents of a le on the screen If the le is longer than the size of the window it will scroll past making it unreadable lei The command less writes the contents of a le onto the screen a page at a time Press the spacebar if you want to see another page and type q if you want to quit reading less is used in preference to cat for long les head The head command writes the rst ten lines of a le to the screen head lename Display the rst lines of a le tail The tail command writes the last ten lines of a le to the screen 25 Searching the contents of a le Simple searching using less Using less you can search through a text le for a keyword pattern less lename keyword n to search for the next occurrence of the word grep grep is one of many standard UNIX utilities lt searches les for speci ed words or patterns grep keyword lename The grep command is case sensitive To ignore upperlower case distinctions use the i option type grep i keyword lename To search for a phrase or pattern you must enclose it in single quotes the apostrophe symbol grep i phrase phrase lename v display those lines that do NOT match n precede each matching lien with the line number c print only the total count of matched lines You can use more than one option at a time Format grep ivc keyword lename wc word count wc w Iename word count wc lename line count UNIX Tutorial Three 31 Redirection Most processes initiated by UNIX commands write to the standard output that is they write to the terminal screen and many take their input from the standard input that is they read it from the keyboard There is also the standard error where processes write their error messages by default to the terminal screen cat If you run the cat command without specifying a le to read it reads the standard input the keyboard and on receiving the end of le AD copies it to the standard output the screen In UNIX we can redirect both the input and the output of commands 32 Redirecting the Output We use the symbol gt to redirect the output of a command For example to create a le called list1 containing a list of fruit type cat gt Iename Then type in the names of some fruit Press Return after each one What happens is the cat command reads the standard input the keyboard and the gt redirects the output which normally goes to the screen w called list1 321 Appending to a le The form gtgt appends standard output to a le So to add more items to the le type cat gtgt lename Use the cat command to join concatenate e1 and le2 into a new le called sum le Type cat le1 le2 gt sum le What this is doing is reading the contents of list1 and list2 intern then outputting the text to the le sum le 33 Redirecting the Input We use the lt symbol to redirect the input of a command The command sort alphabetically or numerically sorts a list Type sort Then type in some words PressReturn after each one The output will be the words sorted Using lt you can redirect the input to come from a le rather than the keyboard sort lt lename sort the contents in this le To output the sorted list to a le type sort lt e1 gt le2 Sort the list in e1 and output it as a le2 34 Pipes To see who is on the system with you type who One method to get a sorted list of names is to type who gt namestxt sort lt namestxt What you really want to do is connect the output of the who command directly to the input of the sort command The symbol for a pipe is the vertical bar who sort To nd out how many users are logged on type who wc A B C Command A s output is Command B s input Command B s output is Command C s input UNIX Tutorial Four 41 Wildcards The wildcard The character is called a wildcard and will match against none or more characters in a le or directory name The wildcard The character will match exactly one character So ouse will match les like house and mouse but not grouse 42 Filename conventions We should note here that a directory is merely a special type of les So the rules and conventions for naming les apply also to directories In naming les characters with special meanings such as amp should be avoided Also avoid using spaces within names The safest way to name a le is to use only alphanumeric characters that is letters and numbers together with underscore and dot dot File names conventionally start with a lowercase letter and may end with a dot followed by a group of letters indicating the contents of the le 43 Getting Help Online Manuals The manual pages tell you which options a particular command can take and how each option modi es the behavior of the command Type man command to read the manual page for a particular command Alternatively whatis gives a oneline description of the command but omits any information about options etc Apropos When you are not sure of the exact name of a command apropos keyword will give you the commands with keyword in their manual page headeh UNIX Tutorial Five 51 File System security access rights ls l l for long listing Each le and directory has associated access rights which may be found by typing ls I Also ls lg gives additional information as to which group owns the le In the lefthand column is a 10 symbol string consisting of symbols d r w x and occasionally 5 or S If d is present it will be at the left hand end of the string and indicates a directory otherwise will be the starting symbol of the string The 9 remaining symbols indicate the permissions or access rights and are taken as three groups of 3 The left group of 3 gives the le permissions for the user that owns the le or directory The middle group gives the permissions for the group of people to whom the le or directory belongs The rightmost group gives the permission for all others The symbols r w etc have slightly different meanings depending on whether they refer to a simple le or to a directory Access rights on les r or indicates read permission or otherwise that is the presence or absence of permission to read and copy the le w or 0 indicates write permission or otherwise that is the permission or otherwise to change a le x or indicates execution permission or otherwise that is the permission to execute a le where appropriate Access rights on directories r allows users to list les in the directories w means that users may delete les from the directory or moves les into it x means the right to access les in the directory This implies that you may read les in the directory provided you have read permission on the individual les So in order to read a le you must have execute permission on the director containing that le and hence on any directory containing that directory as a subdirectory and so on up the tree 52 Changing access rights chmod changing a le mode Only the owner of a le can use chmod to change the permission of a le The options of chmod are as follows to remove read write and execute permissions on the le for the group and others type chmod gorwx lename to give read and write permissions on the le to all chmod arw lename 53 Processes and Jobs A process is an executing program identi ed by a unique PID process identi er To see information about your processes with their associated PID and status type ps A process may be in the foreground in the background or be suspended In general the shell does not return the UNIX prompt until the current process has nished executing Some processes take a long time to run and hold up the terminal Backgrounding a long process has the effect that the UNIX prompt is returned immediately and other tasks can be carried out while the original process continues executing Running background processes To background a process type an amp at the end of the command line For example the command sleep waits a given number of seconds before continuing Type sleep 10 This wait 10 seconds before returning the command prompt Until the command prompt is returned you can do nothing except wait To run sleep in the background type sleep 10 amp 1 6259 The amp runs the job in the background and returns the prompt straight away allowing you do run other programs while waiting for that one to nish The rst line in the above example is typed in by the user the next line indicating job number and PID is returned by the machine The user is be noti ed of a job number numbered from 1 enclosed in square brackets together with a PID and is noti ed when a background process is nished Backgrounding is useful forjobs which will take a long time to complete Background a current foreground process At the prompt type sleep 1000 You can suspend the process running in the foreground by typing quotZ Then to put it in the background type bg Note do not background programs that require user interaction eg vi 54 Listing suspended and background processes When a process is running backgrounded or suspended it will be entered onto a list along with a job number To examine this list type jobs To restart foreground a suspended processes type fg jobnumber Typing fg with no job number foregrounds the last suspended process 55 Killing a process kill terminate or signal a process To kill a job running in the foreground type quotC To kill a suspended or background process type ki jobnumber ps process status Alternatively processes can be killed by nding their process numbers PIDs and using kill PDnumber ki PDnumber If a process refuse to be killed uses the 9 option Note It is not possible to kill off other users processes UNIX Tutorial Six Other useful UNIX commands guota All students are allocated a certain amount of disk space on the le system for their personal les usually about lOOMb If you go over your quota you are given 7 days to remove excess les To check your current quota and how much of it you have used type quota v Q The df command reports on the space left on the le system For example to nd out how much space is left on the leserver type df du The du command outputs the number of kilobytes used by each subdirectory Useful if you have gone over quota and you want to nd out which directory has the most les In your homedirectory type dus The s ag will display only a summary total size and the means all les and directories gzip This reduces the size of a le thus freeing valuable disk space For example type ls l lename To compress le type gzip lename This will compress the le and place it in a le called lenamegz To see the change in size type ls I again To expand the le use the gunzip command gunzip lenamegz Lat zcat will ready gzipped les without needing to uncompress them rst zcat lenamegz If the text scrolls too fast for you pipe the output through less zcat lenamegz less m le classi es the named les according to the type of data they contain To report on all les in your home directory type le M This command compares the content of two les and displays the differences To see the differences type diff le1 le2 ines begging with a lt denotes le1 while lines beginning with a gt denotes le2 m This searches through the directories for les and directories with a given name date size or any other attribute you care to specify It is a simple command but with many options To search for all les with the extension txt starting at the current directory and working through all subdirectories then printing the name of the le to the screen type nd name txt print To nd les over 1Mb in size and display the results as a long listing type nd size 1M s history The C shell keeps an ordered list of al the commands that you have entered Each command is given a number according to the order it was entered If you are using the C shell you can use the exclamation character to recall commands easily recall last command 3 recall third most recent command 5 recall 5th command in list grep recall last command starting with grep You can increase the size of the history buffer by typing set history1OO UNIX Tutorial Seven 71 Compiling UNIX software packages There are a number of steps needed to install the software Locate and download the source code which is usually compressed Unpack the source code Compile the code Install the resulting executable Set paths to the installation directory Compiling Source Code All highlevel language code must be converted into a form the computer understands For example C language source code is converted into a lowerlevel language called assembly language The assembly language code made by the previous stage is then converted into object code which are fragments of code which the computer understands directly The nal stage in compiling a program involves linking the object code libraries which contain certain builtin functions This nal stage produces an executable program make and the Make le The make command allows programmers to manage large programs or groups of programs It aids in developing large programs by keeping track of which portions of the entire program have been changed compiling only those parts of the program which have changed since the last compile The make program gets its set of compile rules from a text le called Make le which resides in the same directory as the source les It contains information on how to compile the software It also contains information on where to install the nished binaries executables manual pages data les dependent library les con guration les etc Some packages require you to edit the Make le by hand to set the nal installation directory and any other parameters However many packages are now being distributed with the GNU con gure utility con gure As the number of UNIX variant increased it became harder to write programs which could run on all variants Developers frequently do not have access to every system and the characteristics of some systems changed from version to version The GNU con gure and build system simpli es the building of programs distributed as source code All programs are built using a simple standardized two step process The program builder need not install any special tools in order to build the program The con gure shell script attempts to guess correct values for various systemdependent variables used during compilation It uses those values to create a Make le in each directory of the package The simplest way to compile a package is cd to the directory containing the package s source code Type con gure to con gure the package for your system Type make to compile the package Optionally type make check to run any selftests that come with the package Type make install to install the programs and any data les and documentation Optionally type make clean to remove the program binaries and object les from the source code directory The con gure utility supports a wide variety of options You can usually use the hep option to get a list of interesting option for a particular con gure script The only generic options you are likely to use are the pre x and execpre x options These options are used to specify the installation directories The directory named by the pre x option will hold machine independent les such as documentation data and con guration les The directory named by the execpre x option which is normally a subdirectory of the pre x directory will hold machine dependent les such as executables 72 Downloading source code 73 Extracting the source code The tar command turns several les and directories into one single tar le This is then compressed using the gzip command to create a targz le First unzip the le using the gunzip command This will create a tar le gunzip lenametargz Then extract the contents of the tar le tar xvf lenametar 74 Con guring and creating the Make le The rst thing to do is carefully read the README and INSTALL text les use the less command These contain important information on how to compile and run the software The units package uses the GNU con gure system to compile the source code We will need to specify the installation directory since the default will be the main system area which you will not have write permissions for We need to create an install directory in your home directory mkdir unitsl74 Then run the con gure utility setting the installation path to this con gure pre xHOMEunitsl74 Note The HOME variable is an example of an environment variable The value of HOME is the path to your home directory Just type echo HOME to show the contents of this variable If con gure has run correctly it will have created a Make le with all necessary options 75 Building the package Now you can go ahead and build the package by running the make command make After a minute or two the executables will be created You can check to see everything compiled successfully by typing make check If everything is okay you can now install the package make install This will install the les into the unitsl74 directory you created earHer 76 Running the software You are now ready to run the software cd unitsl74 To run the program change to the bin directory and type units To view what units it can convert between view data le in the share directory To read the full documentation change into the info directory and type info eunitsinfo 77 Stripping unnecessary code When a piece of software is being developed it is useful for the programmer to include debugging debugging information into the resulting executable This way if there are problems encountered when running the executable the programmer can load the executable into a debugging software package and track down any software bugs This is useful for the programmer but not necessary for the user We can assume that the package once nished and available for download has already been tested and debugged However when we compiled the software above debugging information was still compiled into the nal executable Since it is unlikely that we are going to need this debugging information we can strip it out of the nal executable One of the advantages of this is a much smaller executable which should run slightly faster What we are going to do is look at the before and after size of the binary le First change into the bin directory of the units installation directory cd unitsl74bin ls l You can get more information on the type of le by using the le command le units To strip all the debug and line numbering information out of the binary le use the strip command strip units Is I Sometimes you can use the make command to install prestripped copies of all the binary les when you install the package Instead of typing make install simply type make installstrip UNIX Tutorial Eight 81 UNIX Variables Variables are a way of passing information from the shell to programs when you run them Programs look in the environmentquot for particular variables and if they are found will use the values stored Some are set by the system other by you yet others by the shell or any program that loads another program Standard UNIX variables are split into two categories environment variables and shell variables In broad terms shell variables apply only to the current instance of the shell and are used to set shortterm working conditions environment variables have a farther reaching signi cance and those set at login are valid for the duration of the session By convention environment variables have UPPER CASE and shell variables have lower case names 82 Environment Variables An example of an environment variable is the OSTYPE variable The value of this is the current operating system you are using Type echo OSYTYPE More examples of environment variables are USER your login name HOME the path name of your home directory HOST the name of the computer you are using ARCH the architecture of the computers processor DISPLAY the name of the computer screen to display X windows PRINTER the default printer to send print jobs PATH the directories the she should search to nd a command Finding out the current values of these variables ENVIRONMENT variables are set using the setenv command displayed using the printenv or env commands and unset using the unsetenv command To show all values of these variables type printenv less 83 Shell Variables An example of a shell variable is the history variable The value of this is how many she commands to save allow the user to scroll back through all the commands they have previously entered Type echo history More examples of shell variables are cwd your current working directory home the path name of your home directory path the directories the shell search to nd a command prompt the text string used to prompt for interactive commands shel your login shell Finding out the current values of these variables SHELL variables are both set and displayed using the set command They can be unset by using the unset command To show all values of these variables type setess So what is the difference between PATH and path In general environment and shell variables that have the same name apart from the case are distinct and independent except for possibly having the same initial values There are however exceptions Each time the shell variables home user and term are changed the corresponding environment variables HOME USER and TERM receive the same values However altering the environment variables has no effect on the corresponding shell variables PATH and path specify directories to search for commands and programs Both variables always represent the same directory list and altering either automatically causes the other to be changed 84 Using and setting variables Each time you login to a UNIX host the system looks in your home directory for initialization les Information in these les is used to set up your working environment The C and TC shells uses two les called login and cshrc note that both le names begin with a dot At login the C shell rst reads cshrc followed by login login is to set conditions which will apply to the whole session and to perform actions that are relevant only at login cshrc is used to set conditions and perform actions speci c to the shell and to each invocation of it The guidelines are to set ENVIRONMENT variables in the login le and SHELL variables in the cshrc le WARNING NEVER put commands that run graphical displays eg a web browser in your cshrc or login le 85 Setting shell variables in the cshrc le To change the number of shell commands saved in the history list you need to set the shell variable history It is set to 100 by default but you can increase this if you wish set history 200 Check this has worked by typing echo history However this has only set the variable for the lifetime of the current shell If you open a new xterm window it will only have the default history value set To PERMANENTLY set the value of history you will need to add the set command to the cshrc le First open the cshrc le in a text editor An easy userfriendly editor to use is nedit nedit cshrc Add the following line AFTER the list of other commands set history 200 Save the le and force the shell to reread its cshrc le buy using the shell source command source cshrc Check this has worked by typing echo history 86 Setting the path When you type a command your path or PATH variable de nes in which directories the shell will look to nd the command you typed If the system returns a message saying quotcommand Command not foundquot this indicates that either the command does t exist at all on the system or it is simply not in your path For example you either need to directly specify the units path unitsl74binunits or you need to have the directory unitsl74bin in your path You can add it to the end of your existing path the path represents this by using the command set path path unitsl74bin Test that this worked by trying to run this units in any directory other that where units is actually locate cd units To add this path PERMANENTLY add the following line to your cshrc AFTER the list of other commands set path path unitsl74bin Lynda Unix for Mac OS X Users Ch1 Introduction to Unix What Is UNIX Unix is an operating system Developed by ATampT employees at Bell Labs 19691971 Named Unics Uniplexed Information and Computing Service Renamed Unix when it could support multiple users Rewritten in the C programming language 1972 C was developed for Unix OS C allowed Unix to be portable Unix spreads outside ATampT 1975 Because of a court order in an antitrust case ATampT has been forbidden from entering the computer software business They could not sell Unix but give it away Government agencies universities and corporations Free licenses and source code System Five the rst public version of Unix Branches and improvements 1977 present Open source BSD Berkeley Software Distribution Linux Closed source Solaris Sun Oracle AIX IBM HPUX Hewlett Packard Mixed source Mac OS X Apple Unix now means a Unixlike systemquot Mobile devices are Unix iPhone iPad Android Mac OS X BSD Unix NeXTSTEP Apple code Darwin the Unix sitting underneath Mac OS X Unix is under the hoodquot Finder and System Preferences interact with Unix Access Unix directly from the command line using Terminal Why use Unix instead of a graphical user interface GUI Difference in power and control When working with data nondata elements can get in the way Similar to the difference between car transmissions Automatic give up control for convenience Manual give up convenience for control Command K Clear All Command option K Clear Scrollback YangSiqingsMacBookPro Ash hostname currentdirectory username prompt Terminal And Unix Shortcuts UpDown arrows Review previous commands Control A Move cursor to start of a line Contro E Movecursor to end of line Option click line Move cursor to click point Terminal only Tab Try to complete the command or lename Tab Tab When tab doesn t complete show list of possible matches Command Cycle between Terminal windows Terminal only Command Structure command options arguments Options are optional echo n Hello World suppress a new line ruby v the version of ruby we have installed on computer v common option of version v version etter word ls l a h Desktop ls ah Desktop banner w 50 Hello World39 50 is an argument to the w option print width of argument banner w50 Hello World39 cat n le1txt le2txt cat n number the line of text break up commands Kernel and Shells Kernel Core of the OS Allocates time and memory to programs Mac OS X uses the Mach kernel Shell Outer layer of OS Interacts with user Sends request to kernel Mac OS X uses the bash shell but includes other choices Popular Shells sh Thompson Shell 1971 sh Bourne Shell 1977 csh C Shell 1979 tcsh Tabbed C Shell 1979 ksh Korn Shell 1982 bash BourneAgain Shell 1987 zsh Z Shell 1990 All installed on Mac echo SHELL echo 0 show the current shell we are working in Just type shelltype to switch ertcsh Manualpages man command next page spacebar forwardbackwards press f bquot key q quit man h man hep man help pages man k apropos whatis doesn t do keyword searching apropos does Ch2 Filesystem Basics Working directory the directory we are in pwd nd out present working directory path dot les are invisible con g les Trash is the folder where trash les are thrown in DSStore is for the Mac desktop the Finder to store different options about how to view this folder bashhistory store history commands CFUserTextEncoding In Control e d directory L link or shortcut s h When used with the option use unit suf xes Bytes Petabyte in order to reduce the number of digits to three or less using base 2 for sizes Path beginning with quotlquot is an absolute path Path without starting at quotlquot starts with the working directory called relative path cd turn back to the previous directory cd col moving back to root directory Filesystem Organization bin Unix programs Ch3 Working With Files and Directories UNIX File Naming Maximum of 255 characters Avoid amp A lt gt and most other symbols Use AZ az 09 period underscore hyphen not start with period or hyphen Typically lowercase quotMyFilequot and quotmy lequot would be different casesensitive Underscores are better than spaces Escape spaces with Use quotes around names with spaces File endings txt png html etc not required but helpful Differentiates les from commands and directories Creating Files Primary techniques to create les Unix text editors Direct output to le touch can change le access and modi cation time conventionally if the le exists Unix Text Editors ed Edit text Earliest Unix editor not userfriendly vi visual editing mode vim vi improved Modal ngers rarely leave keyboard home row GNU Emacs editor macros Macros to automate work swiss army knife pico pine composer nano lOOOx larger than pico Basic features easy to use Reading Files cat Concatenate more Paginated output space bar to ip but no backwards less Backward scrolling Better memory use less gt more on Mac more replaced by less F Forward B Backward Q quit g go to start shift g go to end less M prompt reading lines and progress less N show line numbers Creating Directories mkdir p create intermediate directories as required mkdir v be verbose when creating directories listing them as they are created print out the paths of directories created Moving Files and Directories n don t accidentally replace a le and replace it By default mv will overwrite les mv Copying les and directories Cp cp R copy the directory and the entire subtree connected at that point


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

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I 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."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

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.