Basic Unix Commands – Introduction

You might be familiar with Unix already but if you aren’t, don’t panic. It is easy to learn the basic unix commands that will get you up and running and navigating around the Mac OS X file system in no time. Of course, one way to navigate your Mac file system is with the Finder. The other way to navigate is with Unix commands and since we will be using both in these tutorials, it will be helpful to know the basics. So here is how to navigate your Mac OS X directories and files with Unix.

Start by opening a TERMINAL window. You can find TERMINAL in Applications->Utilities->Terminal.

Here are the essential commands:

pwd              Print working directory (prints the filepath of the current directory you are in)
ls               List (lists the files in the current directory)
cd xyz           Change directory (navigate into directory xyz which is an available directory)
cd ..            Change to the parent directory
cd ~             Change to the HOME directory
mkdir xyz        Make a new directory called xyz
rmdir xyz        Remove a directory called xyz (to delete all the files in a non empty directory, use rmdir -r)
chmod            Modify permissions
cp file1 file2   Copy a file
mv file1 newname Move or rename a file

That should be enough to get you started for now.

For further reading, here is a link with more basic unix commands

Here is a link for learning unix in 10 minutes

And here is a good introduction to Unix on the mac

1 Comment
Anonymous wrote on 2012-02-10 at 17:32:07:
Link seems to be broken: introduction to Unix on the mac -> http://www.lindsayrgwatt.com/lab/unix.html I get a 503 ...


Post a Comment

(required):