From: rkhetani Date: Tue, 8 Jan 2013 23:10:30 +0000 (-0600) Subject: Updated for Jan12th bootcamp X-Git-Url: http://git.tremily.us/?p=swc-modular-shell.git;a=commitdiff_plain;h=c49fdcd0c139eb4a687e1a24728053b41da720ca Updated for Jan12th bootcamp --- diff --git a/shell/Readme.md b/shell/Readme.md index b029a37..8de6964 100644 --- a/shell/Readme.md +++ b/shell/Readme.md @@ -5,8 +5,8 @@ * * * * * -**Updated and presented by : Sasha Wood** - +**Updated and presented by : Radhika Khetani** +**Modified by : Sasha Wood** **This presentation originally developed by: Milad Fatenejad** # What is the shell how do I access the shell? @@ -41,10 +41,11 @@ most important reasons are that: The shell is just a program and there are many different shell programs that have been developed. The most common shell (and the one we will use) is called the Bourne-Again SHell (bash). Even if bash is -not the default shell, it usually installed on most systems and can be +not the default shell, it is usually installed on most systems and can be started by typing `bash` in the terminal. Many commands, especially a lot of the basic ones, work across the various shells but many things are different. I recommend sticking with bash and learning it well. +[Here is a link for more information](http://en.wikipedia.org/wiki/Bash_(Unix_shell)) To open a terminal, just single click on the "Terminal" icon on the Desktop. @@ -52,19 +53,23 @@ Desktop. # The Example: Manipulating Experimental Data Files We will spend most of our time learning about the basics of the shell -by manipulating some experimental data from a hearing tests. To get +by manipulating some experimental data from a hearing test. To get the data for this test, you will need internet access. Just enter the command: - git clone https://github.com/JHU-SWC-2012/SWC-bootcamp.git + git clone https://github.com/thehackerwithin/boot-camps.git + +Followed by: -This will grab all of the data needed for this workshop from the + git checkout 2013-01-chicago + +These 2 commands will grab all of the data needed for this workshop from the internet. # Let's get started -One very basic command is `echo`. This command is just prints text to -the terminal. Try entering the command: +One very basic command is `echo`. This command just prints text to +the terminal. Try the command: echo Hello, World @@ -747,12 +752,11 @@ Notice that the names are now printed in alphabetical order. **Short Exercise** Use the `echo` command and the append operator, `>>`, to append your -name to the file, then sort it. +name to the file, then sort it and make a new file called Sorted. * * * * -Let's navigate back to `~/SWC-bootcamp/1-Shell/data`. You should still -have the `all_data` file hanging around here. Enter the following command: +Let's navigate back to `~/SWC-bootcamp/1-Shell/data`. Enter the following command: wc Bert/* | sort -k 3 -n @@ -804,7 +808,10 @@ Then enter the following text: Now, `cd` into the `Bert` directory and enter the command `../smallest`. Notice that it says permission denied. This happens because we haven't told the shell that this is an executable -file. Enter the following commands: +file. If you do `ls -l ../smallest`, it will show you the permissions on +the left of the listing. + +Enter the following commands: chmod a+x ../smallest ../smallest @@ -814,10 +821,10 @@ particular command modifies the file `../smallest` by giving all users (notice the `a`) permission to execute (notice the `x`) the file. If you enter: - ls ../smallest + ls -l ../smallest -You will see that the file name is green. Congratulations, you just -created your first shell script! +You will see that the file name is green and the permissions have changed. +Congratulations, you just created your first shell script! # Searching files