How funny life is, something I tried to get away from I now find myself learning with a passion!

Recently we had a meetup at the Cisco office with a brief basics on Linux. You won’t be in the IT field long before someone mentions Linux or you find yourself in front of a Linux box.  I think alot of people usually avoid Linux when they first start out in IT because its “hard”.

William’s Immutable Laws of Success in IT #1

“Thou shall learn the CLI over the GUI.”

 

281818

Now with the whole craze of SDN starting to get traction (even Network World keeps talking about it!), its becoming more and more apparent even us networking folks need to learn this skill. (same with Python, but that’s for another post). The good thing is that being in networking I think we’ve gotten over this CLI fear since we know how to configure a router/switch/firewall/etc. Most of us learned networking on Cisco — GNS3/Packet Tracer. The good news is that many of the commands that you learned in Cisco IOS (like the up, down arrows to cycle through your past typed commands) make a re-appearance in Linux — or rather, they were always there!

A very short history lesson — Linux has been around since 1991, which has deeper roots with the “mother of them all” : Unix has its starts back in 60’s. http://en.wikipedia.org/wiki/Unix check out this link for a nice history on its beginnings.

A good book to read as well a “Where the Wizards Stay Up Late” by Katie Hafner and Matthew Lyon. But enough of the history!

OK so let’s dive into how to start learning Linux.

Probably one of the best parts to learning Linux or Python is unlike networking where we need to mess with license files, mess with system clocks, simulate hardware, lose some functionality (like no l2 on your GNS3), you can run the full blown OS with no restrictions. It makes learning Linux/Python VERY easy.

Most newcomers pick Ubuntu, you can simply Google Ubuntu download and get the latest version, install it on your hypervisor of choice, and away you go! I personally like Linux Mint so I’ll be using that for my examples.

I assume you can install a .iso file into a VM, so I’ll skip to the part where your at the desktop. If you’ve done an installation of Windows before, this is pretty much the same (minus the Enter License Key screen).

When the dust settles, you’ll get a screen like this…

LinuxMint1

No matter what flavor of GUI you have, common characteristics include the “start” menu. Like anything new, it looks intimidating — which leads to my 2nd immutable law of success in IT.

William’s Immutable Laws of Success in IT #2

“If it’s hard, it just means you need to clock more time in it.”

 

 

LinuxMint2

What do you mean “clock time”. The old saying practice makes perfect is so true. After a few weeks — hell, even days of practice using this, you’ll get so used to it you’ll forget why you thought it was so hard! This doesn’t just apply to Linux but anything else — in IT, nothing is hard, you just need to spend time with it.

 In these blog posts, I won’t spend time using the GUI, anyone can use that. We’ll get into the guts of the OS — the CLI!

To launch the CLI, you can usually click the “Start” button and it’ll show up, or search for it. In Linux, the CLI is called “Terminal”.

 

Now this is where the fun starts — a just one thing to know before typing away.

TIP: Like Cisco IOS, Linux also has a TAB to auto-complete your CLI entry. The “?” command works as well depending on the syntax you have — “service isc-dhcp-server ?” for example.

OS Structure

Like Windows, Linux also have a file structure. Instead of re-inventing the wheel, there’s a good post on How To Geek explaining the layout of the Linux file structure  http://www.howtogeek.com/117435/htg-explains-the-linux-directory-structure-explained/

Knowing this file structure is like knowing the lay of the land before getting into your car for a road trip. Especially when we’re looking at a blinking prompt. Highpoints to know is unlike Windows where we have C: drive, D: drive, etc, we have \s.

OK now lets play with the follow common commands in this 101 post. With your Terminal window open type in the following commands…

1. ls
List directory contents
A common command used to list what is currently in your directory. Commonly used with ls -l to show details of each file/directory.

2. pwd
print the name of the current/working directory
This tells you where you are in the OS structure. Kind of like a C:\Windows\system32\drivers — but instead of seeing a GUI of it, you can type this out to see where you are currently.

3. cd
Current/Change Directory
This is the equivalent of you clicking a folder. In CLI, you use cd to move between folders/directories.

4. clear
clear the terminal screen
like the man page says…clears out the screen so you get a nice pretty clean CLI to work with!
5. who
Show who is logged on
Dont you just love Linux — it tells you in plain English what it does….showing you whose currently logged into this system.
6. cat
concatenate files and print on the standard output
Used to view files (like clicking a notepad file)

Mess with these commands on your CLI, at first it feels weird but once you do it more and more it’ll become second nature. To get your feet wet with these commands try these excerises….

1. Jump around from the directory, from the root all the way to the lowest level you can, and jump back to another folder.
2. Find out whose logged into your machine.
3. Use the TAB to autcomplete your syntax
4. BONUS: Google around and figure out the commands to create you own files/folders, how to delete them, and move them.

William Zambrano

William Zambrano

NYC networkers is run by William Zambrano, a passionate network engineer who has been in the IT industry for eight years who posts up blog articles, YouTube videos, and holds meetup.com events in the NYC area. He lives in Queens, New York and has consulted in various different companies in the NY area. Previously William worked as a Cisco Certified Systems Instructor (CCSI) but now currently works for Arista Networks serving as a Systems Engineer. William can be reached by email at willzambrano@gmail.com

More Posts - Website

Follow Me:
Twitter