All 2 entries tagged Linux

View all 60 entries tagged Linux on Warwick Blogs | View entries tagged Linux at Technorati | There are no images tagged Linux on this blog

July 15, 2010

Linux tips and tricks (2)

Say you are on a network computer and wish to know the system specs. You can use:

cat /proc/cpuinfo
cat /proc/meminfo

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

Linux tips and tricks

From Dr Nichols on script files:

Make a script file, .sh
must begin "#!/bin/bash"
Give it execute permissions
chmod +x (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 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.

May 2022

Mo Tu We Th Fr Sa Su
Apr |  Today  |
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31               

Search this blog



Most recent comments

  • Thanks a lot! That does seem to work better! by on this entry
  • You don't need to cat /dev/null into a file to empty it, you can just use > For example: me@mine:/tm… by Mike Willis on this entry

Blog archive

RSS2.0 Atom
Not signed in
Sign in

Powered by BlogBuilder