I made an alias for youtube-dl with some options like that

yd="youtube-dl -cit -f 18"

so I can download it like

yd URL

I want to modify it to show only the two lines from the output using

grep -e "Downloading video #" -e ETA

I can make it in two aliases using the |

but is there a way to make it one alias

  • unclear for me. Explain a bit more. – Avinash Raj May 27 '14 at 7:17
  • need instead of making 2 aliases and use them like ( alias1 URL | alais2 ) need to make it only one alias like alias1 URL – Fat Mind May 27 '14 at 7:32

You might need to make a function since an alias does not support providing parameters directly.

Open your ~/.bashrc file and enter the following:

function yd() {
    youtube-dl -cit -f 18 $1 | grep -e "Downloading video #" -e ETA

and then source your ~/.bashrc file using:

source ~/.bashrc

and then you should be able to use yd URL to get the desired result.

| improve this answer | |
  • 1
    @Jobin yes it works this time , thanks for the help – Fat Mind May 27 '14 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.