Project

General

Profile

Useful shell commands » History » Version 19

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