Find the answer to your Linux question:
Results 1 to 3 of 3
##Halooah. Just a quick question: is there any way that I can omit the filename ##from the output of 'find'? EEe.g. I type in: 'find / -name somefile.file -oPtIoNs' and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Location
    Here
    Posts
    3

    Question Pipe output of one command to the end of another


    ##Halooah. Just a quick question: is there any way that I can omit the filename ##from the output of 'find'?
    EEe.g. I type in:
    'find / -name somefile.file -oPtIoNs'
    and the output is:
    /home/enthdegree/Desktop/misc/
    as opposed to:
    /home/enthdegree/Desktop/misc/somefile.file
    I'm writing a backup script for xPud, so I kind of need to be able to do this from the terminal.
    Any help is appreciated. Thanks in advance.

    Scratch that. I found out that I can just use the 'dirname' command.

    Now I seem to have run into another problem; Is there any way I can take the output of one command and, after that command has completed, slap it onto the end of the next command?
    Thanks.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,583
    Quote Originally Posted by enthdegree View Post
    Now I seem to have run into another problem; Is there any way I can take the output of one command and, after that command has completed, slap it onto the end of the next command?
    Thanks.
    Put the command you want to paste the output of inside back-quotes:
    Code:
    do_something `another_cmd`
    This will take the output of another_cmd and pass that to the do_something command. Is that what you were looking for?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jun 2009
    Location
    Here
    Posts
    3

    Smile

    Yes, that seems to be what I was looking for, thanks. But I seem to have found a workaround for my script.
    Still good to know!

Posting Permissions

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