From 4c3236a910ab3a3e4ad8b3fa929f2842c44acf9d Mon Sep 17 00:00:00 2001 From: Kriszta Date: Tue, 28 Jul 2015 21:47:51 +0100 Subject: [PATCH 1/7] adding folder and file for more command line and advanced command line tutorials --- command-line/advanced-command-line/tutorial.md | 5 +++++ command-line/command-line/tutorial.md | 6 ++++++ index.html | 4 +++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 command-line/advanced-command-line/tutorial.md create mode 100644 command-line/command-line/tutorial.md diff --git a/command-line/advanced-command-line/tutorial.md b/command-line/advanced-command-line/tutorial.md new file mode 100644 index 00000000..fbdc8710 --- /dev/null +++ b/command-line/advanced-command-line/tutorial.md @@ -0,0 +1,5 @@ +--- +layout: page +title: Advanced command line +--- + diff --git a/command-line/command-line/tutorial.md b/command-line/command-line/tutorial.md new file mode 100644 index 00000000..1f5fdee0 --- /dev/null +++ b/command-line/command-line/tutorial.md @@ -0,0 +1,6 @@ +--- +layout: page +title: More command line +--- + +In the previous lesson we have learnt how to navigate the directories (folders) of our computer using the command line, and how to create directories and files. \ No newline at end of file diff --git a/index.html b/index.html index 711ba9b3..e8a38a87 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,9 @@

HTML

Command Line

Version Control

From 09ae1572fe841fc8cbc7514e3d4e64e0d887bf35 Mon Sep 17 00:00:00 2001 From: Kriszta Date: Tue, 28 Jul 2015 22:22:25 +0100 Subject: [PATCH 2/7] adding outline of second command line tuts --- .../advanced-command-line/tutorial.md | 2 + command-line/command-line/tutorial.md | 47 ++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/command-line/advanced-command-line/tutorial.md b/command-line/advanced-command-line/tutorial.md index fbdc8710..e6377f0e 100644 --- a/command-line/advanced-command-line/tutorial.md +++ b/command-line/advanced-command-line/tutorial.md @@ -3,3 +3,5 @@ layout: page title: Advanced command line --- +flags +wildcards diff --git a/command-line/command-line/tutorial.md b/command-line/command-line/tutorial.md index 1f5fdee0..d939f3a6 100644 --- a/command-line/command-line/tutorial.md +++ b/command-line/command-line/tutorial.md @@ -3,4 +3,49 @@ layout: page title: More command line --- -In the previous lesson we have learnt how to navigate the directories (folders) of our computer using the command line, and how to create directories and files. \ No newline at end of file +In the previous lesson we have learnt how to navigate the directories (folders) of our computer using the command line, and how to create directories and files. In this lesson we'll look at more command line commands that will allow us to manipualte the directories and files on our computer even further. + +## Example 1: copying, moving and removing directories and files + +### `cp` or copying files and directories + +```bash +$ cp something.txt something_else.txt +``` + +```bash +$ cp folder/something.txt other_folder/ +``` + +```bash +$ cp folder/something.txt folder/other_something.txt other_folder/ +``` + +### `mv` or moving files + +```bash +$ mv something.txt other_folder/ +``` + +```bash +$ mv something.txt something_else.txt other_folder/ +``` + +```bash +$ mv something.txt something_else.txt +``` + +above command renames somethingtxt to something_else.txt + +### `rm` or removing files + +```bash +$ rm something.txt +``` + +rm -r command? + + +### `rmdir` or removing directoris (only works on empty directories) + +to delete folders with files in them use rm -r command \ No newline at end of file From 10f216f57be996be736a6e9cfbd0a50928354907 Mon Sep 17 00:00:00 2001 From: Kriszta Date: Tue, 28 Jul 2015 22:48:29 +0100 Subject: [PATCH 3/7] adding two more commands to the second command line tutorial and adding roudh outline to advanced command line tuts --- .../advanced-command-line/tutorial.md | 5 +++++ command-line/command-line/tutorial.md | 20 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/command-line/advanced-command-line/tutorial.md b/command-line/advanced-command-line/tutorial.md index e6377f0e..91fff210 100644 --- a/command-line/advanced-command-line/tutorial.md +++ b/command-line/advanced-command-line/tutorial.md @@ -5,3 +5,8 @@ title: Advanced command line flags wildcards +piping and redirection +sort? +uniq? +grep +sed aka stream editor diff --git a/command-line/command-line/tutorial.md b/command-line/command-line/tutorial.md index d939f3a6..d41f9848 100644 --- a/command-line/command-line/tutorial.md +++ b/command-line/command-line/tutorial.md @@ -48,4 +48,22 @@ rm -r command? ### `rmdir` or removing directoris (only works on empty directories) -to delete folders with files in them use rm -r command \ No newline at end of file +to delete folders with files in them use rm -r command + +### `cat` or printing? streaming? files + +```bash +$ cat file.txt +``` + +```bash +$ cat file.txt > other_file.txt +``` + +redirecting and rewriting + +```bash +$ cat file.txt >> other_file.txt +``` + +redirecting and appending \ No newline at end of file From 8483d4ff7a3e11798ff3d98e6cccd6936837e3d6 Mon Sep 17 00:00:00 2001 From: Kriszta Date: Tue, 4 Aug 2015 23:44:36 +0100 Subject: [PATCH 4/7] removed references to new command line tutorials from index.html --- index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.html b/index.html index e8a38a87..25862cb0 100644 --- a/index.html +++ b/index.html @@ -39,8 +39,6 @@

