Comandos de la terminal/tail

De WikiCabal
< Comandos de la terminal
Revisión del 03:30 5 dic 2013 de Rrc (discusión | contribuciones)
(dif) ← Revisión anterior | Revisión actual (dif) | Revisión siguiente → (dif)
Ir a la navegación Ir a la búsqueda

tail

 tail [OPTION]... [FILE]...

       -c, --bytes=K
              output the last K bytes; alternatively,  use  -c  +K  to  output
              bytes starting with the Kth of each file

       -f, --follow[={name|descriptor}]
              output appended data as the file grows; -f, --follow, and --fol‐
              low=descriptor are equivalent

       -F     same as --follow=name --retry

       -n, --lines=K
              output the last K lines, instead of the last 10; or use -n +K to
              output lines starting with the Kth

       --max-unchanged-stats=N
              with  --follow=name,  reopen  a  FILE which has not changed size
              after N (default 5) iterations to see if it has been unlinked or
              renamed  (this  is  the  usual case of rotated log files).  With
              inotify, this option is rarely useful.

       --pid=PID
              with -f, terminate after process ID, PID dies

       -q, --quiet, --silent
              never output headers giving file names

       --retry
              keep trying to open a file even when it is or becomes inaccessi‐
              ble; useful when following by name, i.e., with --follow=name

       -s, --sleep-interval=N
              with -f, sleep for approximately N seconds (default 1.0) between
              iterations.  With inotify and --pid=P, check process P at  least
              once every N seconds.

       -v, --verbose
              always output headers giving file names

       --help display this help and exit

       --version
              output version information and exit

       If  the  first  character of K (the number of bytes or lines) is a '+',
       print beginning with the Kth item from the start of each  file,  other‐
       wise, print the last K items in the file.  K may have a multiplier suf‐
       fix:  b  512,  kB  1000,  K  1024,  MB  1000*1000,  M   1024*1024,   GB
       1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.

[rrc@pridd ~]$ tail /var/www/almastock.asambiental.mx/index.php 
        else
          print( "<p style=\"text-align:center; margin-top:3px;\">
                    <img src=\"imagenes/asa_logo.png\" alt=\"asa_logo.png\" />
                  </p>" );
        if( isset( $Block ) )
          echo( "$Block" );
      ?>
    </div>
  </body>
</html>

[rrc@pridd ~]$ tail -c 235 /var/www/almastock.asambiental.mx/index.php 
align:center; margin-top:3px;\">
                    <img src=\"imagenes/asa_logo.png\" alt=\"asa_logo.png\" />
                  </p>" );
        if( isset( $Block ) )
          echo( "$Block" );
      ?>
    </div>
  </body>
</html>

[rrc@pridd ~]$ tail -c +11500 /var/www/almastock.asambiental.mx/index.php 
-align:center; margin-top:3px;\">
                    <img src=\"imagenes/asa_logo.png\" alt=\"asa_logo.png\" />
                  </p>" );
        if( isset( $Block ) )
          echo( "$Block" );
      ?>
    </div>
  </body>
</html>

[rrc@pridd ~]$ tail -c +11K /var/www/almastock.asambiental.mx/index.php 
rel="stylesheet" type="text/css" href="includes/Almastock.css" />
  </head>
  <body>
    <div class="content">
      <?php
        if( @$_SESSION{'Nivel'} )
          require( "Menu.php" );
        else
          print( "<p style=\"text-align:center; margin-top:3px;\">
                    <img src=\"imagenes/asa_logo.png\" alt=\"asa_logo.png\" />
                  </p>" );
        if( isset( $Block ) )
          echo( "$Block" );
      ?>
    </div>
  </body>
</html>

[rrc@pridd ~]$ tail -n 5 /var/www/almastock.asambiental.mx/index.php 
          echo( "$Block" );
      ?>
    </div>
  </body>
</html>

[rrc@pridd ~]$ tail -n +360 /var/www/almastock.asambiental.mx/index.php 
        if( isset( $Block ) )
          echo( "$Block" );
      ?>
    </div>
  </body>
</html>

[rrc@pridd ~]$ tail -vn +360 /var/www/almastock.asambiental.mx/index.php 
==> /var/www/almastock.asambiental.mx/index.php <==
        if( isset( $Block ) )
          echo( "$Block" );
      ?>
    </div>
  </body>
</html>

[rrc@pridd ~]$ tail --version
tail (GNU coreutils) 8.20
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
and Jim Meyering.