Add a printer on the command line – cups-pdf example

Posted by & filed under Linux.

Suppose you need to add a printer to a computer on the command line, e.g., a server that you access via a terminal. This post outlines how to use some basic commands from the CUPS system. I will illustrate with commands for a network-connected printer and cups-pdf for printing to PDF files (~/PDF/): sudo lpadmin… Read more »

LPR printing on command line

Posted by & filed under Linux.

These days, with Linux distros such as Ubuntu, printing is quite easy. You can add and remove printers and print files just as easily (or even more so) compared to Windows or Mac. Sometimes I might just want to print from the command line. To do so, I make use of the lpr command. To… Read more »

Split, cut, or sample a video file on the command line

Posted by & filed under Linux.

There are many reasons to cut or split a video file. For example, one may want to cut a long video into multiple parts to upload to YouTube. I first ran into this and this, which suggests: ffmpeg -ss 00:00:00 -t 00:01:00 -vcodec copy -acodec copy -i in.avi out.avi ## -ss: start position ## -t:… Read more »

Burn dvd from the command line

Posted by & filed under Linux.

I recently had to back files from my Ubuntu-based NAS. I initially used xfburn, a medium-weight burning software. It does a pretty good job. However, I decided to burn via the command line to refrain from pointing and clicking. I found dvd+rw-tools. Some simple examples are found here; the full filename solution was found here…. Read more »

(Batch) Amplify audio files from the command line

Posted by & filed under Linux.

Audacity is great, but it’s a GUI and sometimes I just want to do basic things like amplify the sound of some mp3 files. Discovered mp3gain from this thread and wrote this script to batch amplify the files: #! /bin/bash ## http://boards.straightdope.com/sdmb/archive/index.php/t-339352.html gainval=10 for file in “$@” do mp3gain -g $gainval $file done Note that… Read more »

Downloading, cURL vs. wget

Posted by & filed under Linux.

I do more and more downloading using the command line these days, mainly using wget and cURL. This is a good comparison of the two. Both are great at downloading. cURL supports more protocol (outside of http, https, ftp) and is bi-directional. wget can download files recursively (links on a webpage, and links that appear… Read more »