NEWS & EVENTS
Whether you’re studying for your next certification or an experienced IT professional, learning a handful of Linux commands is a great way to enhance your skillset. The CompTIA A+ certification covers 19 Linux commands that are the perfect place to start. These videos can help you get started!!Navigating the Filesystem pwd
In order to discover where you are currently located within the filesystem, the pwd command can be used.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/Linux-Cheat-Sheet-Video.mp4 cd
To navigate the filesystem structure, use the cd (change directory) command to change directories.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/cd.mp4 ls
The ls command is used to list the contents of a directory.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/ls.mp4 Administrative Access su
The su command allows you to temporarily act as a different user.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/su.mp4 sudo
The sudo command allows a user to execute a command as another user.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/sudo.mp4 chmod
The chmod command is used to change the permissions of a file or directory.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/chmod.mp4 chown
To change the ownership of a file use the chown command.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/chown.mp4 Filesystem Management mv
The mv command is used to move a file from one location in the filesystem to another.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/mv.mp4 cp
The cp command is used to copy files.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/cp.mp4 dd
The dd command is a utility for copying files or entire partitions at the bit level.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/dd.mp4 rm
The rm command is used to delete files and directories.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/rm.mp4 Filtering Input grep
The grep command is a text filter that will search input and return lines, which contain a match to a given pattern.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/grep.mp4 Shutting Down shutdown
The shutdown command arranges for the system to be brought down in a safe way.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/shutdown.mp4 Display Network Configuration ifconfig
The ifconfig command stands for “interface configuration” and is used to display network configuration information.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/ifconfig.mp4 Viewing Processes ps
Running a command results in something called a process. The ps command can be used to list processes.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/ps.mp4 Package Management apt-get
Package management is a system by which software can be installed, updated, queried or removed from a filesystem. The Advanced Package Tool, apt-get , makes management of packages easy.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/apt-get.mp4 Updating User Passwords passwd
The passwd command is used to update a user’s password. Change the password of the current user.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/passwd.mp4 Editing Text vi
The vi command is used to edit text files.https://ndg-blog.s3.amazonaws.com/uploads/2017/07/vi.mp4
Have you ever thought about changing careers and breaking into the IT field? Or, maybe you’re already in IT and dream about leaving the helpdesk behind for a more challenging and rewarding career as a system administrator?
Every year, millions of people do just that. But the big question is: How? How do you get potential employers to overlook the fact that you don’t have the right degree or experience to give you a job managing or troubleshooting critical production systems?
We recently sat down with Adam Anderson, author of the Kernel Mastery blog and Senior Support Technician at Silicon Mechanics, to talk about his experience breaking into the IT field. Read on to learn how he went from teaching Spanish, Japanese, and English at home and abroad to getting Linux certified and launching a new career as a Linux professional.
Interviewer: Thanks for joining us today, Adam. I love your blog, and I know that you’ve had a really interesting journey on the path towards Linux mastery. Can you tell us about it?
Adam: In college, I got a bachelor’s degree in Spanish along with a minor in Japanese. Then I got a Masters in Teaching as well as a TESOL certification, which allowed me to teach English abroad. After I graduated, I taught in Japan, Turkey, and Bahrain for several years. Turkey was really fun. I taught English and Drama classes for three years there. I returned to the US after five years or so of international teaching. I wanted to look for more opportunities to focus on my main subject areas: Spanish and Japanese.
Initially, while I was looking for a new teaching job in Washington State, I began to learn a little bit more about different technologies. I’d always been a tech enthusiast in a way, you know? Always loved reading Y Combinator/Hacker News, Slashdot and different subreddits having to do with technology and futurism. I just really liked looking at the trends of technology and different industries.
I started looking into Perl. I liked the story behind the programming language, and the creator, Larry Wall, is said to have based a lot of the principles and the syntax of Perl on natural human language. So that obviously tied in with my interests in linguistics, world languages, and so on. I thought that would be really neat and that what I think are my natural talents in language learning might extend into learning programming.
I started to get into Perl a bit. I got the Beginning Perl book, I worked through a few chapters, and then I realized that it just wasn’t going to work to do this on my Windows laptop. I concluded that if I really wanted to get into programming or do web development I had to learn Linux. That’s where my real interest in Linux began.
Interviewer: That’s great. At what point did you decide to pursue a career in Linux?
Adam: I just held on to that idea for a while. And then after three more years teaching in Washington State, I decided I wanted to make the transition and make that my new career, because it was just a little bit more exciting for me. I had taught for nine years and I had a really good run at it, with a lot of great experiences, but I felt like I was hitting a ceiling both in my professional skills development and also in terms of earning money. I didn’t feel like there was much else I could do that was new and different and a good challenge for me.
Interviewer: How did you go about learning Linux?
Adam: Before I decided to make the switch, I started listening to some Linux podcasts: Linux Action Show and Everyday Linux—before it became Geek Talk or whatever it is now—and FLOSS Weekly. They gave me a little more insight into the industry, what it’s like to work in it and how you can break into it. There was an episode on Linux Action Show where a caller left a message and told his story about how he did Linux+ over the course of nine months and he was able to get his first job in IT right away after that. So, I said, “Hey, that’s very doable and doesn’t require going back to university and spending a whole bunch more money.”
At that point, I made the commitment to myself to make the transition. I started with some online Linux courses, went through all the labs and did the quizzes. I also got some Linux textbooks and the exam study guides. So, it was a combination of those things that helped me learn the content and pass the tests. And then what really helped me to be marketable on top of working towards certification was launching my open-source blog, Kernel Mastery, and just going through that process and learning a new stack, even in just a basic way.
I think the real key is you need technical knowledge, you need passion, and you need to have some way to show your passion, some kind of project in your portfolio that can prove to employers that this is not just you trying to get into a field to make more money. You actually want to be this in this industry, because it fits your character or where you’re going in life.
Interviewer: What would you recommend to someone else who is thinking about starting a blog?
Adam: WordPress and many of these other platforms make it really easy. You can do one-click installs and never have to type anything. But if you want to get into this industry, you need to build something, so I would recommend not doing the one-click install. Do the manual installation. Get into the weeds a little bit, and you’ll have some good stories to tell about it and the challenges you faced.
Interviewer: You mentioned working towards certification. What certifications did you get? And how did you decide which ones to pursue?
Adam: There’s obviously a wide variety of certifications, so you have to do your research. Some are more valuable than others and will give you a better return on your investment over time. I looked at a lot of the surveys and market data showing the compensation for the various IT certifications, and it looked like Linux+ and LPIC-1 were among the best in that category, if not the best. So I think these are great.
I first did Linux Essentials from CompTIA, just to give myself a gentler introduction. Then, I did Linux+, but I got the three-in-one (Linux+, LPIC-1, and SUSE CLA). It took me a year to go through that.
Interviewer: Did you start looking for a job before you got certified, or did you wait until you got certified?
Adam: I started to look in early 2016, when I was about half-way done with my certifications. I went to a number of Meetups in the Seattle area that were tech or Linux related. That was helpful. I could continuously calibrate my strategy and say, “Okay, so there’s a lot of people here that are very confident with scripting and they do Ruby and DevOps stuff all the time. Do I want to do that, or do I want to focus on the more traditional SysAdmin type career track and aim for those kinds of jobs?” It was hard to know where to focus, and there’s so much going on all the time. If you just say ‘SysAdmin’ it could mean so many things. Going to the Meetups helped me to figure out what I would be more interested in.
One day someone at a Meetup announced a job, and it happened to be for Silicon Mechanics. I got called in for an in-person interview during my last week of teaching, I passed the final Linux+ exam the week after, and then I was offered the job and started the very next week.
Interviewer: That’s such a great story. It’s exciting to see how you were able to make this career transition and break into a new field. How do you use Linux in your current job?
Adam: I’m working at Silicon Mechanics, a systems integrator and custom design manufacturer. The company helps customers deploy open technologies, from building out HPC or storage clusters to the latest in virtualization and containerized services. Working in our Support organization, each and every day I’m challenged to be able to respond to a wide variety of questions; from low-level hardware issues to firmware questions, remote/out-of-band management issues, networking, file systems, RAID, cluster management, and HPC.
I’ve more or less adopted a policy for myself of only using Linux on my workstations at work. I use it in that capacity, and only use my Windows laptop when I need to for screen sharing or some of the Microsoft-centric collaboration tools. When it comes to the systems we build here, most of our customers who want an OS installed go with Ubuntu or CentOS. Everyone here in production, services, and support need to be quite familiar with Linux to know how to get around, configure things, and troubleshoot things. In Support, we have our own diagnostic script that is written in Bash as well. It is fairly comprehensive and grabs all of the hardware and diagnostic information that we need. So, of course, we need to be able to navigate through that and parse those outputs too. It’s pretty much Linux all the time for us.
Interviewer: Do you have any advice for other people who come from a nontechnical background and want to break into the IT field?
Adam: I’d say keep it simple. Find a Meetup and attend it regularly to start to build up a network of people that you can talk to. Even if it’s just occasionally, having someone who can act like a mentor is really important. So, find a Meetup or a mentor, and then look into A+, Network+, or a Linux certification like LPIC-1 or Linux+. Having a certification can be very helpful in getting your foot in the door.
Also, you could research professional organizations like LOPSA [League of Professional System Administrators], which I joined this year, or look into apprenticeship programs. We have a promising new program in Washington State called Apprenti. It is funded by the state and it is part of the Washington Technology Industry Association.
Silicon Mechanics just hired an apprentice earlier this year from Apprenti. She has been going through a process which I’m very jealous of personally, because it seems like the perfect way to get into the field. Apprenti is providing technical training, and we are providing opportunities for her to shadow people at our company. She’s actually going to be earning three technical certifications this year as part of this program. I think it’s a great program.
Interviewer: Last question. How would you describe the impact that learning Linux has had on your life and career?
Adam: It’s been mind-opening for me as far as understanding how people around the world can collaborate on a large project like this, a large technical project like the Linux kernel. We have a lot of people with a lot of opinions, but they end up creating something that’s immensely useful and has actually helped to change the world. Linux is pretty much a pillar of the internet, with so many servers running it. And then to see how large corporations (Google, Microsoft now, and others) contribute back to open-source projects, I think that’s really amazing and it gives me hope that people will continue to have good, robust options, things that make life easier, whether it’s an operating system or programming language or whatever. So that’s been exciting for me.
And then obviously it’s lucrative. I was able to get a job knowing Linux at a basic or intermediate level after studying it intensely for one year. Plus, it’s fun and it’s always changing. The ecosystem in Linux is always changing and evolving.
Interviewer: I love the whole ethos of the open-source community and everyone’s desire to contribute and be part of something larger. And I see the same thing in what you’re doing with your blog, and also taking the time today for this interview. Thank you.
The Linux kernel has found its way into an incredible number of diverse systems. It can now be found in everything from automobiles to rockets, watches to televisions, and netbooks to the fastest supercomputers. Linux only accounts for a relatively small percentage of the operating systems found on desktop computers, but has gained widespread use in servers, Internet of Things (IoT) devices, networking equipment, smartphones, and many other devices you may not think of as even being computers.
Whether you’re studying for your next certification or an experienced IT professional, learning a handful of Linux commands is a great way to enhance your skillset. The CompTIA A+ certification covers 19 Linux commands that are the perfect place to start.Linux (Unhatched) Cheat Sheet Basic Command Syntax
To execute a command, the first step is to type the name of the command followed by any options and/or arguments before pressing the Enter key.command [options…] [arguments…]
In other words, you type a command, followed by any options and/or arguments before pressing the Enter key. Typically options alter the behavior of the command and arguments are items or values for the command to act upon. Although there are some commands in Linux that aren’t entirely consistent with this syntax, most commands use this syntax or something similar.
Note: In the command formats below the items contained within brackets should be replaced with the appropriate option or argument.Navigating the Filesystem pwd
In order to discover where you are currently located within the filesystem, the pwd command can be used.pwd [OPTIONS]
The pwd command prints the working directory, your current location within the filesystem:sysadmin@localhost:~$ pwd /home/sysadmin cd
To navigate the filesystem structure, use the cd (change directory) command to change directories.cd [OPTIONS] [PATH]
To move to the Documents directory, use it as argument to the cd command:sysadmin@localhost:~$ cd Documents sysadmin@localhost:~/Documents$ ls
The ls command is used to list the contents of a directory.ls [OPTIONS] [DIRECTORY]
In the next example, the Documents directory will be used as an argument. The resulting output is a list of files contained with the Documents directory:sysadmin@localhost:~$ ls Documents School alpha-second.txt food.txt linux.txt os.csv Work alpha-third.txt hello.sh longfile.txt people.csv adjectives.txt alpha.txt hidden.txt newhome.txt profile.txt alpha-first.txt animals.txt letters.txt numbers.txt red.txt
Some useful options to the ls command are shown below:Command Function ls -l Use long listing format. ls -t Sort files by timestamp. ls -S Sort files by file size. ls -r Reverse the order of any sort.
It can be inconvenient to type the full path argument so some of the more common paths have shortcuts.Path Argument Directory Represented . Current Directory .. Home Directory / Root directory ~ Home directory
Administrative Access su
The su command allows you to temporarily act as a different user. By default, if a user account is not specified, the su command will provide administrative privileges.su OPTIONS USERNAME
Utilizing the login shell option is recommended, as the login shell fully configures the new shell with the settings of the new user. This option can be specified one of three ways:su - su -l su --login
The example below shows this being executed:sysadmin@localhost:~$ su - Password: root@localhost:~# sudo
The sudo command allows a user to execute a command as another user.sudo [OPTIONS] COMMAND
Like the su command, the sudo command assumes by default the root user account should be used to execute commands. To specify another user, the -u option can be used.
Permissions and Ownership
Permissions determine the ways different users can interact with a file or directory. Reference a long listing ls -l to view the permissions and ownership information.sysadmin@localhost:~/Documents$ ls -l hello.sh -rw-rw-r-- 1 sysadmin sysadmin 21 Aug 1 02:35 hello.sh
The fields in the output provide information about the permissions of the following groups. Read below to learn more about the characters which represent permissions.
Owner-rw-rw-r-- 1 sysadmin sysadmin 21 Aug 1 02:35 hello.sh
Groupdrwxr-x--- 2 root adm 4096 Mar 14 17:48 apache2
Othersdrwxr-xr-x 2 root root 4096 Mar 14 17:45 apt chmod
The chmod command is used to change the permissions of a file or directory. Administrative access is required unless you are the user who owns the file.chmod [<SET><ACTION><PERMISSIONS>]... FILE
To use the symbolic method of chmod first indicate which set of permissions is being changed:chmod [<SET><ACTION><PERMISSIONS>]... FILE Set Symbol Meaning u User g Group. o Others a All
Next, specify an action symbol:chmod [<SET><ACTION><PERMISSIONS>]... FILE Action Symbol Meaning + Add = Exact - Remove
After an action symbol, specify one or more permissions to be acted upon:chmod [<SET><ACTION><PERMISSIONS>]... FILE Permission Symbol Meaning r Read w Write x Execute
To give the user owner of the file execute permission, execute the command below.
Initially, the owner of a file is the user who creates it. To change the ownership of a file use the chown command.chown [OPTIONS] [OWNER] FILE
The chown command is used to change the ownership of files and directories. Changing the owner requires administrative access.sysadmin@localhost:~/Documents$ sudo chown root hello.sh [sudo] password for sysadmin:
Filesystem Management mv
The mv command is used to move a file from one location in the filesystem to another.mv File(s) Directory
The mv command requires at least two arguments. The first argument is the source, a path to the file to be moved. The second argument is the destination, a path to where the file will be moved to.sysadmin@localhost:~/Documents$ mv people.csv Work mv File_Name New_File_Name sysadmin@localhost:~/Documents$ mv animals.txt zoo.txt cp
The cp command is used to copy files.cp [OPTIONS] SOURCE DESTINATION
Similar to the mv command it requires at least two arguments: a source and a destination.sysadmin@localhost:~$ cp Documents/School .
The dd command is a utility for copying files or entire partitions at the bit level.dd [OPTIONS] OPERAND
The command requires a couple arguments, see the table below to learn more about them.sysadmin@localhost:~$ dd if=/dev/zero of=/tmp/swapex bs=1M count=50 500+0 records in 500+0 records out 524288000 bytes (524 MB) copied, 0.825745 s, 635 MB/s
Argument Description if Input File of Output File bs Block Size count Count
The rm command is used to delete files and directories.rm [OPTIONS] FILE
When a file is deleted with the rm command, it is almost always permanently gone.sysadmin@localhost:~/Documents$ rm linux.txt
Filtering Input grep
The grep command is a text filter that will search input and return lines, which contain a match to a given pattern.grep [OPTIONS] PATTERN [FILE]
The easiest pattern is a simple string, like a word or phrase.sysadmin@localhost:~/Documents$ grep sysadmin passwd sysadmin:x:1001:1001:System Administrator,,,,:/home/sysadmin
Patterns can also take the form of regular expressions, a much more powerful way of matching text. The basic regular expressions are shown below.Regular Expression Patterns Basic Regex Character(s) Meaning . Any one single character [ ] Any one specified character [^ ] Not the one specified character * Zero or more of the previous character ^ If first character in the pattern, then pattern must be at beginning of the line $ If last character in the pattern, then pattern must be at the end of the line
Shutting Down shutdown
The shutdown command arranges for the system to be brought down in a safe way.shutdown [OPTIONS] TIME [MESSAGE]
The command requires a measure of time as an argument.root@localhost:~# shutdown now Broadcast message from sysadmin@localhost (/dev/console) at 2:05 ... The system is going down for maintenance NOW! root@localhost:~# shutdown +1 "Goodbye World!" Broadcast message from sysadmin@localhost (/dev/console) at 3:07 ... The system is going down for maintenance in 1 minute! Goodbye World! root@localhost:~# Broadcast message from sysadmin@localhost (/dev/console) at 3:08 ... The system is going down for maintenance NOW! Goodbye World!
Display Network Configuration ifconfig
The ifconfig command stands for “interface configuration” and is used to display network configuration information.ifconfig [OPTIONS] sysadmin@localhost:~$ ifconfig eth0 Link encap:Ethernet HWaddr b6:84:ab:e9:8f:0a inet addr:192.168.1.2 Bcast:0.0.0.0 Mask:255.255.255.0 inet6 addr: fe80::b484:abff:fee9:8f0a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:95 errors:0 dropped:4 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25306 (25.3 KB) TX bytes:690 (690.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:460 (460.0 B) TX bytes:460 (460.0 B)
Displays wireless network configuration information.Viewing Processes ps
Running a command results in something called a process. The ps command can be used to list processes.ps [OPTIONS]
The columns in the output contain columns of information about each process.sysadmin@localhost:~$ ps PID TTY TIME CMD 80 ? 00:00:00 bash 94 ? 00:00:00 ps
The columns correspond to the following information.PID Process Identifier TTY Terminal TIME Total Processor Time CMD Command
The following options to the ps command will display more information.ps -e Display every process. ps -f Display additional details.
Package Management apt-get
Package management is a system by which software can be installed, updated, queried or removed from a filesystem. The Advanced Package Tool, apt-get , makes management of packages easy.
Before installing a package, it is good practice to refresh the list of available packages using the apt-get update command.sudo apt-get update
To search for keywords within these packages, you can use the apt-cache search command.apt-cache search [keyword]
The output will contain a list a packages that contain that keyword.sysadmin@localhost:~$ apt-cache search cow cowsay - configurable talking cow
Once you’ve found the package that you want to install, you can install it with the apt-get install command:sudo apt-get install [package]
The command will output updates as the package is installed.sysadmin@localhost:~$ sudo apt-get install cowsay [sudo] password for sysadmin: Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: filters The following NEW packages will be installed: cowsay 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/18.5 kB of archives. After this operation, 90.1 kB of additional disk space will be used. Selecting previously unselected package cowsay. (Reading database ... 24313 files and directories currently installed.) Preparing to unpack .../cowsay_3.03+dfsg1-6_all.deb ... Unpacking cowsay (3.03+dfsg1-6) ... Processing triggers for man-db (126.96.36.199-1ubuntu1) ... Setting up cowsay (3.03+dfsg1-6) ...
When updating all packages of the system two steps should be taken. First, update the cache of all packages available with apt-get update. Second, execute the apt-get upgrade command and all packages and dependencies will be updated.apt-get update apt-get upgrade
An administrator can execute the apt-get remove command to remove a package or the apt-get purge command to purge a package completely from the system.apt-get remove [package] apt-get purge [package]
Here is a recap of the package management commands.sudo apt-get update Refresh package list. apt-cache search [keyword] Search for packages by keyword. sudo apt-get install [package] Install a package. sudo apt-get upgrade Update all packages and dependencies. sudo apt-get remove [package] Remove a package. sudo apt-get purge [package] Purge a package completely from the system.
Updating User Passwords passwd
The passwd command is used to update a user’s password. Change the password of the current user.passwd [OPTIONS] [USER]
Users can only change their own passwords, whereas the root user can update the password for any user.sysadmin@localhost:~$ passwd Changing password for sysadmin. (current) UNIX password: netlab123 Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
With the -s option the passwd command prints the status information of the current user’s password:sysadmin@localhost:~$ passwd -S sysadmin sysadmin P 03/01/2015 0 99999 7 -1
The fields in the output contain the following information:Field Example Meaning User Name sysadmin The name of the user. Password Status P P indicates a usable password.
L indicates a locked password.
NP indicates no password. Change Date 03/01/2015 The date when the password was last changed. Minimum 0 The minimum number of days that must pass before the current password can be changed by the user. Maximum 99999 The maximum number of days remaining for the password to expire. Warn 7 The number of days prior to password expiry that the user is warned. Inactive -1 The number of days after password expiry that the user account remains active.