Find the answer to your Linux question:
Results 1 to 3 of 3
I have this command (line): Code: tail -52 | find "/path/" -name "*.csv" Instead of printing the contents of each file, the command prints the location of each file. What ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    9

    Printing Content of File


    I have this command (line):
    Code:
    tail -52 | find "/path/" -name "*.csv"
    Instead of printing the contents of each file, the command prints the location of each file.
    What am I doing wrong?

  2. #2
    Just Joined!
    Join Date
    Jul 2008
    Posts
    5
    Try using cat with the backtick operator, e.g.:
    Code:
    cat `tail -52 | find "/path/" -name "*.csv"`
    The backtick operator causes the enclosed string to be executed. Then that string is replaced with the output of the command, and the rest of the command line is executed with the replacement. So cat receives a list of file names as arguments, and it prints the contents of each listed file.

  3. #3
    Just Joined!
    Join Date
    Oct 2010
    Posts
    9
    Thanks. It worked . (Well the reverse way: find "/path/" -name "*.csv"`| cat tail -52)

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •