From cf7ec4ac550eb54d0811293a6019093d0220eac3 Mon Sep 17 00:00:00 2001 From: gjp1203 Date: Wed, 10 Jun 2020 08:50:23 +0100 Subject: [PATCH] updates --- 03_SSH_Unix_Commands.Rmd | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/03_SSH_Unix_Commands.Rmd b/03_SSH_Unix_Commands.Rmd index 1689f49..b6251e4 100644 --- a/03_SSH_Unix_Commands.Rmd +++ b/03_SSH_Unix_Commands.Rmd @@ -57,6 +57,15 @@ A new directory can be created using the mkdir command: user@host:~$ mkdir ``` +### Change your Working Directory: + +To change your working directory use the cd (change directory) command, specifying your target directory or .. to move back: + +```shell +user@host:~$ cd +user@host:~$ cd .. +``` + ### Move: The mv command command can be used to either rename or move files and folders: @@ -64,10 +73,16 @@ The mv command command can be used to either rename or move files and folders: ```shell user@host:~$ mv # This is to change a file name user@host:~$ mv # This is to move a file to a folder -user@host:~$ mv -r # This is to move a folder with all its content to an other folder ``` -We add the -r (recursive) flag to move a directory and all its contents (subdirectories and files). +### Copy: + +To copy files use cp. The -r flag can be added to recursively copy all files and subdirectories within a directory: + +```shell +user@host:~$ cp +user@host:~$ cp −r +``` ### Remove: @@ -83,24 +98,6 @@ Again, we add the -r (recursive) flag to remove a directory and all its contents **Warning: rm is to be used with caution. There is no trash folder from which the files can be recovered. Upon using this command the files are deleted.** -### Change your Working Directory: - -To change your working directory use the cd (change directory) command, specifying your target directory or .. to move back: - -```shell -user@host:~$ cd -user@host:~$ cd .. -``` - -### Copy: - -To copy files use cp. Again the -r flag can be added to recursively copy all files and subdirectories within a directory: - -```shell -user@host:~$ cp -user@host:~$ cp −r -``` - ## Command Line Editors There exists a large number of [command line editors](https://en.wikipedia.org/wiki/List_of_text_editors)