Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gjp1203 committed Jun 10, 2020
1 parent 30e2531 commit cf7ec4a
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions 03_SSH_Unix_Commands.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,32 @@ A new directory can be created using the mkdir command:
user@host:~$ mkdir <new_directory_name>
```

### 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 <target_directory>
user@host:~$ cd ..
```

### Move:

The mv command command can be used to either rename or move files and folders:

```shell
user@host:~$ mv <current_filename> <new_filename> # This is to change a file name
user@host:~$ mv <filepath> <target_directory> # This is to move a file to a folder
user@host:~$ mv -r <directory_path> <target_directory> # 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 <filename> <filecopy>
user@host:~$ cp −r <directory> <target>
```

### Remove:

Expand All @@ -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 <target_directory>
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 <filename> <filecopy>
user@host:~$ cp −r <directory> <target>
```

## Command Line Editors

There exists a large number of [command line editors](https://en.wikipedia.org/wiki/List_of_text_editors)
Expand Down

0 comments on commit cf7ec4a

Please sign in to comment.