All 2 entries tagged Linux
July 15, 2010
Say you are on a network computer and wish to know the system specs. You can use:
Which will return you information about the CPU and memory in the system. There are more files in /proc which will give you information.
Searching for number of instances of a string in a file:
e.g. grep 'Y =' *log|wc (to search for the string 'Y =' in all files ending with log. wc gives word count)
Clearing a file. Recall the standard output operator. Now use:
cat /dev/null > test2.log
July 13, 2010
From Dr Nichols on script files:
Make a script file, .sh
must begin "#!/bin/bash"
Give it execute permissions
chmod +x test.sh (Important! If not script will not run!)
and be sure to re-direct all output to a log file
Then when you run the script, put it in the background
Here is my test.sh file
matlab -nojvm -nodisplay < doit.m > test2.log 2>&1
Also, how to start up matlab and add path to matlab every login
Edit ./.bashrc, using say, emacs i.e. at the prompt type "emacs ./.bashrc"
Add the following lines:
module add matlab
for example, given that I put the spm8 files into /home/spm8/
Useful commands to view log files are cat, tail etc.