Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 119829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:42:53+00:00 2026-05-11T03:42:53+00:00

The one-liner should: solve a real-world problem not be extensively cryptic (should be easy

  • 0

The one-liner should:

  • solve a real-world problem
  • not be extensively cryptic (should be easy to understand and reproduce)
  • be worth the time it takes to write it (should not be too clever)

I’m looking for practical tips and tricks (complementary examples for perldoc perlrun).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:42:54+00:00Added an answer on May 11, 2026 at 3:42 am

    All one-liners from the answers collected in one place:

    • perl -pe's/([\d.]+)/localtime $1/e;' access.log

    • ack $(ls t/lib/TestPM/|awk -F'.' '{print $1}'|xargs perl -e 'print join '|' => @ARGV') aggtests/ t -l

    • perl -e'while(<*.avi>) { s/avi$/srt/; rename <*.srt>, $_ }'

    • find . -name '*.whatever' | perl -lne unlink

    • tail -F /var/log/squid/access.log | perl -ane 'BEGIN{$|++} $F[6] =~ m{\Qrad.live.com/ADSAdClient31.dll} && printf '%02d:%02d:%02d %15s %9d\n', sub{reverse @_[0..2]}->(localtime $F[0]), @F[2,4]'

    • export PATH=$(perl -F: -ane'print join q/:/, grep { !$c{$_}++ } @F'<<<$PATH)

    • alias e2d='perl -le \'print scalar(localtime($ARGV[0]));\''

    • perl -ple '$_=eval'

    • perl -00 -ne 'print sort split /^/'

    • perl -pe'1while+s/\t/' 'x(8-pos()%8)/e'

    • tail -f log | perl -ne '$s=time() unless $s; $n=time(); $d=$n-$s; if ($d>=2) { print qq ($. lines in last $d secs, rate ),$./$d,qq(\n); $. =0; $s=$n; }'

    • perl -MFile::Spec -e 'print join(qq(\n),File::Spec->path).qq(\n)'

    See corresponding answers for their descriptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a quick one-liner to call datepart in Sql Server and get back
I want to wrap a Perl one-liner in a batch file. For a (trivial)
I'm sure there's some trivial one-liner with perl, ruby, bash whatever that would let
What's the shortest Perl one-liner that print out the first 9 powers of a
Is there a quick tcpdump one-liner to print out a TCP stream that matches
I´m sure there´s a clever one-liner using the C++ stl generic algorithms for implementing
Using sed what is an one liner to print the first n characters ?
Currently I monitoring a particular file with a simple shell one-liner: filesize=$(ls -lah somefile
Normally it just puts multiline content on a one liner field and adds slightly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.