Archive for category Uncategorized

OS X Common Unicode Symbols and How To Type Them

If you don’t have Unicode Hex Keyboard setup in OS X, please see here how to do so. You will learn how to find a symbol your are looking for, or you can use the chart below for some of the most common ones you’ll see throughout the operating system’s menus.

Key

Symbol

Unicode(Hex)

Command

2318

Control

2303

Option

2325

Alt

2387

Shift

21E7

Forward Erase

2326

Delete

232B

Eject

23CF

Return

23CE

Power Button

238B

-

Copyright ©

00A9

-

Trademark ™

2122

-

Registered ®

00AE

-

Euro €

20AC

-

Apple 

F8FF

, , , , , , , , , , ,

1 Comment

Separate Public and Private Wireless Network Using Two Routers

How to create a separate public and private wireless network using 2 routers

Setting up a separate public and private wireless network is not that complicated. It involves basic setup of a router, and its wireless network. In order to create the two separate networks, you set up both routers (R1 and R2), their wireless networks, and plug R2’s WAN port into one of the LAN ports on the back of R1. The networks will essentially be separate, but use a single modem (the same ISP connection for the Internet.)  I created a separate public and private network using this method for a client’s restaurant. The client did not want customers to have access to the private network, yet still wanted to provide a wireless hotspot for patrons.

As far as firmware goes, I recommend using DD-WRT’s firmware and a compatible router, which you can find a list of here: DD-WRT.  Not mandatory by any means, as you should be able to set up separate wireless networks with the stock firmware of just about any router on the market.  By following my setup, you will completely separate the public and private networks, other than access to the private router’s login page from the public network.  Be sure to set a strong password for both routers’ login information, which is mandatory no matter where you’re setting up a network.  If you have a couple of routers on hand and this isn’t clear enough, feel free to shoot me an email describing your setup, and I’ll do the best I can to walk you through that model’s setup screens.

Step 1: First, set up the private router (R1).  I usually do this disconnected from the Internet, by simply plugging an ethernet cable into the switch on the back of the router.  No need to connect to the WAN port yet.  Access your router’s login screen. Login and immediately change the password, make sure it is strong (upper and lowercase letters, at least one number, and a special character or two).

Step 2: Apply your settings, and login using the new password, if necessary.  Next, choose your router name, your IP range (I’m using 10.0.10.x for this setup), and turn on the DHCP server.  You can also set the number of clients, etc.  Set R1′s address to the first addressable host (x.x.x.1) on your IP range, for ease of remembering where it is.  I use 10.0.10.129 for my start range on DHCP because I like to leave a lot open for static IP’s; this allows plenty of room for printers, NAS storage, servers, etc.

Step 3: Next, set up the wireless portion of the R1 ( if you want wireless capability on the private network) This can also be set to “off” should you not require wireless setup.  You absolutely want a very strong passphrase (something like, n0W1rel3$$4U) on your private wireless network (use WPA, not WEP if you can). There’s no sense in going through the trouble of having a second, public router, only to leave your wireless access open.  You can leave the SSID set to broadcast, but this allows people to see the wireless network and attempt to connect.  This shouldn’t be a problem so long as you have a strong password.  Leaving broadcast “off” will not stop someone from finding it if they really want to, however, so the encryption still needs to be on.

Step 4: You can now plug in your WAN port from R1 to your modem, and verify you have access to the internet.  Check your wireless as well, to be sure everything is working as it should.

Step 5: Next, you want to setup your public network on your second router (R2).  Again, leave the router disconnected from the R1, simply plug in your computer to a port on the back of R2 and navigate to its setup screen in your browser.  If you also have a wireless connection (such as setting this up from a laptop) be sure to turn it off for now, as you will not need it.  This is especially true if you used wireless to set up the first router, as it might confuse the network connections and not allow you access to the setup screen on the second router.

Step 6: Set up a new username (if your router allows it) and password, and save your settings.  Next, setup the network address.  If you followed my first router setup and used 10.0.10.x for R1, use 192.0.10.x for R2. Again, set the router’s address to the first addressable host (192.0.10.1).  Turn DHCP on, and setup your maximum clients, and your DHCP range.  You could probably set this to 192.0.10.2 if you don’t need static IPs on the public network.  If you are going to have a public accessible printer, set it to 192.0.10.10, so you can have a few static IPs if you ever need them.

Step 7: Apply your settings, and log back into the R2 by going to the router’s new address in your browser.  It is highly recommended to set the R2′s WAN PORT to STATIC IP and set the address to something R1, outside of the DHCP range. See the screenshot below (click to enlarge).  Basically, I set it up to be the second host on the router’s network, 10.0.10.2.  The gateway will be 10.0.10.1, subnet mask 255.255.255.0.

WAN LAN Setup Screen Public Router

WAN LAN Setup Screen Public Router

Step 8: Apply your settings, and you can now set up the SSID (be sure to pick a name different from the private router) and client type for your public network.  If you want people to be able to access it, leave the encryption off, and broadcast the SSID.  You may want to look into a hotspot server, such as set up a DD-WRT enabled router with Chillispot, but that is out of the scope of this post. To really make this work efficiently, you may want to set the channels of both routers apart (i.e., one to channel 1 and one to channel 11), but you can also leave them on auto.  Another idea might be to have the public network on the 5ghz spectrum, as it would get less interference from surrounding networks and give your clients a better experience.  An Airport Extreme or a TRENDnet TEW-672GR offer dual band functionality, although you sacrifice not being able to run the DD-WRT firmware with either of those.

Step 9: Finally, disconnect your computer from the R2.  Plug R2’s WAN port into one of the switch ports on R1.  You can now use a wireless connection to verify internet connectivity through the public router’s SSID.

Step 10:  You should probably reboot everything at this point.  Power down the modem and both routers. Leave off for 30 seconds, and plug the modem in again.  Allow it to fully boot, then turn on the first router, allow it to fully boot.  Turn on the second router, and you should be good to go.

, , , , , , , ,

2 Comments

Use Two Routers To Separate N and G Wireless Network Clients

