Linux is a name which broadly denotes a family of free and open-source software operating system distributions built around the Linux kernel.
The Linux kernel, an operating system kernel which all Linux distributions use, was first released on September 17, 1991 by Linux Torvalds.
Many Linux distributions use the word “Linux” in their name. The Free Software Foundation uses the name GNU/Linux to refer to the operating system family, as well as specific distributions, to emphasize that most Linux distributions are not just the Linux kernel, and that they have in common not only the kernel, but also numerous utilities and libraries, a large proportion of which are from the GNU project.
The development of Linux is one of the most prominent examples of free and open-source software collaboration. The underlying source code may be used, modified and distributed commercially or non-commercially by anyone under the terms of its respective licenses, such as the GNU General Public License.
Linux was first started as a clone of the MINIX operating system. Open source contributors added onto the kernel and expanded its hardware compatability. Linux’s hardware supoort and free licensing made Linux a popular choice for desktop and server computing in the mid 90s. Today, Linux is the most popular operating system in the world. It powers 90% of the world’s servers, and is the basis of Google’s popular Android operating system.
There are also many versions of Linux designed to be run on personal computers, such as Debian or Ubuntu. More importantly, these different versions of Linux (called distributions) allow the user varying degrees of personalization and control of the operating system. This means that users can choose their Linux distributions based on their wants and needs.
There is also Kali Linux which is used for advanced penetration testing and auditing. It has over 700 tools, and to be able to use it efficiently you will need to know how to use the command line. It is not advised for beginners.
Popular distributions of Linux include:
- Linux Mint
- Arch Linux
Package types are split between higher-level distributions, with Debian (.deb) and Red Hat (.rpm) being two of the most commonly used. However, there are others including Pacman (used for Arch Linux) and PetGet (Puppy Linux).
Linux distributions also come in all shapes and sizes, and most if not all offer the ability to run directly via CD / DVD in what’s known as a ‘Live CD’ environment or even directly via USB if your motherboard supports booting from USB.
For more facts about Linux, read freeCodeCamp founder Quincy Larson's article Linux is 25. Yay! Let’s celebrate with 25 stunning facts about Linux.
Some of the Best Linux Tutorials out there
You can watch this command line crash course which covers many of the most common commands.
Or Briana's Bash tutorial, which covers a wide variety of Command Line tools and commands.
Some advantages of Linux
Constant and efficient improvements.
Linux updates happen through the global collaboration of developers. Bugs are documented and resolved much quicker with this type of support. Also, since the developers are also the end-users they have the proper motivation to make sure it meets user’s needs and that it is designed to run well.
Software is only as good as the support it's given. Imagine this: a piece of software is created by the company XYZ and later down the road, they go bankrupt or get bought by another company that decides to cut its support. The software would never see improvements or fixes and therefore its usefulness would inevitably erode and die.
Linux is owned and operated by no single entity or company, so this situation cannot happen. More than that anyone is free to pick it up and contribute as well. The risk of losing support for Linux is very unlikely due to its overwhelming popularity and use.
Linux’s requirements for running on a system are much lower than that of Windows or Mac. With the right Linux distribution, a user can have a modest setup and Linux will give the system value. Disk space and memory footprint can also be lower too. Some distributions are suitable for CPUs dating back to the Pentium family, others have a requirement of as little as 128MB of RAM and around the same amount for disk space!
Heavily documented for beginners and advanced users alike.
Linux has an active community of those willing to share their knowledge and help (much like FreeCodeCamp!). There are command line utilities built into Linux that provide documentation on commands, libraries, standards, etc. (Man pages and Info pages), and there is documentation available on the Internet in a variety of formats including The Linux Documentation Project, LinuxQuestions, ServerFault, and The Arch Wiki.
There are self-paced certifications that can be taken that are recognized in the IT industry (CompTIA’s Linux+ and LPI’s LPIC tests). Although not required, learning C gives the ability for a user to review the Linux code to see what they are running.
The world depends on Linux supporting critical systems so the demand is not going away. This is important not only to those that help contribute to Linux, but also to those who support it (Jobs!). Linux support becomes more critical in IT, but also having that knowledge as a developer will make them more rounded and useful (i.e. Full stack developers).
Interoperability with other Operating Systems.
Linux has driver support for NTFS and HFS+ filesystems (used by Windows and Macs) and also Samba for file/print service support on Windows machines.
Better hardware support.
For other OSs, usually a user would have to go to the manufacturer’s website to get driver support for different types of hardware. The Linux kernel supports a majority of hardware automatically via plug-and-play (largely in part because of the open source community). Some manufacturers also develop Linux versions of their proprietary drivers which could be easily installed via the software repository of a distribution or by manually installing the provided binaries.
Linux has a rich set of applications that are available. It has office applications, web browsers (Google Chrome and Mozilla Firefox), media players, image/video processing, etc. For video gaming, Steam runs on Linux which has many supported games. Windows applications can also run within Linux (see Wine for details).
Built for development.
As Linux was originally made for developers by developers, they have spent much time and effort perfecting the tools that they would come to use.
While Linux has a “notepad” equivalent in gedit, it also provides more powerful and customizable text-based editors such as Vim and Emacs (It is that recommended Linux users know at least one of these editors).
There are also IDEs available for web-development such as Atom, Aptana/Eclipse, Sublime, KomodoIDE, to name a few. Linux also can utilize software such as Apache to setup a local web server for testing, Git for version control, and other tools/languages such as Node.js/Ruby/SaSS/Heroku all have support on Linux and have command line tools that can be used in lieu of a GUI.
Linux allows users to change desktop design and themes, add widgets and more. These changes can be done with desktop environments. Different environments have different set of options. Some popular ones are: KDE, GNOME, XFCE, Pantheon.
Hard to beat that!
Getting Started with Linux
Choosing a distribution
There are various types of Linux distributions to choose from nowadays, and choosing one is a major concern in the Linux world. Taking in consideration easy to use OSs, the top dogs in this category are:
- Ubuntu - Derivative of the stable Debian system, Ubuntu thrives in the easy to use and up to date environment.
- Mint - Based on Ubuntu and Debian, this OS has great features like Ubuntu’s PPA compatibility, the apt package manager. The base mint distribution reminds you of Windows, which can be a nice characteristic for users coming from Windows.
- Trisquel - A distribution derived from Ubuntu that focuses on only utilizing fully free software, avoiding proprietary software. Trisquel is endorsed by the Free Software Foundation (FSF).
Most Linux distributions are extremely easy to install, as all information is shown between each step of the installation.
One important step to look out for is when deciding where to install your new Linux distro. For first users it’s better to choose the “Guided” option as it will do all the work for you.
Remember to read all the steps carefully and leave some space in your HDD for the new distro - I would say about 30Gb minimum is a nice to have.
The dreaded Terminal
Linux’s terminal is not to be feared, actually it is quite easy to use with some practice and it can make your daily tasks greatly automated.
In Debian/Ubuntu and derivatives, the shortcut to open the CLI (Comman Line Interface) is “Ctrl + Alt + T”. Let’s open the terminal and try some commands.
cd (Change Directory) - The cd command is one of the commands you will use the most at the command line in linux. It allows you to change your working directory. You use it to move around within the hierarchy of your file system.
Using the cd command alone will change the current directory to your user home directory, located in “/home/username” as in “/home/mark”.
ls (List) - This command lists the content in the current directory. It can be also used to list file information.
Now we can see our directories in our home.
10 Simple and Useful Linux Commands
The commands listed here are basic, and will help you get started quickly. But they’re also powerful, and they’ll continue to be useful as your Linux expertise expands.
manShows you the manual for the command that follows it. This is very helpful when trying to figure out how an unfamiliar command works. For example, type
man lsfor everything you need to know about the
echoThis takes the text you give it and sends it somewhere—back to the screen, to a file, or to another command. Example:
catTo display the contents of a text file, just type
findIt does what it says, and it’s good at it. Use it to locate files by path, size, date, owner and a bunch of other useful filters. Example:
find . -type f -mtime -1h # List files in this directory modified in the past hour.
dateJust type date when you want to know what time it is. Example:
date "+It's %l:%m%p on %A". Use it in a script to name files according to the current date.
lsWhat’s in this directory? Combine
lswith some useful flags to display and sort directory contents by date and size. It also gives you lots of options for formatting the output.
pwdWhere am I? Linux can be unforgiving, particularly when you delete something. Make sure you know where you are before you issue your commands.
rmThis command removes files, not directories.
rm file.txtwill remove the file named "file.txt" as long as it exists and is in the current directory.
mvUse this command to move files with the command line. You can also use the
mvcommand to rename a file. For example, if you want to rename the file “text” to “new”, just run
mv text new.
echo "We're having a great time." | mail -s "Wish you were here!" -A postcard.png -t firstname.lastname@example.org
cutWhen you have a string with separators in it, use
cutto filter out certain fields. Example:
echo "this, that, and the other" | cut -d, -f2 # "that"
grepTo find lines of text that contain a certain string, use grep. Example:
grep 'root' /etc/passwd # root:x:0:0:root:/root:/bin/bash
sedto find and change a substring in a piece of text. Example:
echo "this, that, and the other" | sed 's/that/those/' # "this, those, and the other"
shutdownUse shut down the system and turn off the power. Example:
shutdown -h nowshuts down the system immediately.
shutdown -h +5shuts down the system after five minutes.
less [filename]to view contents of a file and navigate through them. By default,
lesswill go through the file page by page.
Use these commands in scripts and at the command line. They’re all very powerful commands, and Linux’s main page has a lot more information about each one.
Also, important commands used for System Administrators are following:
uptime: shows how long your system has been running and the number of users that are currently logged in. It also displays load average for 1,5 and 15 minutes intervals.
w: displays users currently logged in and their process along with load averages. Also shows the login name, tty name, remote host, login time, idle time, JCPU, PCPU, command and processes.
users: displays currently logged in users. This command doesn't have other parameters other than help and version.
who: simply returns user name, date, time and host information. The who command is similar to the w command. Unlike w, who doesn’t print what users are doing.
whoami: prints the name of the current user. You can also use “who am i” to display the current user. If you are logged in as a root, using sudo command “whoami” returns root as current user. Use “who am i” if you want to know the exact user logged in.
ls: displays a list of files in human readable format.
crontab: lists scheduled jobs for current user with crontab command and -l option.
less: allows you to quickly view a file. You can page up and down. Press ‘q‘ to quit from the less window.
more: allows you to quickly view a file and shows details in percentage. You can page up and down. Press ‘q‘ to quit out from the more window.
cp: Copy file from source to destination preserving same mode.
These are the list of commands frequently used by adiminstrator. This is not a complete list, but it’s a compact list of commands to refer to when needed.
Common terms every Linux user should know.
- Distro: it is a shortened word for ‘distribution’; and a distribution is a particular brand of GNU/Linux operating system – like Redhat, Fedora, Ubuntu, and Debian.
- Shell: this is the program that reads your command input and runs the specified commands. The dollar sign (`$’) preceding the cursor is called the shell prompt; it tells you that the system is ready and waiting for inputs in the form of commands.
- CLI: stands for Command Line Interface. It's the simple user interface that provides the services needed by the user to interact with Linux OS using text commands. It protects the user from having to know intricate hardware details.
- GUI: stands for graphic user interface. It is the part of the Linux system that comprises windows, icons, pictures (graphics in general), that make point and click possible.
- Terminal: is an application that is used to access the Linux shell.
- Kernel: this the core of the Linux system – what you could call a “brain”. The kernel controls the resources of a computer and determines how they are used by interacting directly with the computer's hardware.
- Tux: the official mascot of Linux. That is the penguin that is usually associated with Linux – if you’ve seen the yellow and black penguin online, then you have seen tux.
- Root: also known as the super-user, is the “default” username for the administrator of a linux machine. It is usually represented on the linux terminal with the ”#” symbol.
- Commands: are text inputs or instructions given to the linux machine (by typing them in the terminal) to tell it what to do (that is, for a required outcome).
- Repository: a repository (or “repo” for short) is a collection of software packages for a distro usually hosted online. Software programs can be installed from both the default repositories provided by the distro and third-party ones when they’re added to the package manager.
- Package Manager: is a software program that enables you to search, install, update, and remove apps and other application management functions. Every distro has graphics from end package managers (like the Ubuntu Software Centre) and command line package management tools like the “apt-get”.
- Dependency: a dependency is a software program that the program you want to install needs to run. When a program is being installed it gives a list of its dependencies to the default package manager to check if they are already installed, and download them from a repository if they’re not.