Lernmaterialien

Linux Shell Commands

Basic LINUX/UNIX shell commands

Files and Folders

~home directory

.present working directory

Environment

~/.bash*files that define the environment

Interpreters and Compilers

awk

C-like stream processing language

env

print the environment variables

sed

stream line editor

cd

change directory

export

define and inherit environment variable

bc

arbitrary precision calculator language

pwd

print path to present working dir

set

set or unset shell options

python

MatLab-like programming language

ls

list directory content

whereis

locate commands and manpages

gfortran

GNU FORTRAN-Compiler

mkdir

create a new folder

which

locate commands

gcc

GNU C-Compiler

rmdir

remove an existing folder

alias

define abbreviations for commands

make

compiling and processing utility

rm

remove files and folders

function

more complex abbreviations

 

 

chmod

change file status

 

 

Print commands

chown

change file owner

Job and Process Control

echo

unformatted printout

ln

create link to file or folder

jobs

list of active jobs in a terminal

printf

formatted printout

cp

copy

fg#

get job # to the foreground

 

mv

move

bg#

send job # to the background

Online Help

find

find

CTRL–c

Cancel the job in the foreground

man

display manual page (troff processor)

locate

simple version of find

CTRL-z

Pause the job in the foreground

help

bash command to display help

du

print directory usage (file sizes)

… &

Start a job in the background

info

GNU-related help

df

print file system disk space

top, ps

list of processes on a computer

 

touch

change time stamp of a file

kill #

terminate process #

Commands

 

 

 

history

display cmd buffer

File Content

 

!#

repeat cmd number #

cat

print file content(s) to stdout

Input and Output Redirection

!char

repeat last cmd starting with char

more

print file content page by page

…|…

pipe stdout to the next command

A command is often followed by an argument, and its behavior can be refined with options.

The most general syntax is:

command [options] [arguments]

Options typically start with (occasionally +), e.g., ls –a –l folder

Most commands have default arguments, e.g., the default of folder is the present working directory. Most options (especially flags that require no arguments) can be written together

ls –al

less

scroll through file content

> file

redirect stdout to file

cut

cut columns from a file

>> file

append stdout to file

vi, vim

programmers text editor

>& file

redirect stdout and stderr to file

wc

count words (lines, characters...)

2> file

redirect stderr to file

grep

scan files for certain content

( … )

group stdout and stderr

diff

print differences between two files

<<END … END

redirectto stdin

sort

sort lines of files

tee

duplicate stdout and route to file

head

print first lines of a files

 

 

tail

print last lines of a file

Archives

tac

print file content(s) backwards to stdout

tar, gzip , gunzip, bzip2

 

 

SEG-Y Trace Header Format

