UnixTools01

From
Jump to navigation Jump to search

Unix-Tools - Teil 1 (für Anfänger)

Files, Directories, Working Directory

  • ls
  • pwd
  • cd
  • ls -l
  • Die Verzeichnisse . und ..

genauer


Path Names

  • a/b/c relativer Path
  • /a/b/c absoluter Path
  • usage of <TAB> when entering file names in bash
  • ~/..
  • /tmp/../etc/../../bin/../usr
  • /usr/bin/././..

genauer


Basic Shell Commands

  • cat
  • touch
  • rm
  • mkdir
  • rmdir
  • mv

genauer


Using Wildcards to identify files

  • echo Hello World
  • echo *
  • ls *
  • ls *.*
  • ls a*
  • ls *a
  • ls *a*
  • rm /tmp/a*
  • ls /tmp/[a-c]*
  • ls /*/bin/a*

genauer


Editor - Erstellen und Bearbeiten von Text-Dateie n

  • nano
  • alternatives: vi, vim, nedit, emacs

genauer


more basic tools

  • more
  • wc
  • grep
  • tail
  • head
  • find
  • Expert Tipp: grep muster $(find / -name patern -print)

genauer


Getting help

  • grep --help

genauer


Redirection - part 1

redirecting output of a programm to another file

  • ls /bin/a* > file.txt
  • ls > /dev/null

append output to a file

  • ls /bin/b* >> file.txt

let a programm take its input from a file (redirecting input)

  • more < file.txt
  • wc < file.txt

let the output of programm be used as input of another program

  • ls -lisa /bin | more
  • ls -lisa /bin | wc

genauer


Argumente mit Sonderzeichen

  • touch "Good Morning"
  • touch '$*()#!'

genauer


Redirection - part 2

  • ls * 2> /dev/null
  • ls 2>&1 | more
  • << END

genauer


Alias

  • alias ll='ls -lisa'
  • .bashrc (erstes Kennenlernen)

genauer


Spraxche ändern

 export LANG=en_US
 export LANGUAGE=en_US
 export LANG=ru-RU
 export LANGUAGE=ru-RU

genauer