HTML

Command Line

Version Control

From 727905d4147895f558c8c21e12592db88620f08a Mon Sep 17 00:00:00 2001 From: Kriszta Date: Tue, 4 Aug 2015 23:48:21 +0100 Subject: [PATCH 5/7] added instructions how to access Powershell on a Windows --- command-line/introduction/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command-line/introduction/tutorial.md b/command-line/introduction/tutorial.md index 57360739..3a6896c2 100644 --- a/command-line/introduction/tutorial.md +++ b/command-line/introduction/tutorial.md @@ -9,7 +9,7 @@ The command line is a text interface for your computer. Just like Windows Explor ## How do I access the command line? -To access the command line, we use a terminal emulator, usually called a terminal. On Mac OSX you can access the terminal by opening the Terminal application from your Applications folder. On Windows you should use a program called the PowerShell. +To access the command line, we use a terminal emulator, usually called a terminal. On Mac OSX you can access the terminal by opening the Terminal application from your Applications folder. On Windows you should use a program called the PowerShell. To access the Powershell, click 'Start', in 'Search programs and files' type powershell, and hit enter. This should open up Powershell on your computer. ## Example 1: navigating around in the terminal From f3de8b879e2eca3cf977c6c75356959f169624f1 Mon Sep 17 00:00:00 2001 From: Kriszta Date: Tue, 4 Aug 2015 23:55:32 +0100 Subject: [PATCH 6/7] adding warning about sketchy commands --- command-line/introduction/tutorial.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command-line/introduction/tutorial.md b/command-line/introduction/tutorial.md index 3a6896c2..043df020 100644 --- a/command-line/introduction/tutorial.md +++ b/command-line/introduction/tutorial.md @@ -11,6 +11,8 @@ The command line is a text interface for your computer. Just like Windows Explor To access the command line, we use a terminal emulator, usually called a terminal. On Mac OSX you can access the terminal by opening the Terminal application from your Applications folder. On Windows you should use a program called the PowerShell. To access the Powershell, click 'Start', in 'Search programs and files' type powershell, and hit enter. This should open up Powershell on your computer. +Before we get started, you should note some DO's and DONT's while using the command line. The command line is a powerful tool that can significantly speed up your workflow but can also irreversibly harm your computer so make sure you use it responsibly. If you are not sure what a command does DO NOT type it into your terminal. The command `rm -rf /` is a classic one that you should never use. If you are stuck and in need of help make sure you ask from someone you trust or other reputable sources. It goes without saying that all commands in this tutorial are safe to use. + ## Example 1: navigating around in the terminal Once you opened up your terminal, type in the following after the `$` or `>` sign and hit enter: (`$` or `>` is the prompt, you don't have to retype that in the terminal, only the characters that come after them): From 8351f0e545ee980090dd6ec55d3451d7b2973fb2 Mon Sep 17 00:00:00 2001 From: Kriszta Date: Tue, 4 Aug 2015 23:59:17 +0100 Subject: [PATCH 7/7] removing command line tutorial and advanced command line tutorial, moving them onto another branch --- .../advanced-command-line/tutorial.md | 12 ---- command-line/command-line/tutorial.md | 69 ------------------- 2 files changed, 81 deletions(-) delete mode 100644 command-line/advanced-command-line/tutorial.md delete mode 100644 command-line/command-line/tutorial.md diff --git a/command-line/advanced-command-line/tutorial.md b/command-line/advanced-command-line/tutorial.md deleted file mode 100644 index 91fff210..00000000 --- a/command-line/advanced-command-line/tutorial.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -layout: page -title: Advanced command line ---- - -flags -wildcards -piping and redirection -sort? -uniq? -grep -sed aka stream editor diff --git a/command-line/command-line/tutorial.md b/command-line/command-line/tutorial.md deleted file mode 100644 index d41f9848..00000000 --- a/command-line/command-line/tutorial.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -layout: page -title: More command line ---- - -In the previous lesson we have learnt how to navigate the directories (folders) of our computer using the command line, and how to create directories and files. In this lesson we'll look at more command line commands that will allow us to manipualte the directories and files on our computer even further. - -## Example 1: copying, moving and removing directories and files - -### `cp` or copying files and directories - -```bash -$ cp something.txt something_else.txt -``` - -```bash -$ cp folder/something.txt other_folder/ -``` - -```bash -$ cp folder/something.txt folder/other_something.txt other_folder/ -``` - -### `mv` or moving files - -```bash -$ mv something.txt other_folder/ -``` - -```bash -$ mv something.txt something_else.txt other_folder/ -``` - -```bash -$ mv something.txt something_else.txt -``` - -above command renames somethingtxt to something_else.txt - -### `rm` or removing files - -```bash -$ rm something.txt -``` - -rm -r command? - - -### `rmdir` or removing directoris (only works on empty directories) - -to delete folders with files in them use rm -r command - -### `cat` or printing? streaming? files - -```bash -$ cat file.txt -``` - -```bash -$ cat file.txt > other_file.txt -``` - -redirecting and rewriting - -```bash -$ cat file.txt >> other_file.txt -``` - -redirecting and appending \ No newline at end of file