Middle of the Night
Tags: discuss, learning, linux, terminal
Published: 2019-01-12 10:42:47

---
title: Middle of the Night
published: true
description: What I do when I get tired of sleeping.
tags: discuss, learning, linux, terminal
---

So I woke up in the middle of sleeping because, well I just got tired of sleeping (yes tired of being tired) and I really wanted to do something. I decided to hop on my computer, hopeing this bug that has been bothering me does not continue (it does...). The computer resumes from sleep/suspension/hibernation with a black screen and mouse cursor. Restarting the computer appears to be the only solution, which is fine I suppose as I have made it a habit to save everything due to this problem. After giving up looking for a fix I'm really just tired of technical bugs like these and I'm half-convinced it's Ubuntus' fault. Knowing I should expand my horizon to other distros I begin researching them.

Shortly after beginning my search my option are mainly Arch, Mint, or something obscure like Debian. I'm thinking if I'm starting fresh I want to challenge myself more moving closing to those dseveloper roots, plush a lightweight system is a plus; As if I wasn't already dealing with enough technical issues. I went to '/media' to my drives to find out where I can backup my stuff to, but I wanted to know how much space I had left? I've been making it a habit to avoid using any graphical display, but I can't ever remember that command (it's `df`).

After finding out how much space I have I think about how nice it would be if I had finished that list of common commands. I have already spent a good many hours a month or two ago writing some sweet aliases. I even started saving my own config files in a separate folder that I've been switching between computers. This has come in handy with my key-binding with EMACS as well. I've just been copying the _master_ config into whatever directory it belongs to update them.

Anyway long story short, I didn't feel a file was the solution, I mean I've half-heartedly started such files while I've been learning and they never go anywhere. A half-finished excel spreadsheet that is more complicated than it needs to be, a half-finished plain text document that has no proper markup/formatting. I wanted my own manual page, or at least a command; I know how to write bash scripts, but something that I can use in the very terminal I am using. That would be handy!

I found a great and short tutorial on [linuxcommand.org](linuxcommand.org) that explained how commands are bash scripts and they are read by the computer within certain directories saved in a `$PATH` super-global like identifier. It contains a single string of directories it searches in, delimited by a colon. Standard practice seems to indicate users put personal scripts under `/home/user/bin`, so I did that and well, I got my first command working!

Now I'm hooked, the other articles discuss using functions instead of aliases which of course can both be utilized in the bash script command. Then it uses the example of generating an HTML page - I have been using EMACS Dired and abbreviations more but still generating an entire HTML boilerplate directory from a terminal function! SIGN ME UP! - for an application and using a _here script/document_ which has something to do with I/O redirection and it's used with the `cat` command instead of `echo` which looks like we can pipe it to some make file command; And the next article looks like it's going to talk about variables which is sweet!

And just now I thought, this is all kinda crazy, I should write about it. Finishing this at 5:20 a.m., this is what I do half-way through my sleep in the middle of the night on a Saturday. Thanks for reading!