-
Notifications
You must be signed in to change notification settings - Fork 1
/
cheat_sheet.Rmd
59 lines (57 loc) · 8.38 KB
/
cheat_sheet.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Shell cheat sheet
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| Command | Description |
+===================================+====================================================================================================================+
| `cd` | Change directory |
| | |
| | `..` to parent directory |
| | |
| | `~` to home directory |
| | |
| | `-` to last visited directory |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `ls` | List files in directory |
| | |
| | `-l` as list |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `ssh <username>@<server address>` | Make a secure connection to server |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `pwd` | Print working directory |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `less <filename>` | Look at text file |
| | |
| | Press <kbd>H</kbd>elp for navigation |
| | |
| | Press <kbd>Q</kbd>uit to leave |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `scp <source> <target>` | Copy files between local and server |
| | |
| | Give file path on server as `<user>@<server address>:<file path>` |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `exit` | Close session (either to server or to local terminal) |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `history` | Get list of command history |
| | |
| | Follow with `!<number>` to execute that corresponding command again |
| | |
| | `-a <filename>` save a history of your current session to a text file to document your work |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `man <command>` | Unfortunately, it is impossible to predict how to get help for a `<command>`, try any one of these until one works |
| | |
| `help <command>` | |
| | |
| `<command> --help` | |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| `screen` | Create a virtual terminal that continues to run jobs even when your connection to server terminates |
| | |
| | `-S <session name>` create a session with `<session name>` |
| | |
| | `-ls` list all running sessions |
| | |
| | `-r <session name>` resume a session |
| | |
| | To leave a session but keep it running, first <kbd>ctrl</kbd>+<kbd>a</kbd>ctivate commands to `screen`, then |
| | |
| | <kbd>d</kbd>etach |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------+
: (\#tab:commands) Shell cheat sheet