Episode: 185 Title: HPR0185: 3 tips Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0185/hpr0185.mp3 Transcribed: 2025-10-07 13:10:02 --- Music Today I'm going to be talking about three utilities that I use on a regular basis on the command line, nor just speed up some of the things that I do. First one is literally speeding up things. I used to speed up the podcast that I download, and I used the SOX command. The SOX is the Swiss Army Knife of command line audio conversion, and after Bash Potter runs I run a script to look for MP3s and Aug files and convert them so that the speed is increased by 1.5, but people don't end up speeding like chipbunks. The downside of doing this, of course, is that podcasts that showcase independent music like TLL, TS, lot of Linux links and source junk. You're going to have to keep the original of those podcasts around so that you can listen to that music. Now, the SOX command, typically what you do is you use this for conversion, converting a file, so you might use SOX-based input.mp3, based output.org, and simply go and convert the input MP3 file into an Aug format. If you tag on the keyword tempo to the end of that, SOX-based input.mp3, space-output.org, space-tempo, space-1.5, or whatever you want to speed it up by, then that will go and process the file, and it will speed up the text without increasing the pitch. It takes a little while you could use it, but it does allow you to get a lot more podcasts listening into your day. Another thing that you might find yourself doing from time to time is using the opa-al-key to impressing enter to repeat the same command over and over again, so you might do this, for example, if you're doing a FTP from a location and you've seen the file increase or you're copying one file to another, or you simply, I don't know, you run a 90 particular command and you want to see the output over and over again. What I do from time to time is put back command into an infinite loop, and then use the sleep command, which will pause the process for a number of seconds, and that will reroll the command again. So let's take an example of using the LS command here. You would use, you would type the command, while space, open-square bracket, space, double quotes, x, double quotes, space, equals, double quotes, x again, double quotes, space, slow square bracket, semicolon, do, space, LS, space, minus AL, and then the name of the file you're trying to monitor, semicolon, sleep, space, five, semicolon, done, and when you enter that, it'll check to see if x is equal to x, and surprise, surprise, it is, you run your LS command on the file that you're monitoring, it'll wait for five seconds and it'll do it again, it'll print those off nicely and online. What you could always do, if you just want it on the top of the screen, is first put in a clear, and use the clear command, which will clear the screen, and then semicolon, and then LS, space, minus AL, space, sleep, and the rest of that. So that's that tip. Another thing I do from time to time is, you know, back up your home directory, for instance, now you can use this by using the tar command, so tar, space, minus C for create, V for verbose, and F for the file name, space, and then the file name, and then you copy it over where you were to where you went on tar, and then you go tar, space, minus x for extract, V for verbose, and F for file name, and then the name of the file again. Now you can do this in one line, so this is kind of handy when you want to copy, say, your home there to another partition, but you want to preserve the permissions and symbolic links, and that sort of thing. So what you can do is type tar, space, minus C, F, space, and the minus sign again, which means send the tar instead of to a file, send to standard input, space, and the dot, which means this directory, and then you fire it off to a pipe, and then the other side of the pipe you type, open bracket or parentheses, and then CD, space, and then the directory where you want to put it, so slash media slash backup disk, and then semicolon, and then tar, space, minus x, V, F, space, and the minus sign again, to take the tar extract from the standard input, and then close that with the closing parentheses. And that is a nice way to backup files from one location to another without those information. And it's also handy if you're copying files with spaces, or there's any weirdness within the directory structure, that's a tar pretty much as rock solid as far as copying files from one location to the other. Well all these things will be in the show notes of this episode, but I'll probably go into more detail on the blog posting that will accompany this episode on my own website, which is kenfallon.com, and if you have any of these one liners, feel free to do a little podcast about it, because some of these things I've got from colleagues at work, and they really have saved me a lot of time over the last few years, and I hope they do you for you also. Okay, as ever, there'll be somebody else coming to do an episode tomorrow, so until then, thank you very, very good thing. Thank you for listening to Hacquered Public Radio, HPR is sponsored by caro.net, so head on over to C-A-R-O-D-E-T for all of your needs. Hello, is there anyone there? This isn't Dave's house, there are windmills, tulips, and lots and lots of water, I'm scared, so Dave, where have you sent me?