[If you'd like to completely separate the G and N clients, set up the two routers to use the different SSIDs, and follow the instructions here for setting the second router to a Static IP from the first router.]

I had this problem, however strange, of a mixed wireless G and N network, where my MacBook Pro would drop its internet connection, or become really slow whenever my wife booted up her Asus Windows laptop.  My assumption was because her laptop was 802.11G, and mine was 802.11N.  I use a DD-WRT equipped Linksys WRT-350N for my home use and didn’t want to switch to G-only wireless.

What I figured I could do is similar to what I’ve done in the past, separate my  wireless network to two different routers.  What I didn’t want, though, is to have a separate network for the connection.  I didn’t know if it would work, but I had a Buffalo router laying around and figured it was worth a shot.

First you set up your router as you normally would, in my case it’s DD-WRT, but this should work on the standard Linksys firmware as well.  I have a cable connection, so my router gets its address via DHCP from Optimum Online.  You are going to want the first router to handle DHCP.  I set the DHCP to the second half of the IP range for the subnet (10.0.10.129), although this really only matters if you want to worry about setting up subnets. I don’t really do anything with subnets either, but I do have both routers, three printers, and a LaCie NAS, all with static IP’s.  This way I don’t have to worry about my setting a static IP in the DHCP range, which could cause problems.

So the first router (the DHCP server) I set to the IP 10.0.10.1, the gateway to 10.0.10.1, and the Local DNS to 10.0.10.1.  This is the first available address in that IP range.  Turn the DHCP on, set the range to 10.0.10.129, and the number of clients to whatever you think you may need (25 to 50 should be fine, if you’re doing this for your house.)

Basic Router Settings--Router 1

Basic Router Settings--Router 1

Next, setup the wireless N network.  Under the Wireless tab, Basic Settings, fill in your SSID.  Wireless mode is AP(access point), Wireless Network Mode will be N only (or G only if this is your G router.)  See screen shot below:

Wireless Settings--Router Connected to Modem

Wireless Settings--Router Connected to Modem

Don’t forget to setup the WPA encryption in the Wireless–> Wireless Security tab.

Next, you will set up the second router to be an access point in tandem with the first router, only to be a N (or G…opposite of whatever you did for router 1) only host.  You want the WAN port set to disable, and you want to set its gateway as 10.0.10.1 (or whatever address you decided on for the first router.)  The IP address for the router, which I set to 10.0.10.127, which would be the last addressable range in that subnet if I decided to set that up. Technically it would be the broadcast address for the .0 address range of the /25 subnet, but that’s why I did it. So I’d remember.  Nevertheless, here are screenshots of the second router, now set up as a regular access point serving G-only clients:

Router 2 Setup

Router 2 Setup

Router 2 Wireless Settings

Router 2 Wireless Settings

The SSID is different, although I did make the WPA key exactly the same.  This way you don’t have to worry about managing people coming over, they get one key for their iPhone, laptop, whatever, and the network hands it an address from the appropriate router.  Seamless.  This has stopped my connection issue, and my link is a consistent 130Mbps (it used to fluctuate wildly from 36Mbps to 78Mbps) on my MacBook Pro. No more dropped connections, either.

Also, for all of your shares it still works, because the actual network is still the same.  Everyone will still be addressed to the 10.0.10.0/24 network.  Meaning, all of your shares still work without issues, even though the wireless clients are on two different SSIDs, they are still connected to the same network.  Beautiful!

No Comments

Letter to Congressman Regarding Net Neutrality

I’ve been entertained lately by Fox news and some other reading on net-neutrality.  So much so, in fact, I felt obliged to write my Congressman John Hall, who is in district 19 here in NY.  The last letter I wrote to him was begging him not to vote for Bush’s money for the banks bill that Congress really had no time to review.  He went ahead and voted for it anyway, which was disappointing.  Alas, I digress.  Here is the letter I sent him:

“It is imperative for the future success of our country that you form stringent opposition to Sen. John McCain’s proposals against net neutrality. Net neutrality is making the infrastructure neutral, meaning data is data no matter who put it on the wire.

Forcing people (or allowing) payment in return for priority on the national grid is absurd, and will only serve to keep and strengthen the basic oligopoly that stands to weaken and destroy our country.
Separating the infrastructure from the content providers is paramount to quality, affordable prices, and universal access to services. It is time we catch up to the rest of the world on this issue. We have gone from 4th to 15th in broadband penetration due to the policies of the last administration, and cannot afford to slip backwards any longer (even though we are still declining.) Please read the Berkman Broadband Study (Harvard University) here: http://www.fcc.gov/stage/pdf/Berkman_Center_Broadband_Study_13Oct09.pdf which was presented to the FCC for a better understanding of what the government policies across the globe have accomplished as compared to ours here in the United States. It is very well researched and makes it very obvious where Mr. McCain gets his money. They spend less, and their country gets more. The trend is not in our favor, and will only get worse if we keep or strengthen the current policies in place today.

Don’t let us down!

I try to stay informed the best I can on this issue, and hopefully when it comes time to vote, we can see some real change.  Here is the response I received from Congressman Hall:

Thank you for contacting me about “net neutrality.”  I appreciate hearing your thoughts on this issue.

Over the last decade, the Internet has grown and evolved at a rapid pace. People now shop online for clothes, cars and even groceries. People can buy music and movies and download them immediately. They can also send photos and home movies to friends and family all over the world.  The development of the Internet has revolutionized the way people communicate, innovate, and do business all over the world.

I believe that much of the Internet’s ability to spur innovation and change is rooted in the ability of individuals to enjoy equal access to a wide array of sites and services.  There is significant concern that this principle, known as “net neutrality,” could be undermined by 2005 decisions by the Federal Communications Commission (FCC)and the U.S. Supreme Court that broadband Internet service is an information service as opposed to a telecommunications service, and therefore not subject to the more stringent regulations that govern telecommunications services.  Specifically, questions have been raised about whether or not telecommunications providers will be able to create a “two-tiered” internet that will allow individuals to connect to provider-owned or favored sites and services more quickly than those run by competitors or small businesses and groups that cannot afford to pay for high-speed preference.

I am concerned that compromising the principle of net neutrality would undermine the fundamental principle of open access that has fueled the growth of the Internet, and could hurt consumer choice, discriminate against sites involved in public discourse or espousing political views, and disadvantage small businesses.

I will be sure to keep your thoughts in mind as Congress considers this issue. Please feel free to contact my office whenever I might be of assistance to you.

What I am particularly concerned with, is this quote:

“the fundamental principle of open access that has fueled the growth of the Internet, and could hurt consumer choice, discriminate against sites involved in public discourse or espousing political views, and disadvantage small businesses.”

The rest of the world has been putting in place legislation that truly affords open access to the backbone, whereas our legislation has not.

If you managed to read this long-winded post (and maybe even that Harvard study linked up top in my letter), tell me what you think.

How do you feel about net neutrality?

, , , , , ,

No Comments

Upgrading Windows Vista to Windows 7

I upgraded my wife’s Asus F3Sv Core2Duo last night from Vista to Windows 7 last night, using the Family Pack Upgrade 32-bit disk.  Upgrading failed at my first attempt, but it rolled back flawlessly and didn’t change anything which was nice.

The reason it failed, essentially the reason I’m writing this post, is because I chose to get the updates to the install disks live online.  Where it failed is in my inability to put 2+2 together.  The upgrade process first scans your current Windows installation and informs you of things that might have problems, in order of priority.  It gives you a scrollable list (quite nice actually) starting with things that will definitely be broken, might have issues, and then finally things that have updates available, even though the latter won’t be a problem when you upgrade.  The really slick thing is the list also gives you the manufacturer’s links to click on so you can go ahead and grab updates on the fly.

Where I dropped the ball, and my installation failed was fairly easy to see.  When you tell Windows to get the updates live before installing, it lets you know that you need to maintain internet connectivity throughout the installation.  I wasn’t plugged in to the ethernet connection when I upgraded, and my Intel Pro/Wireless connection was in need of an upgrade, too.  So the install got about halfway done, dropped the internet connection, and ultimately failed.  I plugged in to ethernet, restarted the installation, and all went nearly flawlessly.

The only other hiccup I had was getting re-established on my home network. For some reason, Windows connected to my router (I Was still wire-connected at this point) and also added a “Public” network, leaving me connected to two separate networks at the same time.  Weird, but it was an easy fix. I just disabled the ethernet adapter and re-enabled it, by clicking on the connection in the “Network and Sharing Center” window.

, , , , , ,

No Comments

iPhone Games Suitable For Young Kids (And Adults Alike)

When I got the iPhone 3G, my daughter was just shy of her second birthday.  My friends and family teased me, asking if she had written any programs on it yet.  I replied, “No, she’s not allowed to touch the iPhone. She already insists on using my Macbook Pro!”  They thought I was kidding, but at the time, she really was navigating around the screen on my laptop.  People have been known to call me a techno-geek, and I suppose they might fear for my little girl’s social acceptance (jokingly, of course), wondering about pocket protectors and GPS tracking when she goes to Pre-K.

I made a promise to my wife that we wouldn’t be the parents whose kid has a $500 phone before she hits Kindergarten, but I may have to bend the rules a bit on that one.  She may not need the phone, but I’m seriously considering getting her an iPod touch for sure.  I have been letting her play with my iPhone basically since she was two years old (and she just turned 3.)  She can now unplug it properly, doesn’t try to dial 911 or some other random number, and actually takes pretty good care to leave it on a table or other acceptable place.  There was definitely a progression to the applications that I downloaded for her to try, and I will review them here, in case you are also blessed with a budding little computer geek of your own.

The first one I ever downloaded for her specifically was TappyTunes.  There are many songs in this app, and you can check out the publisher, Utilitouch, here.  This app is basically a bunch of songs, broken into music snippets. When you tap a tempo on the screen, the song plays.  The faster you tap, the faster the song plays.  The idea is to get it to sound like the song you already know by heart, but for a two-year old, the tempo doesn’t matter much. You can, however, play the song as well, from half speed through double speed.  A nice feature.

The Alphabet Song, for instance, is amazing.  The letters come on the screen as you tap, and they can be “plucked” around the screen, too.  There are a bunch of similar children’s songs, and I’d be willing to say she fell in love with music and my phone because of TappyTunes. Here are some screen shots current as of 10/25/2008:

TappyTunes

TappyTunes

http://utilitouch.com/app/tappytunes/index.html

Categories in TappyTunes

Other Songs

Other Songs

Alphabet Song

Alphabet Song

Another application she was quick to learn and fascinated with is a very, very simple one.  It’s called BubbleWrap and it’s published by Orsome.  There is a Pro version as well, where you can win US $250.00. Here’s a screenshot:

BubbleWrap

BubbleWrap

All-in-all, a good, fun application for kids, and I’m not ashamed at all to say I play it.  Simple, and lots of fun.

If you remember Etch-A-Sketch this next one is similar in looks.  It’s called Pocket Doodle, and has a few things the big bad original didn’t. You draw on it by selecting a pen or marker shape, and slide your finger around on the screen.  I am a little disappointed you can’t shake it to clean the screen, but the slider mechanism at the bottom works well.  You can slide it partially to clear part of the display, if you like.  Nice and easy to use, my daughter still enjoys it:

Pocket Doodle

Pocket Doodle

Those are a few that I had downloaded when my daughter first showed an interest in using the iPhone, and she still enjoys using them over a year later.  I’d be lying if I said I didn’t enjoy them as well.

, , ,

No Comments

If you care about a free and fast internet…

Berkman Broadband Study
Please visit the above link and read their pdf, a worldwide broadband review for the FCC. It outlines why the infrastructure of the United States is outdated and ultimately fails us as a society.  There aren’t enough providers because the companies who laid out the infrastructure (on our dime) also control who gets to use it, even though we heavily subsidized their implementation as taxpayers.  This Harvard study seeks to inform our government what has worked worldwide to advance other countries telecommunications policies, and why they are “winning” a technology race.

I think the only thing to get the average person in this country to get up and voice their opinion is to be scared about being behind.  If this research doesn’t wake you up and get you to vote for a better future, nothing will. Here’s to hope about getting rid of the terrible oligopolies in the US, and to a brighter future (with faster internet :D .)

Please read this and exercise your voice to the FCC about it.  People who install cable shouldn’t have the final say in who gets to use it, as they are given heavy subsidies and grants to install it.  They should be broken up into separate businesses and made to compete, like everyone else has to do.

No Comments

iPhone Doubles Contact List in OS 3.0

Prior to syncing your iPhone with MobileMe, be sure to turn off the syncing of your address book in iTunes or you will end up with double contacts when you view the list “All Contacts” in your address book on your iPhone. This may seem like a no brainer to some, but it had me baffled for a while.
I had an issue with the speaker port on my iPhone 3G, and sorry to say *cough*, it had to be replaced with a new phone under Applecare. I have had “MobileMe” since it was .Mac, so I was in the Apple Store with a fresh iPhone, ready to leave. No contact info in my phone, say wha?!? I don’t know about you, but I don’t memorize phone numbers. I rely on my phone to do that. So I sync up with MobileMe right in the store and I’m good to go.
Here’s the tricky part. I didn’t realize that if I already synchronized with MobileMe, iTunes would still add my contacts from my Mac, even though MobileMe gets it’s list from…my Mac. What I had to do was delete all of my email address information and re-sync with iTunes.
To avoid that mess, before you sync with iTunes, follow the steps below:
First, open iTunes. Go into Preferences in the File Menu, or hit ⌘-Comma. Under Devices, check the “Prevent iPods and iPhones from syncing automatically” checkbox:

iTunes Preferences--Devices

iTunes Preferences--Devices

Now you can plug in your iPhone, ad nothing will be automatically changed.

Next, select your iPhone in the Devices List,  and select the Info Tab at the top.  You want to uncheck any selections in that tab that would also be synced with your MobileMe account:

iTunes iPhone Info Tab

iTunes iPhone Info Tab

If you have doubled your contacts already, you may have to restore your phone in the summary tab, which is unfortunate, but sometimes worth it anyway.  I’ve read some posts about unhappy owners having to do this, as it takes some time.  Before you try that, you may want to sync/unsync whatever duplicate information you have stuck on your iPhone and see if iTunes will remove it.

If you have tried this to no avail, please comment below and I’ll try to help you sort it out.  If it worked, please let me know that, too.

Thanks for stopping by.  :)

, , ,

No Comments

Resizing An Image Without An Image Editor — Using Automator

This is a fast and easy way to scale the size of an image (or a bunch of images) using OS X’s built in utility Automator.  It is very simple (also crude), but it works and the results are pretty decent.

(You can scroll down to the end of the post if you just want the Automator applications and don’t care how I got there.)

First set up the job in Automator by opening the application in /Applications:

Automator Location

Automator Location

Next, choose workflow from the opening screen and select choose (or just hit enter if they’re already highlighted):

Automator Template Chooser

Automator Template Chooser

The next screen has built in functions to select by category.  In the first column, select “Files & Folders“.  Column 2′s selections are based upon what you select in column 1.  Now the next additions to your workflow will depend upon your desired task.  If you’d like to convert a single image, or if you plan on converting a bunch of images in a folder.

First we’ll cover how to make a simple workflow that you can use to select one image, start the workflow, and exit Automator.

With “Files & Folders“ selected in the first column, drag “Get Selected Finder Items“, followed by “Copy Finder Items” into the right hand area.

Next, in the first column, select Photos.  Find “Scale Images” and drag that to the right hand actions area, so it is at the bottom.  Your workflow should look like this:

Workflow to Scale a Selected Image

Workflow to Scale a Selected Image

Next, we want to adjust an options on  ”Copy Finder Items” and “Scale Images”  to force the workflow to ask for a values, rather than having to manually open Automator, change them, and click “Run”.  That Would be tedious, and we are looking for simple.  So, click the options button in the “Copy Finder Items” and ”Scale Images” portions of your workflow, and click the check box “Show This Action When Workflow Runs” in both of them:

Setting Automator To Ask For Values

Setting Automator To Ask For Values

With that done, just use the “Save As” in the file menu (⇧⌘S) and save the file as an application:

Save Automator Workflow As Application

Save Automator Workflow As Application

That’s it, really.  You can now drag an image file onto the new application, it will ask you where to save the resized image, as well as ask you for the type of scale.  You can set by percentage, or by pixels, and set the value based upon how you chose to scale it.  Scaling by pixels appears to be based upon the width, and then uses the same scale factor to the height automatically.

Now, you can adjust this application to do a whole batch of files inside a folder, if you’d like.  First, open Automator, click “Open Existing Workflow”, and choose your new application created above.  Drag “Get Folder Contents” and place it under “Get Selected Finder Items” in the workflow.  Your new workflow should look like this:

Workflow To Scale A Folder Of Images

Workflow To Scale A Folder Of Images

Again, click “Save As” in the file menu, and select a new name for this application.  You can now drag a folder of images and drop it on the application to resize a batch of images.

There are other options in the Photos section of the Library of actions (the left hand column) such as changing the file type as well, for instance if you have a bunch of jpg’s and want to make them png’s for the web.

I hope this gets you interested in Automator–a totally useful and underrated tool–and happy image scaling!

Download the Single File Application or the Folder of Images Application here if you’d like. You can update and change them by opening them with Automator.

