Project

General

Profile

Useful shell commands » History » Version 13

Amber Herold, 11/15/2011 11:09 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
There's a couple ways you can check.  One is using the command 'pbsnodes'.
25
  That will spew a bunch of info about each of the nodes including status.
26
 For a graphic version use the command xpbsmon ( remember to use -X with
27
ssh to display it back to your computer).
28 1 Amber Herold
29
h3. kill a process
30
31
# Log into the machine it is running on
32
<pre>ssh fly</pre>
33
# Look for processes with your user name
34
<pre>ps -ef |grep [your_username]</pre>
35
# Kill the process using the number in the first column after your username
36
<pre>kill [process id]</pre>
37
# If the process was a copy, remove the destination folder
38
<pre>rm [destination folder]</pre>
39
# list system stats
40
<pre>top</pre>
41 2 Amber Herold
42 5 Amber Herold
h3. submit a job to a job manager
43
44
<pre>
45
qsub <jobfilename>
46
</pre>
47
48 4 Amber Herold
h3. Kill a job running through the job manager
49 2 Amber Herold
50 3 Amber Herold
* use *qdel* <job number>
51 5 Amber Herold
52
h3. Start an interactive session on a node
53
54
<pre>
55
qsub -I
56
</pre>
57
58 6 Amber Herold
you can type in job file contents line by line and see results.
59 1 Amber Herold
60 6 Amber Herold
h3. Check how much space is available on a data drive
61
62 8 Amber Herold
* cd to the drive (cd /ami/data00) and type:
63 1 Amber Herold
<pre>
64
df -h .
65
</pre>
66 7 Amber Herold
67
* to show disc usage status of all mounted systems:
68
<pre>
69
df -h
70
</pre> 
71 6 Amber Herold
72 11 Amber Herold
h3. see how large the files are in a directory
73
74
<pre>
75
du
76
</pre>
77 12 Amber Herold
Or for a more human readable command:
78
<pre>
79
du -sch *
80
</pre>
81 11 Amber Herold
82 6 Amber Herold
h3. See what groups a user belongs to
83
84
<pre>
85
id <username>
86
</pre>
87 13 Amber Herold
88
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.