Is there a way to input values and then run aliases in iterm2 I just came to know about the alias option and I have this code which would download any youtube vid in the highest quality. But the problem is I have to enter the url of the youtube vid.
Is there any way to create alias for it.
I tried alias youtube=&quot;youtube-dl -f best 'link'&quot;
but it takes link as the url since I've not given a variable.
Is there anyway to get an input and save it in the variable link.
aliases are not set by terminal or iTerm they are a part of your shell.
By default in BigSur it is zsh, for most other versions before the default shell was bash
aliases do not take a parameter they just do a text replacement of the alias by the text to the right of the =  If you need to do things with parameters then look at functions in the shell manuals.
As to your case an alias will work as the alias is expanded and then the rest of the command line is passed to it.
A simple example is to get a long list of files
alias ll='ls -l'

Call this by ll ~
and you get the same result as ls -l ~
I think in your case you just need
alias youtube='youtube-dl -f best '

Then type (where link is the URL you want)
youtube link