| | 1 | == Unix Cheat Sheet == |
| | 2 | |
| | 3 | To log in to the grid, you need to use PuTTY if you use a PC, or, in the case of a mac, you can log in from the terminal. |
| | 4 | |
| | 5 | === Loggin in to other machines with SSH === |
| | 6 | |
| | 7 | The `ssh` command can be used to log in to other machines, or from a mac to the grid: |
| | 8 | |
| | 9 | {{{ |
| | 10 | $ ssh usernam@host |
| | 11 | }}} |
| | 12 | |
| | 13 | === List files === |
| | 14 | |
| | 15 | To list the files in the current directory: |
| | 16 | |
| | 17 | {{{ |
| | 18 | $ ls |
| | 19 | }}} |
| | 20 | |
| | 21 | To get more information about every file, do |
| | 22 | |
| | 23 | {{{ |
| | 24 | $ ls -l |
| | 25 | }}} |
| | 26 | |
| | 27 | To get information about a specific file or directory (you could add -l too) |
| | 28 | |
| | 29 | {{{ |
| | 30 | $ ls filename |
| | 31 | }}} |
| | 32 | |
| | 33 | === Change working directory === |
| | 34 | |
| | 35 | {{{ |
| | 36 | $ cd path |
| | 37 | }}} |
| | 38 | where path is the directory you want to change to, eg |
| | 39 | {{{ |
| | 40 | $ cd /proj/my-project |
| | 41 | }}} |
| | 42 | |
| | 43 | To print the current working directory use `pwd`. |
| | 44 | |
| | 45 | There are two "special directories": `.` and `..`. The first corresponds to the current directory, the second corresponds to the directory above the current directory. |
| | 46 | |
| | 47 | Finally, |
| | 48 | {{{ |
| | 49 | $ cd |
| | 50 | }}} |
| | 51 | without any arguments will return you to your home directory. |
| | 52 | |
| | 53 | |
| | 54 | |