Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Text Editing&Processing > Others

    Trim 1.0

    Download button

    Downloads: 620  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jem Berkes | More programs
    Freeware / FREE
    March 21st, 2006, 18:25 GMT
    ROOT / Text Editing&Processing / Others

     Read user reviews (0)  Refer to a friend  Subscribe

    Trim description

    Trim project removes a number of lines from the beginning of a file.

    Trim project removes a number of lines from the beginning of a file.

    Utility used to monitor and control the sizes of (log) files. Examines a text file to see if its length has exceeded a certain limit; if it has, Trim removes a certain number of lines from the beginning of the file. Ideal for use in crontab.

    Usage: trim filename x y

    If filename's length exceeds x bytes, then as many as
    y lines are removed from the start of the text file. Exit codes:

    0=OK, 1=can't open file, 2=can't create temp, 3=can't write to file,
    255=syntax. Information messages are sent to stdout (1). Error messages to stderr (2).

    I originally wrote the 'trim' utility because I needed something in my
    crontab that would monitor the sizes of growing log files, and trim the
    files when they grew too large.

    trim access_log 1000000 100

    This command will examine access_log to see if its length is greater
    than 1000000 bytes. If the file's length exceeds the limit, then Trim
    will remove 100 lines from the start of the text file.

    If you are running Trim in a script, you may want to suppress normal
    output but keep an eye out for errors. You can accomplish this with:

    trim filename x y 1>null

    This redirects stdout (1) to null, leaving stderr active. You can also
    redirect errors to a file:

    trim filename x y 2>error.log

    Product's homepage

      


    TAGS:

    removes number of lines | text processing | text cleaning | Trim | remove | lines

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM