Useful shell commands » History » Version 18
Amber Herold, 11/15/2011 11:13 AM
1 | 1 | Amber Herold | h1. Useful shell commands |
---|---|---|---|
2 | |||
3 | 9 | Amber Herold | Link to "top 10 cheat sheets":http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html. |
4 | |||
5 | 7 | Amber Herold | |
6 | h3. make a folder writable |
||
7 | |||
8 | <pre> chmod -R g+rw eman_recon14</pre> |
||
9 | |||
10 | 1 | Amber Herold | h3. check the status of a job |
11 | |||
12 | # ssh to the processing server |
||
13 | # <pre>qstat -au YOUR_USER_NAME</pre> |
||
14 | # will list your jobs |
||
15 | |||
16 | 7 | Amber Herold | h3. check which nodes are currently being used on processing machine |
17 | 1 | Amber Herold | |
18 | 7 | Amber Herold | <pre> |
19 | qstat -an |
||
20 | </pre> |
||
21 | 1 | Amber Herold | |
22 | 10 | Amber Herold | h3. check the status of each node on the cluster |
23 | |||
24 | 18 | Amber Herold | There's a couple ways you can check. |
25 | # spew a bunch of info about each of the nodes including status: |
||
26 | <pre> |
||
27 | pbsnodes |
||
28 | </pre> |
||
29 | # For a graphic version use the command ( remember to use -X with |
||
30 | ssh to display it back to your computer): |
||
31 | <pre> |
||
32 | xpbsmon |
||
33 | </pre> |
||
34 | 1 | Amber Herold | |
35 | h3. kill a process |
||
36 | |||
37 | # Log into the machine it is running on |
||
38 | <pre>ssh fly</pre> |
||
39 | # Look for processes with your user name |
||
40 | <pre>ps -ef |grep [your_username]</pre> |
||
41 | # Kill the process using the number in the first column after your username |
||
42 | <pre>kill [process id]</pre> |
||
43 | # If the process was a copy, remove the destination folder |
||
44 | <pre>rm [destination folder]</pre> |
||
45 | # list system stats |
||
46 | <pre>top</pre> |
||
47 | 2 | Amber Herold | |
48 | 5 | Amber Herold | h3. submit a job to a job manager |
49 | |||
50 | <pre> |
||
51 | qsub <jobfilename> |
||
52 | </pre> |
||
53 | |||
54 | 4 | Amber Herold | h3. Kill a job running through the job manager |
55 | 2 | Amber Herold | |
56 | 3 | Amber Herold | * use *qdel* <job number> |
57 | 5 | Amber Herold | |
58 | h3. Start an interactive session on a node |
||
59 | |||
60 | <pre> |
||
61 | qsub -I |
||
62 | </pre> |
||
63 | |||
64 | 17 | Amber Herold | * you can type in job file contents line by line and see results. |
65 | 1 | Amber Herold | |
66 | 6 | Amber Herold | h3. Check how much space is available on a data drive |
67 | |||
68 | 8 | Amber Herold | * cd to the drive (cd /ami/data00) and type: |
69 | 1 | Amber Herold | <pre> |
70 | df -h . |
||
71 | </pre> |
||
72 | 7 | Amber Herold | |
73 | * to show disc usage status of all mounted systems: |
||
74 | <pre> |
||
75 | df -h |
||
76 | </pre> |
||
77 | 6 | Amber Herold | |
78 | 11 | Amber Herold | h3. see how large the files are in a directory |
79 | |||
80 | <pre> |
||
81 | du |
||
82 | 1 | Amber Herold | </pre> |
83 | 17 | Amber Herold | |
84 | * Or for a more human readable command: |
||
85 | |||
86 | 12 | Amber Herold | <pre> |
87 | du -sch * |
||
88 | </pre> |
||
89 | 11 | Amber Herold | |
90 | 6 | Amber Herold | h3. See what groups a user belongs to |
91 | |||
92 | <pre> |
||
93 | id <username> |
||
94 | </pre> |
||
95 | 16 | Amber Herold | |
96 | 15 | Amber Herold | * *note:* the user's umask should be set to 002 in their .cshrc file if they are not using the global one to make sure AMI group members can process their data. |