Skip to content

Change Directory, List

When moving around in my terminal, I use two commands in sequence all the time. You’ll know them, they are cd and ls. Change directory, then list the contents of that directory. I decided this was getting annoying. Why is there not a single command to do this? Why not make one? I first thought an alias might work, but then I realised you cannot call an alias, hand it a variable and have it do something after that variable. <alias> <user variable> <second action> is just not possible. ...

The Best Function I Ever Stole

Extracting archives is a pain on Linux. There are just so many types and so many programs to extract each type. A .tar.gz file is extracted using the program GNU tar, but for a .zip file, you’d need unzip. What’s that? You’ve got a .7z file? Yeah-no, can’t use either of the before mentioned extractors, you need 7-zip. Got a .rar, you’d need… well, you get the point. What’s more, some of these programs require flags you’ll need to use to actually extract an archive. For example, to extract a tar file, you might do something like tar xvf <filename>. For a 7z file though, it’d be 7z x <filename>. Other extraction programs don’t require flags at all though, just the name of the extraction program followed by the file to extract. This sounds simple enough, but wait… what was the name of the program to unzip .bz2 files again? ...