184
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 22 Feb 2026
184 points (98.9% liked)
Linux
62524 readers
669 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
That's great! Here's a few tips to take it a bit further; the world is your oyster!
Open your .bashrc file (e.g. /home/yourusername/.bashrc) and add the following:
alias get="/path/to/your/bash/file"Now open a terminal and type get, and it'll launch the script. No clicking needed, it'll run anytime from any terminal!
And if you do use the alias then you can use another refinement, you can drop the echo: instead of $a, you can use $1 and remove the echo & read as you no longer need them:
#! /usr/bin/bash yt-dlp -x $1Now for example you can type in a terminal:
get http://url.to.video/And yt-dlp will do it's stuff. $1 passes the first parameter after starting the script as a variable to it.
You can use the keyboard shortcut Control+shift+v to paste a URL into the terminal, no mouse needed; just remember to add a space after typing get
The op script is meant to be opened in the GUI in a terminal then the URL gets pasted in there. It took me a second to see it.
What does your ~/.bashrc look like? My last change was modifying a
playlistcommandspoiler: I explain my last change to my ~/.bashrc file
or
or just from any directory with files
And then takes all the videos found at the url or at the path (including within folders), adds them to a playlist, shuffles them, and plays them from mpv.
other functions and aliases in my ~/.bashrc
I wonder if we have the same resize.sh
The version I have was copied from stackoverflow. It doesn't work very well, it makes a rough estimate to get the video file size under the set value. As an example
Which then resizes the video to 10 megabytes if possible.
resize.sh code
I'll probably replace it eventually.
Definitely not the same lol
Mine uses ffmpeg to change the resolution, it doesn't so much care about file sizes.
It could be a one-liner if you only ever feed it a single file to manipulate..
I might add one for scaling. I just don't use it as frequently as trying to meet a file size limit. The scaling is also much easier to remember
It does get complicated though, when scaling many videos and images, I've used something like the following in the past
Those were the only two that showed up when I typed
history | grep scale.after commenting, I also added a new video file resizer.
It works significantly better than the one I previously posted. It's also copied from stackoverflow.