NEWS & EVENTS
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 (184.108.40.206-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.
Based on feedback we have received from our customer community, we are aware that many of you are interested in training offerings from NDG. We are pleased to announce the following educational opportunities.NETLAB+ training available through CSSIA (National Center for Systems Security and Information Assurance), attend online via WebEx, see registration info: http://cssia.org/cssia-training.cfm
June 6 – 7, 2017: NETLAB+ System Administration, a two-day (WebEx) course to introduce the basics.
June 8 – 9, 2017: NETLAB+ Building Custom Environments, a two-day (WebEx) course covering building custom labs and pods.NETLAB+ and Linux training available through WASTC (Cisco Western Academy Support and Training Center), in-person workshops, see registration details: http://www.wastc.org/meeting-and-conferences/13-conferences/28-2017-faculty-development-weeks
June 19 – 23, 2017: Orientation to NETLAB+ Virtual Edition at Cabrillo College, Aptos, CA: http://www.wastc.org/images/documents/fdw2017/NETLAB_VE_Orientation.pdf
June 26 – 30, 2017: NETLAB+ Pod and Lab Development at Coastline Community College, Garden Grove, CA: http://www.wastc.org/images/documents/fdw2017/NETLABCustomContentWorkshop.pdf
June 26 – 30, 2017: Take Learners from Zero Linux Knowledge to Linux Certifications at Coastline Community College, Garden Grove, CA: http://www.wastc.org/images/documents/fdw2017/TakeLearnersFromZeroLinuxKnowledgeToLinuxCertifications.pdf
We look forward to serving our customer community through these training opportunities and hope you will consider attending.
NETLAB+ supported labs are now available for CCNA 6.0 Routing and Switching – Routing and Switching Essentials (Series 2):
For details, please see:
Skills-Based Assessments are now available for the CCNA Security 2.0 labs:
The initial release of the Cisco CCNA Security v2.0 Skills-Based Assessment requires the use of the Multi-Purpose Academy Pod with ASA (MAP w/ASA) Pod design. Another requirement to run the SBAs is to make sure that the new Cisco_Win7_Base is deployed in the MAP w/ASA pod for all PC systems (A, B, & C). The annotation for the new VM is the following: Version 2 Build 2017041202. The new VM is compatible with all Cisco labs using the MAP w/ASA pod.
All CCNA Security 2.0 labs using the Multi-Purpose Academy Pod with ASA (MAP w/ASA) now require the use of the new Cisco_Win7_Base VM:
A new VM, Cisco_Win7_Base must be deployed in the MAP w/ASA pod for all PC systems (A, B, & C). The annotation for the new VM is the following: Version 2 Build 2017041202. The new VM is compatible with all Cisco labs using the MAP w/ASA pod.
For more information on compatible topologies and class settings for CCNA 2.0, please visit: https://www.netdevgroup.com/content/cnap/labs/ccna_security_v20.html
To review release notes, please see: https://www.netdevgroup.com/content/cnap/release_notes_cnap.html
Red Hat, the world’s leader in open source and provider of the leading enterprise Linux platform, has recently redesigned their academic program. The revised Red Hat Academy, which provides industry-leading Linux administration, JBoss development and cloud technology curriculum, is now available for free to qualifying higher education institutions.
These exciting changes make it possible for you, as NETLAB+ customers, to take advantage of NDG’s strategic collaboration with Red Hat and use your NETLAB+ system to administer Red Hat labs in your classroom at no additional cost. Visit the NDG website for more information on NETLAB+ lab support for Red Hat Academy courses.
Why join Red Hat Academy?
- Membership to qualifying universities is now free, with easy online program enrollment.
- Academy instructors receive free access to Red Hat online training courses.
- Gain access to industry-leading Linux, cloud and middleware curriculum
- Student materials are available in multiple formats: eBook, printed, or online.
- Collaborate with the world’s leader in open source.
- Prepare your students with in-demand skills that companies are actively seeking.
Together, Red Hat and NDG are committed to helping close the technology skills gap by providing students with opportunities to build enterprise-ready skills. We believe the revised Red Hat Academy program has the potential of making a big impact on your institution and students.
Interview with Cisco Support Engineer Helmut Heise
We recently had the opportunity to sit down with Helmut Heise, a Customer Support Engineer at Cisco, to discuss the future of Linux in networking and other applications. Read the interview to learn why Helmut believes Linux is an essential skill for any engineer interested in a career in networking, programming, or software development.
Interviewer: Thank you, Helmut, for joining us today. We’re excited to get your insights into the evolving role of Linux in networking and other applications. Can you start by describing what you do at Cisco?
Helmut: I’m a Customer Support Engineer dedicated to helping customers solve problems with wireless technology. I spend most of my time, like other TAC (Technical Assistance Center) engineers, troubleshooting problems. Specifically, wireless issues. As part of this job, we need to recreate customer issues in the lab to test solutions before implementing them in a production environment.
Regarding the Linux side, I would say that we use Linux about 70% of the time. For example, when we have to recreate customer issues in our labs, we need to interface with DHCP servers, DNS servers, and some services hosted in Linux. In fact, many of Cisco’s products are based in Linux. On the wireless side, for example, we have wireless controllers and wireless access points in which the main operating system is Linux. We have security platforms that are hosted on Linux servers as well.
Interviewer: Got it. So Linux is definitely a huge part of your job. Why did you choose to learn Linux?
Helmut: I started learning Linux in university. One motivation was just opposition. When I was in university, I liked doing things differently. Not just the Windows way. That’s why I first started to use Linux.
I felt that the Linux approach was consistent with my own thinking. Linux is free. There’s a large community available to support problems. And you don’t have to pay any money to resolve issues. I like that way of thinking. It was really a personal decision.
At this point of my career, networking is not just about networking. Now network engineers need to know Linux. My SQL databases and other platforms are hosted in Linux. I believe that the future of engineers is not just networking, or programming, or software development. You also need to know how to make things with Linux. There’s a strong future for Linux in the IT sector.
Interviewer: That’s exciting. Do you think there are any other industries, besides IT, that could benefit from knowing Linux?
Helmut: Sure. We know that Cisco products and Linux are present in airports, where they’re used to manage air traffic. They’re present in healthcare and other industries. Not just IT. A lot of industries are adopting Linux because all the drivers and code are easy to deploy.
Interviewer: Has knowing Linux opened any doors for you in your career?
Helmut: Yes. At a previous company, I had the opportunity to deploy a Linux box in the a telephony server in the Amazon cloud, hosted in a Linux server. That deployment helped open the doors for me here at Cisco. Actually, I’d like to thank Linus Torvalds and the Linux community for making that possible.
Interviewer: What Linux knowledge would you recommend to future IT professionals?
Helmut: I started with Debian. It’s easy to understand, and has a large community. Most of the problems you encounter, you’ll readily find solutions on the Internet. My advice is to start doing things in Linux that you’d do in Windows or on a Windows server. This is best way to learn. You could, for example, set up an image server to send fake email (as a joke). Have fun with it, and learn along the way.
Interviewer: Any final thoughts on Linux?
Helmut: I believe a lot of technologies are going to converge in Linux. You can see it at Cisco. Many of our platforms are adopting Linux.
“To be ready for the future, network engineers, system engineers, even software developers must learn Linux.”
We recently had the opportunity to sit down with Nick Goldwater, a TAC (Technical Assistance Center) Engineer at Cisco, to discuss the future of Linux in networking and other applications. Read the interview to learn why Nick believes Linux is an essential skill for all engineers interested in networking or programming.
Interviewer: Thank you, Nick, for joining us today. We’re excited to get your insights into the evolving role of Linux in networking and other applications. Can you start by describing what you do at Cisco?
Nick: My name is Nick Goldwater and I’m a TAC engineer for Cisco. I work in the management applications area, currently supporting a brand new product called APIC-EM.
A typical day for me involves getting cases from customers, from application bugs all the way to configuration issues and general questions. What I support is based on Linux. So a lot of the time, I’m in their machines troubleshooting.
Interviewer: Got it, very cool. Why did you start learning Linux in the beginning?
Nick: I first started being interested in Linux back in 2001. I was working at a bank, and I ended up being in the wide area networking group. I was tasked with monitoring all of the remote branches, and I was looking at open-source alternatives to these very expensive applications [that were on the market]. That’s where I first got into Linux, because I had to install it. It was on Redhat, and I think I learned a lot from that experience, because it was difficult.
And then I just did it for fun, because there was not really a direct job for me. I was doing networking at the time. What’s funny now is that everything is converging, and Linux is networking. So when you think about firewalls and things like that, it’s based on Linux. It’s IP tables. And then later on in my career I ended up working for a startup that was 100% Linux-based and it was easier for me just to use Linux all the time. I just never went back after that. In fact, Windows 10 sort of scares me.
“The advice I’d give others is if you want to learn, you’ve got to do stuff with it.”
Interviewer: You sound like you learned Linux on your own, not the traditional university education.
Nick: I taught it all to myself. The advice I’d give others is if you want to learn, you’ve got to do stuff with it. I wouldn’t read about it. I would install it, and then figure out something I wanted to do. And then read about that, and make mistakes and fix them.
What’s interesting about Linux is that it levels the playing field a lot. Traditionally, if you wanted to have experience on large network devices—take for example a Nexus 7000 or 9000—first of all you would have to work for a large corporation or government organization. You couldn’t get that experience at a small business. And if it’s in production, no one is going to let you touch it anyway, so what kind of learning are you going to get? And these things cost so much money, it’s not like you’re going to buy one and take it home and play with it.
Whereas Linux is free, and it’s enterprise software. It’s running everything, and you can install it and run it and play with it on a very low-end laptop. And that’s very powerful because you can get the same skills everybody else has, because you have access to the tools.
Interviewer: Definitely. One thing that you’ve mentioned is that Linux isn’t just for the Linux sysadmins anymore. It’s in networking. It’s in DevOps. It’s everywhere. How does Linux benefit the non-sysadmin, the other IT professionals?
Nick: The reason Linux has just taken off is because there is no licensing. You don’t have to pay Microsoft every time you create an Android phone or an embedded system or anything. I’d say that as of six years ago, 98% of Cisco products had open source in them.
Technology is converging, and networking is moving up the OSI stack. Traditional network skills are being deprecated in favor of application-level or programming-level skills.
A lot of people in the industry today are faced with having to learn a whole lot of new skillsets. There was once a time when I never would have looked at a database, but now that’s part of my job. Databases are part of everything. Especially with network management, you have to keep up with a lot of variables. That’s a challenge for people coming up—how fast these things are changing. But Linux itself is pretty solid. It changes, but it is basically the same as it was in the beginning. It just has a whole lot more lines of code in it.
“I’ve been saying for a very long time that we need to have more people with Linux skills, because the writing is on the wall. Up to this point it was optional, but for people entering the field today it’s not optional. It’s just part of the base repertoire of skills that you need.”
Interviewer: Would you say that Linux has opened doors for you in your career?
Nick: Great question. It wasn’t intended, but it did. Because I was the guy who knew how to do stuff. People would just say, “Well, Nick knows it,” and so I would do it. And then I had a laptop running Linux, and that’s weird to a lot of people. People would then say, “Okay, well, you can help with this.”
I’ve been saying for a very long time that we need to have more people with Linux skills, because the writing is on the wall. Up to this point it was optional, but for people entering the field today it’s not optional. It’s just part of the base repertoire of skills that you need. And I’m not saying you have to be an expert. I’m just saying you have to be able to navigate and understand what you’re doing enough to do your job.
Interviewer: What Linux knowledge would you recommend for future engineers and students?
Nick: It would depend on where they’re going. If they’re looking to do stuff with embedded systems and if they want to really know what the kernel is all about, because that’s the thing that talks to devices, that’s your window in. Basic navigation, knowing how to partition a drive—the basic sysadmin stuff. That’s always good to have, and I wish that all programmers had that, honestly, because I’ve supported programmers that are programming and they don’t understand the operating system. And that provides challenges of its own, so if people are going to go into programming, it’s good to know.
The only way to learn it is to actually do something with it. Reading a book is not going to get you to learn it. I’ve hosted my own email for probably ten years now, but that started as just something I wanted to try: “Can I make this work?” And then there’s all this media stuff. There are entire distributions dedicated to making music. And, surprisingly, a lot of those big programs that you can pay for, their guts are open-source projects.
Interviewer: That’s great. Anything else you want to add before we close?
Nick: Just how important I think it is. We need these skills, and they’re hard to find. Everybody that has these skills has a job. So when we’re looking for good candidates that can come in and hit the ground running, it’s hard to find the right mix, and Linux is missing a lot of the time.
Cisco Certified Network Associate (CCNA) Routing and Switching is a certification program for entry-level network engineers, which validates the ability to install, configure, operate and troubleshoot medium-size routed and switched networks.
NETLAB+ supported labs are now available for CCNA 6.0 Routing and Switching – Introduction to Networks (Series 1):
Coming Soon: Labs will be made available for CCNA 6.0 Routing and Switching – Routing and Switching Essentials (release date to be announced).