Unix

 
Comandos
Ficheros, scripts y directorios
Editor vi
Procesos
Shell's & Basics
device naming 
SAM
Application variables
Shell programing notes
Notes

Ficheros y directorios:

  • Script para borrar impresoras, en /usr/osit/etc/ ejecutar ./remote_printer.add.
  • Fichero /etc/resolv.conf to find out the IP (IP-Range) or domains using DNS,  si hay no está se puede poner directamente una dirección IP en /etc/hosts
  • Para ver el número de procesos que deben ejecutarse en un determinado sistema SAP-Unix ver el fichero proc_tab.sap, que estará en el directorio /usr/osit/etc obsoleto o en /var/opt/OV/conf/OpC/ps_mon.cfg. (Aquí también están los ficheros de configuracion de threshold por ejemplo).
  • Para lanzar un proceso que debería estar corriendo, entrar con superusuario <sid>sap. Ejecutar el proceso nohup <proceso> pf=<profile>, los profiles deberán estar en /usr/sap/<SID>/SYS/profile.
  • .cshr Personal profile for C shell.
  • .kshrc Posix and Kron shells profile using ENV variable.
  • .login Personal profile file.
  • .profile Personal profile file.
  • /etc./skel Prototypes of startup files for users.
  • /etc/copyright Copyright file displayed at the session start.
  • /etc/csh.login Global profile for C Shell.
  • /etc/default/fs Default file system to be create when used newfs.
  • /etc/fstab files systems to be mounted in the startup or using mountall.
  • /etc/group Groups file. An user can be placed in multiple groups. (groupname:password:groupID:grouplist)
  • /etc/inittab initialization file to define the environment.
  • /etc/ioconfig & /stand/ioconfig store the information about device for rebooting.
  • /etc/issue Information displayed before every login.
  • /etc/logingroup Uses to check if an user can access to one file associated to a different group that is currently identified.
  • /etc/lp/class Printer classes directory.
  • /etc/lvmtab LVM configuration.
  • /etc/motd Information displayed at when the users logs on.
  • /etc/mnttab Mount file system table.
  • /etc/passwd passwords file. (username:password:userID:groupID:Info display by finger:home directory:shell) permissions -r---r---r---.
  • /etc/profile Global profile for all users
  • /etc/services OS services running in the Unix system.
  • /etc/ttytype To map the terminal types.
  • /stand/system Kernel features.
  • /usr/lib/terminfo Terminal information.
  • /usr/sbin/dmesg To see system configuration by hardware path and device driver.
  • /usr/sbin/grpchk check the groups.
  • /usr/sbin/ioscan [-d driver] [-C class] [-f] System configuration by type and class of module, hardware path, and hardware status.
  • /usr/sbin/pwck Check the passwords.
  • /usr/sbin/vipw to edit the file passwd without simultaneous access.
  • system & application
  • /dev All the terminal, modem, and printer device files.
  • /dev/ac Block magneto optical devices.
  • /dev/dsk Block devices for sections and LVM disks.
  • /dev/null Data written on a null special file is discarded.
  • /dev/pty Slave pseudo terminal devices.
  • /dev/ptym Master pseudo terminal devices.
  • /dev/rac Character magneto optical devices.
  • /dev/rdsk All the character devices for disk an LVM disks.
  • /dev/rmt Character device filesfor 1/2 - inch reel and DDS tape.
  • /dev/vgn Directory for volume groups.
  • /dev/vgn/lovl n All the block devices for logical volumes in a volume group.
  • /dev/vgn/rlovl n All the character devices files for logical volumes in volume group.
  • /etc System configuration files. No longer executables.
  • /etc/lp/interface Interface programs used on the system for determinades printers.
  • /etc/lp/member lists all configured printers.
  • /etc/syslog.conf
  • /home Directorio inicial para cada usuario, está contenido en la variable HOME.
  • /mnt Usado para montar otro tipo de dispositivos, como Cd-rom p.e.
  • /opt Contiene aplicaciones y productos.
  • /sbin Comandos esenciales para la parada y arranque de Unix.
  • /stand Almacena el kernel del sistema operativo.
  • /tmp Directorio temporal, cualquier fichero que esté aqui puede ser borrado en cualquier momento.
  • /usr Sharable operating systems commands, libraries, and documentation.
  • /usr/bin Contiene los programa básicos de Unix, son los que aparecen en el manual 1.
  • /usr/conf Kernel configuration.
  • /usr/contrib Contributed software.
  • /usr/contrib/bin Contiene programas públicos y utilidades, generalmente provenientes de bulletin board o user group.
  • /usr/osit/etc/bdf.tab Contens the threshold limits.
  • /usr/lbin Backens to others commands.
  • /usr/lib Contiene las librerias y archivos compartidos por las aplicaciones.
  • /usr/lib/lp/model in this directory are the scripts for all specific printers, the scripts is copied to /etc/lp/interface and renamed to match the name of the printer.
  • /usr/local User contributed software.
  • /usr/local/bin Usualmente contiene p rogramas y utilidades.
  • /usr/local/domain DNS distribution and tools.
  • /usr/newconfig Default configuration files.
  • /usr/sbin basics system administration commands. Manual 1 m.
  • /usr/share Architecture independent sharable files. (man pages are pretty important)
  • /usr/share/doc Información técnica.
  • /usr/share/doc White papers and technical topics.
  • /usr/share/man Ficheros asociados al manual online.
  • /usr/share/man Man pages.
  • /var Dynamic information such logs and spoolers files.
  • /var/adm Administrative files and log files.
  • /var/adm/btmp History of unsuccessful logs, use lastb command to display this information.(logs unsuccessful login attemps)
  • /var/adm/crash Kernel crash dumps.
  • /var/adm/cron Log files used by cron.
  • /var/adm/cron/log Logs of the jobs scheduled. Grows very fast, should be checked periodically.
  • /var/adm/sulog History of switching user (su).
  • /var/adm/sw Used for log files maintained by the software Distributor.
  • /var/adm/sw/.codewords software codewords file
  • /var/adm/sw/patch used for patch instalation.
  • /var/adm/sw/swinstall.log installations software logs.
  • /var/adm/syslog System logs files. Syslogd daemon associated. This daemon is configured in
  • /var/adm/utmp Records of all users in the system. Used by write and who.
  • /var/adm/wtmp History of successfully log.
  • /var/adm/wtmp logs successful login attemps
  • /var/lib/lp/fonts Fonts for laserprinters.
  • /var/mail Incoming mail.
  • /var/news Contiene los ficheros de las news del sistema
  • /var/opt Application-specific runtime files. Each application has its own directory.
  • /var/spool Spool files used for lp, cron.
  • /var/spool/cron/contrabs Contains all the files from the users who have any cron job scheduled.
  • /var/spool/lp lp spooler parent directory.
  • /var/spool/lp/cinterface Interface directories for remote printers.
  • /var/spool/lp/FIFO Internally used by the print scheduler.
  • /var/spool/lp/request Queues of the printers.
  • /var/spool/lp/SCHEDLOCK with this file one lpsched is running at once.
  • /var/spool/lp/sinterface. Interface directories for remote printers.
  • /var/tmp Directorio usado para añadir espacio de disco a los usuarios.
  • lost+found lost and founds files in one file system
  • /etc/opt/application Host specific configuration files.
  • /opt/applicaton/bin User commands.
  • /opt/applicaton/lbin Back en commands
  • /opt/applicaton/lib Libraries
  • /opt/applicaton/newconfig Master copies of configuration files.
  • /opt/applicaton/share/man Man pages
  • /var/opt/application Host specific log files.
  • Principio

    Procesos:

  • El proceso named debe estar ejecutandose en el servidor que actue como DNS.
  • Principio

    Omniback:

    Principio
     

    Otras notas:

    Principio

    Shell's & Basics

    /usr/bin/csh california o C Shell
    /usr/old/bin/sh Bourne Shell
    /usr/bin/sh Standard POSIX Shell
    /usr/bin/ksh Korn Shell
    /usr/bin/keysh Key sentive Shell
    /usr/bin/rksh Restricted Kron Shell
    /usr/bin/rsh Restricted Bourne Shell
     These restricted shell are not allowed to: Changing directories, changing PATH and SHELL variables, using a command that has / anywhere in its name, using I/O redirection, executing programs with exec. If the .profile script is interrupt the user is logg off automatically.

    Programas que vienen normalmente con Unix
    Mail Mail, Mailx.
    Edición de ficheros ed, ex, vi.
    Procesamiento de textos sort, grep, wc, awk, sed.
    Formateo de texto nroff.
    Desarrollo de programas cc, make, lint, lex.
    Comunicaciones uucp.
    Administración de usuarios ps, du, acctcom.
    Principio

    Naming conventions for device files

    Principio

    Sam

    Program sam: (HP-UX)
    sam visual configuration. export [setenv C shell] DISPLAY = hostname : 0.0.
    Remote use sam -display w:0.0 or export DISPLAY = ws : 0.0.
    Log file samlog.
    sam -r to give rigths to others users. /etc/sam/custom/user.cf Configuration file for user. For groups finish in .gp.

    Principio

    Application variables

    /etc/MANPATH Location of man pages.
    /etc/PATH Location of commands
    /etc/SHLIB_PATH Location of shared libraries.

    Principio

    Shell programing notes

    The arguments are refering as $0 the file name, and $1, $2 the first, the second and so on.
    $# -> The number of the arguments.
    $*-> The complete argumente list.


    shift [n] Shifts all strings in * n positions.
    read variable [variable] Read one variable from the input.
    Echo characters:

    \a Alert character.
    \b Backspace.
    \c Suppresses the terminating newline.
    \f Fromfeed.
    \n Newline.
    \r Carriage return.
    \t Tab character.
    \\ Backslash.
    \nnn ASCII char code nnn.


    Shells functions:
    Function funct_name {code} or
    funct_name ( ) {code}

    The comments are preceded by #.
    To specify a designated shell to run one script must be written in the first line: #!/usr/bin/shell_name
    Test expression Test one expression and return 0 for TRUE and non-zero for FALSE.
    Numeric test

    -lt less than
    -le less or equal
    -gt greater than
    -ge greater or equal
    -eq equal (= for strings)
    -ne not equal (!= for strings)
    String test
    String1 = String2 Equal.
    String1 =! String2 Not equal.
    -z String String not zero.
    -n String String not zero
    String String not zero.
    File test

    Text [-fds] filename Is a file f, is a directory d, if exists and have a greater size than zero s, if is readable r, if is writeable w, if is executable x

    Operators

    -o Or
    -a And
    ! not
    \( \) Grouping


    Exiting

    exit [arg] Finish the program and return arg.
    return [arg] Finish the block, funtion or program and return arg.


    Branches

     
    if
    List A
    then
    List B
    [else
    List C]
    fi

    case word in
    Pattern1) list A
    ;;
    Pattern1) list B
    ;;
    PatternN) list N
    ;;
    *) //otherwise
    ;;


    esac

    . *Match any character, ? mach single character and [?] any character between brackets. Loops
    while ? do .. done
    util ? do .. done
    for ? do ? done


    let expression to designate numerical variables.
    Break [n] Terminates de iteration and skip the commands until the nth iteration is done.
    Continue [n] Continues with the nth next iteration.
    Trap 'cmds' Captures the signal sending to the program.

    Principio

    Notes (Transition Links / Files type / Quoting & Redirection / Environment variables / Tricks / LAN services / File systems / Install a new disk / Patches / Troubleshooting )


    Principio


    © Web diseñado por Jesús Javier Olea Ros 1