Feb
2
TTT Part 15 of n – ‘Plumbing’
Filed Under System Administration, Computers & Tech on February 2, 2014 | 2 Comments
Right back in the very first instalment we described the Unix philosophy as being Lego-like, that is, having lots of simply commands that do one thing well, and then assembling them together to do something really powerful. So far, we’ve only been working with a single command at a time, but that changes with this instalment. We’ll be introducing the concept of streams, which can be used to connect commands and files together.
Jan
11
TTT Part 14 of n – Aliases & Prompts
Filed Under System Administration, Computers & Tech on January 11, 2014 | 1 Comment
In the previous instalment we looked at how to make permanent changes to our environment. We made a permanent change to the PATH
environment variable to demonstrate how it’s done (by editing ~/.bash_profile
on a Mac, or ~/.bashrc
on Linux). In this instalment we’ll look at two other kinds of environment changes you may wish to make by editing these files – specifically, aliases, and custom prompts.
Dec
21
TTT Part 13 of n – PATH
Filed Under Computers & Tech, System Administration on December 21, 2013 | 6 Comments
In the previous instalment we introduced the concept of the command shell environment, and we looked in detail at how shell and environment variables work. In this instalment we’ll focus on probably the single most important environment variable, PATH
. We’ll look at what it does, how it’s initialised, and, in the process, we’ll learn how to make persistent customisations to our shell environment.
Dec
14
TTT Part 12 of n – the Environment
Filed Under System Administration, Computers & Tech on December 14, 2013 | 2 Comments
Given the times we live in, the word ‘environment’ probably invokes images of polar bears and melting ice, but the Al Gore definition of the word ‘environment’ is a relatively recent narrow definition of a much broader word. The first definition of the work in the OS X dictionary is:
The surroundings or conditions in which a person, animal, or plant lives or operates
In this instalment we’ll introduce a digital extension of this concept – the digital conditions within which a process exists, and specifically, in which a BASH command shell exists. Although this might sound like a simple topic, there’s actually a lot to cover, so we’ll be spreading it out over a few instalments.
Nov
22
TTT Part 11 of n – Text Files
Filed Under System Administration, Computers & Tech on November 22, 2013 | 1 Comment
In the next instalment we’ll be moving on to look at the so-called Environment within a command shell, but before we do that we need to lay some ground work. Specifically, we need to learn how to read and edit text files from the command line.
In this instalment we’ll start with the most common commands for reading files, and then move on to look at the simplest of the command line editors. For those interested in learning a little more I’ll also give a very quick overview of one of the more powerful command line editors, but feel free to skip over that section if you like, future instalments won’t assume that knowledge.
Nov
2
TTT Part 10 of n – man
Filed Under System Administration, Computers & Tech on November 2, 2013 | 2 Comments
Like with so many things in tech, it doesn’t matter if you don’t know everything, what matters is that you have the skills to quickly find the information you need when you needed it. Programmers don’t memorise entire APIs, they simply learn how to search them, and how to interpret the results of their searches.
This is an area where the Linux/Unix command line environment really shines. All Linux & Unix distributions, including OS X, have a built-in manual that allows you to quickly find the documentation you need, when you need it. Every command line command/program can add its documentation to the system manual. In fact, each command/program can actually add multiple documents to the manual. Tools that make use of configuration files will often add a separate document to describe the structure of the configuration file for example.
Every built-in command will have an entry in the manual, and any software you install via the standard package management tools for your distribution will almost certainly bundle the related manual entries as part of the package. This is also true on OS X, where package mangers like Mac Ports will also bundle manual pages with the software they install, and even stand-alone .pkg
installers for command line tools will usually also install manual entries. If you run it from the command line, the changes are very high that there will be a manual entry for it on Linux, Unix and OS X.
Oct
6
TTT Part 9 of n – Controlling Processes
Filed Under Computers & Tech on October 6, 2013 | Leave a Comment
In the previous instalment we looked how Unix-like operating systems like Linux and Mac OS X represent processes. We then went on to look at the commands for listing running processes, and filtering and sorting them in various ways. This time we’ll move on to controlling processes, specifically, starting and stopping them.
Sep
21
TTT Part 8 of n – Processes
Filed Under Computers & Tech, System Administration on September 21, 2013 | 6 Comments
For various reasons there’s been a bit of a gap between the previous instalment and this one. A big part of the reason is that I’d been putting off a lot of topics I wanted to talk about on Chit Chat Across the Pond until there was a logical break in this Terminal series. Having finished with the file system at the end of the part 7, I had my logical break point. Now it’s time to get stuck back in though, and start a whole new topic – processes.
We’ll start with a little history for context, then have a look at the model OS X uses to represent processes, and finish by looking at some commands for listing the currently running processes on your system.
Jul
19
TTT Part 7 of n – Managing Files
Filed Under System Administration, Computers & Tech on July 19, 2013 | 1 Comment
So far in this series we’ve focused mostly on the file system, looking at the details of file systems, how to navigate them, and at file permissions and metadata. We’re almost ready to move on and start looking at how processes work in Unix/Linux/OS X, but we have a few more file-related commands to look at before we do. In this instalment we’ll be looking at how to manipulate the file system, in other words, how to create files and folders, how to copy them, how to move them, how to rename them, and finally how to delete them.
Jul
13
TTT Part 6 of n – More File Permissions
Filed Under System Administration, Computers & Tech on July 13, 2013 | 7 Comments
In the previous instalment of this series we had a look at how standard Unix File Permissions worked. We looked at how to understand the permissions on existing files and folders, but not at how to change them. We also mentioned that the standard unix file permissions are now only a sub-set of the file permissions on OS X and Linux (OS X also supports file ACLs, and Linux has SELinux as an optional extra layer of security).
In this instalment we’ll start by biting the bullet and dive into how to alter standard Unix File permissions. This could well turn out to be the most difficult segment in this entire series, regardless of how big n gets, but it is very important, so if you have trouble with it, please don’t give up. After we do all that hard work we’ll end with a simpler topic, reading OS X file ACLs, and OS X extended file attributes. We’ll only be looking at how to read these attributes though, not how to alter them.