Version 3 (modified by 10 years ago) (diff) | ,
---|
CoriolisUnixCommand - UNIX Command
List running processes
ps
Use a pipe grep (|grep
) to select users or processes names.
Useful options :
- a : all processes, not only current user's process
- u : sorted by user
- f : show arborescence
exemple ci-dessous : ps fau | grep matlab
gostiaux@eres0vmbig2:/.fsnet/data/eres/coriolis-home/gostiaux$ ps fau |grep matlab mathur2m 29190 0.4 2.8 1239856 411264 pts/3 Sl+ Mar04 20:54 \_ /opt/matlab/R2009b/bin/glnxa64/MATLAB -r uvmat mathur2m 21961 1.5 3.3 1302644 486148 pts/24 Sl+ Mar04 55:18 \_ /opt/matlab/R2009b/bin/glnxa64/MATLAB -r uvmat mathur2m 22769 0.0 0.0 13708 980 pts/25 Ss+ Mar04 0:00 \_ /opt/matlab/R2009b/bin/glnxa64/matlab_helper /dev/pts/25 yes gostiaux 10901 0.0 0.0 9544 840 pts/15 S+ 11:36 0:00 \_ grep matlab viboud 26714 0.0 1.9 1147184 292264 pts/0 Sl+ Mar04 3:40 \_ /opt/matlab/R2009b/bin/glnxa64/MATLAB -r uvmat sommeria 4098 0.9 2.9 1218768 436936 pts/10 Sl+ 07:44 2:06 \_ /opt/matlab/R2009b/bin/glnxa64/MATLAB
List process with a given processname (list of PID numbers): ps -u 'username' | grep processname
(|grep
detects a string in any display)
kill process
kill 'number PID' or stronger 'kill -9 'numero PID'
(case of thunderbird: need also to suppress lock files, use command 'rmLock')
Synchronisation of files
rsync -a rep1 rep2/
(be careful with / , synchronise the directory "rep1" with rep1 existing in rep2 ;)
Change file access properties
- examples (can be performed only by the file owner):
- change all png files to read-only in the current directory:
chmod ugo-w *.png
- provide writing access for your group to a directory dirname (or to a file):
chmod ugo+ws dirname
Monitor disk space
df -a
gives all the partitions and their status
du --max-depth=2 -h
browse recursively a folder, and gives the space of each block
example :
gostiaux@eres0vmbig2:/fsnet/project/coriolis/2011$ du --max-depth=1 -h 0 ./lost+found 556G ./11KUROSHIOMANI 337G ./11BORDES 625G ./11TRANSTEK 1,5T
Monitor users
List potentially connected users
ps faux | cut -f 1 -d ' ' | sort | uniq