#Byte positionTypeSEG Y*SU**
1001 - 0044Trace sequence number within linetracl
2005 - 0084Trace sequence number within reeltracr
3009 - 0124Original field record numberfldr
4013 - 0164Trace sequence number within original field recordtracf
5017 - 0204Energy source point numberep
6021 - 0244CDP ensemble numbercdp
7025 - 0284Trace sequence number within CDP ensemblecdpt
8029 - 0302Trace identification code:
-1 = Other
0 = Unknown
1 = seismic data
2 = dead
3 = dummy
4 = time break
5 = uphole
6 = sweep
7 = timing
8 = water break
9 = Near-field gun signature
10 = Far-field gun signature
11 = Seismic pressure sensor
12 = Multicomponent seismic sensor - Vertical component
13 = Multicomponent seismic sensor - Cross-line component
14 = Multicomponent seismic sensor - In-line component
15 = Rotated multicomponent seismic sensor - Vertical component
16 = Rotated multicomponent seismic sensor - Transverse component
17 = Rotated multicomponent seismic sensor - Radial component
18 = Vibrator reaction mass
19 = Vibrator baseplate
20 = Vibrator estimated ground force
21 = Vibrator reference
22 = Time-velocity pairs
23+ = optional use
(SU: 111 = complex FD, i.e. alternating samples of real and imag,
116 = real, 117 = imag, 118 = amp, 119 = phase)
trid
9031 - 0322Number of vertically summed traces yielding this tracenvs
10033 - 0342Number of horizontally stacked traces yielding this tracenhs
11035 - 0362Data use (1 = production, 2 = test)duse
12037 - 0404Distance from source point to receiver groupoffset
13041 - 0444Receiver group elevationgelev
14045 - 0484Surface elevation at sourceselev
15049 - 0524Source depth below surfacesdepth
16053 - 0564Datum elevation at receiver groupgdel
17057 - 0604Datum elevation at sourcesdel
18061 - 0644Water depth at sourceswdep
19065 - 0684Water depth at receiver groupgwdep
20069 - 0702Scalar for elevations and depths (+ = multiplier, - = divisor)scalel
21071 - 0722Scalar for coordinates (+ = multiplier, - = divisor)scalco
22073 - 0764X source coordinatesx
23077 - 0804Y source coordinatesy
24081 - 0844X receiver group coordinategx
25085 - 0884Y receiver group coordinategy
26089 - 0902Coordinate units
1 = Length in meters or feet
2 = arc seconds
3 = decimal degrees
4 = degrees, minutes, seconds
counit
27091 - 0922Weathering velocitywevel
28093 - 0942Subweathering velocityswevel
29095 - 0962Uphole time at sourcesut
30097 - 0982Uphole time at receiver groupgut
31099 - 1002Source static correctionsstat
32101 - 1022Receiver group static correctiongstat
33103 - 1042Total static appliedtstat
34105 - 1062Lag time between end of header and time break in millisecondslaga
35107 - 1082Lag time between time break and shot in millisecondslagb
36109 - 1102Lag time between shot and recording start in millisecondsdelrt
37111 - 1122Start of mute timemuts
38113 - 1142End of mute timemute
39115 - 1162Number of samples in this tracens
40117 - 1182Sample interval of this trace in microsecondsdt
41119 - 1202Field instrument gain type code:
1 = fixed
2 = binary
3 = floating point
4+ = optional use
gain
42121 - 1222Instrument gain constantigc
43123 - 1242Intrument early gain in decibelsigi
44125 - 1262Correlated (1 = no, 2 = yes)corr
45127 - 1282Sweep frequency at startsfs
46129 - 1302Sweep fequency at endsfe
47131 - 1322Sweep length in millisecondsslen
48133 - 1342Sweep type code:
1 = linear
2 = parabolic
3 = exponential
4 = other
styp
49135 - 1362Sweep taper trace length at start in millisecondsstas
50137 - 1382Sweep taper trace length at end in millisecondsstae
51139 - 1402Taper type code:
1 = linear
2 = cosine squared
3 = other
tatyp
52141 - 1422Alias filter frequencyafilf
53143 - 1442Alias filter slopeafils
54145 - 1462Notch filter frequencynofilf
55147 - 1482Notch filter slopenofils
56149 - 1502Low cut frequencylcf
57151 - 1522High cut frequencyhcf
58153 - 1542Low cut slopelcs
59155 - 1562High cut slopehcs
60157 - 1582Year data recordedyear
61159 - 1602Day of yearday
62161 - 1622Hour of day (24-hour clock)hour
63163 - 1642Minute of hourmin
64165 - 1662Second of minutesec
65167 - 1682Time basis (1 = local, 2 = GMT, 3 = other)timbas
66169 - 1702Trace weighting factor for fixed-point format datatrwf
67171 - 1722Geophone group number of roll switch position onegrnors
68173 - 1742Geophone group number of first trace of original field recordgrnofr
69175 - 1762Geophone group number of last trace of original field recordgrnlof
70177 - 1782Gap size (total number of groups dropped)gaps
71179 - 1802Overtravel associated with taper (1 = down/behind, 2 = up/ahead)otrav
72181 - 1844X cdp coordinated1
73185 - 1884Y cdp coordinatef1
74189 - 1924In-line numberd2
75193 - 1964Cross-line numberf2
76197 - 2004SP numberungpow
77201 - 2044 unscale
78205 - 2062 mark
79207 - 2082 mutb
80209 - 2124 dz
81213 - 2164 fz
82217 - 2182 n2
83219 - 2202 shortpad
84221 - 2244 ntr
77201 - 2022SP number scalar (applies to #76) 
78203 - 2042Trace value measurement unit:
-1 = Other (should be described in Data Sample Measurement Units Stanza)
0 = Unknown
1 = Pascal (Pa)
2 = Volts (V)
3 = Millivolts (mV)
4 = Amperes (A)
5 = Meters (m)
6 = Meters per second (m/s)
7 = Meters per second squared (m/s2)
8 = Newton (N)
9 = Watt (W)
 
79205 - 2106Transduction constant 
80211 - 2122Transduction Units
-1 = Other
0 = Unknown
1 = Pascal (Pa)
2 = Volts (V)
3 = Millivolts (mV)
4 = Amperes (A)
5 = Meters (m)
6 = Meters per second (m/s)
7 = Meters per second squared (m/s2)
8 = Newton (N)
9 = Watt (W)
 
81213 - 2142Device Identifier 
82215 - 2162Scalar for times and statics (applies to #29-39) 
83217 - 2182Source Type/Orientation
-1 = Other
0 = Unknown1 = Vibratory - Vertical orientation
2 = Vibratory - Cross-line orientation
3 = Vibratory - In-line orientation
4 = Impulsive - Vertical orientation
5 = Impulsive - Cross-line orientation
6 = Impulsive - In-line orientation
7 = Distributed Impulsive - Vertical orientation
8 = Distributed Impulsive - Cross-line orientation
9 = Distributed Impulsive - In-line orientation
 
84219 - 2246Source Energy Direction 
85225 - 2306Source Measurement 
86231 - 2322Source Measurement Unit
-1 = Other
0 = Unknown
1 = Joule (J)
2 = Kilowatt (kW)
3 = Pascal (Pa)
4 = Bar (Bar)
4 = Bar-meter (Bar-m)
5 = Newton (N)
6 = Kilograms (kg)
 
87233 - 2406unassigned - for optional information 

*The SEG Y trace header length is 240 bytes. The original SEG Y definition (rev 0) leaves the trace header positions 181-240 unformatted and unassigned for optional storage of information (Barry et al., 1975, Recommended Standards for Digital Tape Formats, Geophysics 40(2), 344-352). A revision to this standard extended the assigned header, leaving only bytes 233-240 for optional information (SEG Technical Standards Committee, 2002, SEG Y rev 1 Data Exchange format, Technical Standard Report, 45 pp).
Revision 1 also extended the reel/file header to previously unassigned positions. In the new standard, the byte positions 3501-3506 are used to store information about the format (rev 0 or 1), variable trace length (not permitted in rev 0), and the number of extended textual file headers (non-existent in rev 0). Note that the new interpretation may result in backward incompatibility.
**Header Mapping to Seismic Unix. Beyond byte position 180 the interpretation between SEG Y and SU differs (grey). This may lead to problems in SU, which can be avoided using segyclean to erase the header positions 181-210.