User Tools

Site Tools


Basic Usage

Top: Frida handbook
Up: Tutorial
Next: Simple manipulations

This is the first session of the Frida tutorial. We will familiarize ourselves with the command-line interface. We will read a few demo files from disk, and inspect their contents. Then we will learn how to plot.

Load a file into Frida's memory

Download and unpack the test data, as described in the introduction to the tutorial. Launch Frida in the directory that contains the test data set, and perform the following actions one by one. Take your time to understand Frida's reaction to each single command.

command action
> h help: print program version, explain one-letter commands, list initials of other commands
> fl gly??? file-load: load given data files, using bash pattern expansion
0:4 >

At this point, the prompt has changed. It indicates that the next command will operate by default on the internal files numbered 0-4. These are of course the five files we have just read from disk.

Inspect files

We continue the session.

0:4 > d list all commands starting with d
0:4 > df directory-files: list the files in Frida's internal memory
0:4 > dr directory-rpar: list sample temperatures (one real number per file, called rpar)
0:4 > 0 change default, next command will operate on file 0
0 > (ok, the prompt has changed)
0 > dd directory-doc: show the file history (right now rather short)
0 > 1 dd same for file 1 (we could also enter “1” and “dd” as separate commands)
1 > dc directory-coordinates: explain the meaning of x, y, z0

In this example, the fundamental tabular structure y(x,z0) is filled with a neutron scattering law S(E,q). The energy E is variable x, and the wavenumber q is variable z0 (in a more complex data set, we could also have z1, z2, …). Functional values S are represented by variable y.

1 > dz display-z: for each spectrum, show z entries and the x range

In this example, we have fourteen wavenumbers q, and for each q we have a spectrum S(w) extending from -14 to 14 ueV and consisting of 351 data triples x-y-dy (dy is the standard error of y).

Plot spectra

File 0, gly180, is basically the instrumental resolution function. We will use it as our first example for plotting.

1 > 0 p 0 plot spectrum number 0 of file 1
(use the mouse or Ctrl-Space to come back to the dialog terminal)
0 > a 1 add spectrum 1
0 > a 2 add spectrum 2 (the elastic peak will be cut, the y scale is inappropriate)
0 > ga graphic autorange (let plot range be determined by next plot data)
0 > p 0:2 (now all data fit into the plot range)
0 > pr 5:9 plot with new autoranges (shorthand for ga and p)
0 > pr : plot all spectra of file 0
0 > gx -5 5 set x range
0 > p :
0 > gya reset y range so that it will be redetermined for the next plot
0 > 4 p : plot all spectra of file 4
0 > gy 0 40 set y range
0 > 0:4 p 6 plot spectrum 6 for all files
0:4 > g list graphics commands
0:4 > gw list graphic windows (active window is marked by *)
0:4 > g2 goto graphic window 2 (linear in x, logarithmic in y)
0:4 > p 6 plot spectrum 6
0:4 > gp replot current image into a postscript file
0:4 > quit terminate the Frida session

Last updated for Frida2.3.0c.