, , , , , , , , , , , , , , , ,

No Comments

Simple Introduction To Apple’s Unix Using Terminal on OS X

This post is for someone interested in learning UNIX on Mac OS X Snow Leopard, but lacks experience using a command line, or has only C:\ prompt knowledge. I will show you, simply, how to map a DOS command to a UNIX command, and to save your profile so the alias name you create is persistent.  If you are a shell scripting genius, this post is something you are encouraged to comment on and expand upon, as learning scripts and commands for OS X can be input many different ways.  It never hurts to have different suggestions.  I will try to make this at the minimum a weekly edition to my blog, and expand each article further than the next.

Let’s get started.  First, open Terminal from your /username/Applications/Utilities folder. This is the command line utility for UNIX, by default it is Bash (Bourne Again Shell.)

You will see your entire present working directory prior to the $ prompt.  The tilde (~) represents /Users/your home folder.  The standard format is computer name: pwd. You can type the simple command pwd and the shell will respond with the folder you are currently accessing.

Default Shell

Default Shell

I like a cleaner shell screen, so I type bash, and hit enter.  This opens a new bash shell, on top of the existing shell.  Next, the command clear deletes the current Terminal text and starts with a fresh bash prompt.  You end up with a Terminal screen that looks like this:

Clean Bash Prompt

