unix basics

file and directory
mkdir: create new directory
rm: remove directory; eg rm -r .f*
mv: move file or directory – also to rename files or dirs
pwd: print working directory
scp: securecopy files between computers; eg scp myfile1.txt user1@server1:/home/user1/workingdir

textfiles
cat: program used to concatenate and display files
head: first 10 lines of a file; eg: head my.file
tail: last 10 lines of a file
split: to split a textfile by lines, bytes, etc. (WARNING, bytes splits lines!! 🙂
wc: wordcount, linecount etc. (eg. wc -l file – count lines of the file)
grep: find text in files eg:

  • grep „^1554;“ file – find all lines beginning with 1554;
  • grep „^1554;.*;W;.*“ file – find lines beginning with 1554; and also containing ;W;
  • grep „^1554;.*;W;.*“ file | wc -l – count found lines

file: displays MIME-type (eg. file -bi )

sed: stream editor for filtering and transforming text; eg. sed ’s/“//g‘ mytxt_new.csv replace digits inside a textfile
links: text manipulation (ibm),

disc-ressources
df: disk free; size and usage of „volumes“; eg: df -h
du: disk usage; size of directories und subdirs; eg du –max-depth=1
free: shows memory usage eg: free -m
uname: system infos eg uname -a for all fields
mpstat: Report processors related statistics eg mpstat 5 (summary every 5 sec infinitely)

general
nohup: no hang-up – Run a Script after Logout

* * * Using sh-scripts: it is very important to use the UNIX-text format – use dos2unix to convert the text-file to the correct format!!!

Advertisements

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s