Learning the Commandline – Looking at files

By now you should know your way around the file system and how to move around (if you don’t, go back and read the other articles. This is a series after all ). You may have wondered, “I have all these files, how do I see what’s inside them in Terminal?” There’s an app for that (sorry, couldn’t resist). Enter the cat command and it’s helpers. We’re also going to learn what a pipe is. cat is *nix for catalog, as in a listing of what’s in a file. ANY …

Read More

Learning the Command Line – Editing files

Terminal — nano — test1-1

In this session we are going to learn one way of editing text files in Terminal. Back in the day there was pico. This was the editor part of the Pine mail program used in *nix. It was a very simple plain text editor used to create mail and text files. There are other editors such as vi, vim and emacs but those can get complicated and very powerful; these aren’t really needed to create or edit a simple text file. Fast forward to today, we now have nano, the …

Read More

Learning the Command Line – Bash Prompts (1)

Terminal — bash — 94×23 2014-03-27 16-38-17 2014-03-27 16-38-20

NOTE: This article assumes you have been following the other articles in this series. Another Note: I can’t take credit for this. I got it from a now defunct website called dotfiles.com. I don’t remember who the original author was and I’ve edited it to suit me. I won’t be explaining every little detail because some are more advanced. If you’ve been keeping up with this series, you’ll know I’ve promised you a little magic. This is it and you might learn a little something too. It’s really simple but …

Read More

Learning the Command Line – Shell Scripts

Terminal commands are great but what if you want to have something done every time you login? What if you need to do something on several files or some other repetitive action and don’t want to type in the commands every time. That could get time consuming and dreary. In this article, we will set up our Terminal environment to make certain things a little easier and get a start on shell scripting. A shell script is a text file with all the commands you want run, one after another. …

Read More

Learning the Command Line – File Permissions

Ever have a file you can’t do anything with? Can’t change it, can’t delete it, can’t even look at it? We’re going to find out why. FreeBSD, and by extension, OS X (which is loosely based on FreeBSD), uses file permissions. This lets the system control access to files and directories by different users. Would you want another user looking at your files? Of course not. Permissions determine who can access any file or directory and whether it can be edited or deleted. There are three types of access for …

Read More

Learning the Command Line – File System

snow

Last time we learned how to list files, now let’s see where those files are. All your files reside on your hard drive, either internal, external or SSD. These drives have files and folders scattered throughout the drive but most are in certain places and are required for the system to function. Moving or deleting certain files or folders can cause your system to malfunction or even not boot. Best practice is if you don’t know what it is, leave it. The beginning of your drive, called the root, is …

Read More

Learning the Command Line – Listing Files

Terminal_—_bash-ls-1

This is the second article in the command line series. The first article by vansmith can be found here: http://www.mac-forums.com/blog/learning-the-command-line-part-one/ This time we will be discussing file management commands. Some of these commands might look strange to you. That’s because most Terminal commands have the vowels and sometimes consonants removed to make the command shorter. For instance the copy command is cp with the o and y removed. Obligatory warning: Please be careful when working on the command line. Most commands will not ask you “Are You Sure?” like a …

Read More