Clean Bash Prompt

Here, we can start by showing the man (short for manual;  built in UNIX help pages) page for the command ls (list), which is basically the dir command in DOS.  Simply type man ls at the command line and hit enter.  You can move down the pages line by line using the down arrow key on your keyboard.  To exit the manual, simply type q.

The man page shows you the various options you can use along with the ls command, for example, ls -lia. This command is particularly useful when searching a directory for hidden files (they start with a period), as Finder refuses to display them by default:

Directory Listing With Hidden Files

Directory Listing With Hidden Files

Now, if you are used to DOS, here is a helpful way to stick with the commands you know, yet tell Terminal to run UNIX commands.  You create an alias, basically a command name you make up mapped to a system command. If you want to use options such as -lia, you need to enclose the command in double quotes.  The syntax of the alias command in bash is alias newCmdName=systemCmdName. The command in DOS for a directory listing like the one above is dir /a.  So we can map dirA to ls -lia like so:  alias dirA=”ls -lia”

Note that UNIX is also case-sensitive, for files as well as commands:

Alias DOS dir to UNIX ls

Alias DOS dir to UNIX ls

You can simplify entering commands by using the up arrow to cycle through previously typed in commands.  The history command, saves the commands you enter by line number, which you can view by typing history.  To execute the line number, type an exclamation point followed by the line number:

History Command

History Command

Now, to save this new alias dirA you created into your bash profile.  This way it doesn’t get erased when we kill the shell and quit Terminal.  You may not have a profile set up for bash in your home directory, so what you need to do is create one.  Bash will look for .bash_profile first, so it is best to name any profile you want to use on a regular basis with this name.  It is a hidden file, so you need to have the period in the file name.  For simplicity, you can create a simple text file in your favorite text editor, name it bash_profile (without an extension)and save it in your home directory.  Write the exact command on one line like so: alias dirA=”ls-lia”

Save the file, and then change the name in Terminal.  Use the command mv to change the name so it begins with a period.  Simply type mv bash_profile .bash_profile and press enter:

MV Command

MV Command

MV Complete

MV Complete

That did two things:  one, you moved the file;  two, you learned that mv is the same command as the DOS command move.  You can follow the procedure above to make an alias for the mv command, and place it on the next line in your .bash_profile, so it remains permanent for your login shell.  If you like running an “non-login” shell as I do above, you can use the command cp to copy your .bash_profile to .bashrc like so:   cp .bash_profile .bashrc

Here is a short list of a few DOS commands, along with their respective UNIX bash counterparts (pdf of list here):

DOS COMMAND

UNIX COMMAND

DIR

LS

MOVE

MV

COPY

CP

FIND

GREP, FGREP, EGREP

MEM

TOP (virtual memory use VM_STAT)

*use ctrl-c to end TOP command*

CD

CD (PWD to display current directory)

DEL

RM

That’s all for this quick lesson.  Stop by next week for more DOS examples in UNIX, and (hopefully) working with vi, UNIX’s text editor.

, , , , , , , , , , , ,

1 Comment