- Getting Better at Linux With 10 Mini-Projects
- 1. UNIX — Recat
- 2. What is a shell? — SeaShell
- 3. Ownership and permissions — Tellaccess
- 4. Grep — Grep detective
- 5. Awk and sed — Passwdinfo
- 6. Find — Find treasure hunt
- 7. File system — Root tour
- 8. Processes — Stranger danger
- 9. Systemd services — Createservice
- 10. Bash scripting — Penguin cipher
- How to be good at linux
- 13 exercises to boost your Linux skills
- Career advice
- 1. Choose Linux
- 2. Install at least three distributions
- 3. Adjust user permissions
- 4. Use text editors
- 5. Manage users and groups
Getting Better at Linux With 10 Mini-Projects
All the source code for the projects can be found in this GitHub repository.
1. UNIX — Recat
The first thing I wanted to learn more about was UNIX since Linux is a UNIX-like operating system. I also never really felt that I fully understood what exactly UNIX was, besides being a family of fairly similar operating systems.
The first thing I did was to read the entire Wikipedia page on UNIX. I also read this original paper written by Dennis Ritchie and Ken Thompson from 1974, which was really interesting though I can’t say I understood all of it. After some more reading and some Youtube videos, I felt comfortable that I understood what UNIX was, and what makes it interesting.
For the project, I decided to try and write my first C program. Following the Unix philosophy, I made sure that it did one thing only. That thing ended up being a program that reverses the contents of a text file. Since this is just a reverse version of cat, I called the program recat.
2. What is a shell? — SeaShell
For this project, I was curious to find out what exactly a shell was. Even though it is something that I use often, I was still confused about what differentiates it from the terminal. Turns out it’s really not that complicated. I learned this by rereading the shell part of the paper from the previous project, and some explanations online like this and this one. The Unix shell Wikipedia entry was also very informative.
Since this project is about the shell, I found it appropriate to try and write my own. I settled on the name SeaShell, which I found way too funny. It’s not very advanced, but it does the job.
3. Ownership and permissions — Tellaccess
This is one of the things that I know is really important for Linux, but have never really understood. I have tried before but never been able to get the knowledge to stick, maybe because I didn’t really care about security until now.
The ownership and permission system turned out to be really intuitive, and I was able to understand the basics from this one article. I later discovered this one from Linux Handbook which was more comprehensive.
For the project, I decided to create a program that tells you in human-readable form, the ownership and permissions of a file. I called the project tellaccess because it tells you who can access the file in what ways.
4. Grep — Grep detective
Grep is the sort of UNIX magic I have always wanted to learn. Since grep is all about regular expressions I would have to learn that first. This was actually quite difficult because grep uses the POSIX Basic Regular Expressions, which is not that common. The Wikipedia entry was a lifesaver. Besides that, I also used the man page for grep as a reference.
For the project, I thought that a fun idea might be to create a detective game. In the game, you get a folder full of files, and it’s your job to extract information. I called the game Grep detective.
5. Awk and sed — Passwdinfo
Awk and sed are more of the UNIX magic that I have always thought was really cool, though I never really understood what they were used for. I often saw answers on Stack Overflow with people using them in crazy one-liners, but I always copy-pasted them without much thought. Well, time to unravel the mystery.
I primarily used this paper to learn about them. For the project, I wanted to create my own one-liner that shows information about the users on your system in a clear way. I found just reading the /etc/passwd a little too messy, so the project passwdinfo, displays the most important information in a neat table. I found information about the /etc/passwd file here.
6. Find — Find treasure hunt
Another important tool I never really got around to learning. Learning how to use find was fairly easy, it was mostly about memorizing the different flags, and the format you set the flags in. I used this as a reference.
For the project, I created a treasure hunt where you look for clues in files with different attributes. I first wrote a script that created a bunch of small files and directories as noise. Then a selected few of the files got clues to the whereabouts of the other ones. In the end, you find the treasure, which I won’t tell you what is.
7. File system — Root tour
Ever since I executed my first ls / I have wondered what all those directories were for. Time to unveil the mystery. The first thing I did was read this article as it explained each directory in root and provided a nice graph. This resource was also nice since it had a table that summed up each directory in one or two sentences.
The project ended up being a program that gives you descriptions for directories in your own root folder.
8. Processes — Stranger danger
Processes are another important element of Linux that I have never gotten around to learning. Like many other subjects I have covered here, it turned out to be fairly intuitive. This article was really easy to understand.
I was contemplating for a while what kind of project I could create but ultimately came up with a command that prints all processes that don’t belong to you or root. That way, you can keep a close eye on who is creating processes. Note, there are many legitimate reasons that other users would run processes on your system, and it rarely means someone has gained access to your computer.
9. Systemd services — Createservice
Whenever I try to set up a database on a Linux machine I have been confused about how to configure the systemd service. I have also been in situations where I needed to create a service from a binary but always struggled. The struggle ends now. As with any new subject, it’s always a good idea to read the Wikipedia page, so that is where I started. Surprisingly, I learned that systemd is a quite controversial piece of software, but I still wanted to learn it and judge it for myself. For understanding the basics of systemd I read this and for understanding how to create a new service I read this.
For the project, I made createservice, which allows you to make a systemd service from any executable that will automatically start up on boot. Here I test it out on Prometheus:
10. Bash scripting — Penguin cipher
Bash scripting is something I have been avoiding for a long time. Partly because I believe that my programming language of choice, Go, is almost as handy when it comes to scripting, and partly because I think that Bash syntax looks horrible. Can’t knock it till you try it, so here I am trying to learn Bash scripting.
This was a nice introduction, and after finding this cool cheatsheet I felt comfortable trying to create a project.
The project ended up being a cipher program I called Penguin cipher after Linux’s mascot. It allows you to encrypt text into something like this: MTExIDIxMSAzMTMgNDAyIDQ2OCA0NjQgMTU5IDI0MSAyMzAgMzY3IDM3NCA1MjYgMTM3IDIyMiAyOTUgMzYzIDQzNCA0MzUg
How to be good at linux
We are private in protest of the API changes. https://www.theverge.com/2023/6/8/23754780/reddit-api-updates-changes-news-announcements Don’t message us for access, everyone is blocked out site-wide. See http://redd.it/1476ioa for more info.
I’ve been trying to improve my Linux skills for some time now, and i am improving, but want to get even better.
so what I’m looking for is pointers on how to improve my understanding of how the system works/is configured. things i am doing to help my self:
- installed and configured archlinux to run (instead of easy-install distro’s)
- using fluxbox, in order to «force» myself to use the command line more
- using more terminal-based programs, e.g. irssi instead of xchat or similar.
- utilizing command line commands(is that correct?) to move, rename, check files etc.
- reading/configuring config files and general system stuff(mounting different places, different things) to get a better idea of what they do.
some of these overlap, and are hard to distinct, but I’ve tried.
- install multiple linux distros on various mostly old/new machines.
- set up full home network with multiple linux machines and windows machines(currently only used on windows-windows).
- set up boot from network image
- mount from remote transferring /home from other computers
- set up ssh client for remote use, preferably using only command line(no x)
that’s all can think of right now, is there a general guide somewhere? and what am i doing wrong/right, and how can I improve?
13 exercises to boost your Linux skills
Work through this Linux fundamentals checklist to make sure you’re ready for whatever comes your way at home, at work, or on certification exams.
Many authors have provided Enable Sysadmin readers with reasons for building a home lab environment or guidance on creating lab environments using virsh, Ansible, and even containers. So, now that you know a home lab is good for you and you’ve used the articles to construct a great setup, what’s next?
Career advice
When I teach, I provide my students with a self-paced lab workbook that offers suggested skills in a logical order that they can use to enhance their Linux knowledge or prepare for certification exams. I’ve modified that workbook for this article to give you 13 things to do with your shiny new Linux lab environment.
This is an immense set of guidelines. Furthermore, there are no step-by-step instructions. In fact, that’s the point. You must research and teach yourself these tasks if you don’t already know how to accomplish them—just like in the real world.
There are Enable Sysadmin articles that cover some of the tasks. The lesson is not that you must know all these answers, but that you must know how to find all these answers. You don’t have to do every section, though some do rely on others.
1. Choose Linux
A home lab can serve many purposes, and you need some idea of what you want to use your lab to achieve.
- If you’re just exploring what’s possible on Linux, installing CentOS Stream or Fedora offers you a flexible environment. You can install either of these distributions on a spare computer, a Raspberry Pi, or as a virtual machine (VM) or container.
- If you want your journey to begin at its destination, you can install Red Hat Enterprise Linux (RHEL) on a supported platform. This gets you started with enterprise-quality Linux, which means that once you perfect your setup, it’s ready to migrate into production.
All these distributions derive from Fedora, so the installation process is basically the same regardless which you choose. You can follow our introductory guide if you’re not sure how to start. Use this information to select the distributions to install in the next task and to better understand the Linux landscape.
2. Install at least three distributions
- Create separate boot, var, home, swap, and filesystem root partitions (five partitions total). Leave at least 100MB of empty, unused, unpartitioned hard disk space for a future task.
- Choose whatever desktop graphical user interfaces (GUIs) are available for your selected distributions.
- Create a user during installation, and make that user the administrator. This grants the user sudo permissions.
- Once installation is complete, explore the built-in help features:
- Use man pages to research the fstab file.
- What are the differences between the various man page sections? Admins primarily use sections 1, 5, and 8—why?
- How can you do a keyword search within man pages?
- What can be found at /usr/share/doc ?
- Explore whatever GUI help files might be available.
[ Always keep the Linux commands cheat sheet close at hand while you’re learning and working. ]
3. Adjust user permissions
- Log in using the user account you created during installation. Use the sudo command to gain root privileges when you need to perform systemwide administrative tasks. This is an important best practice in Linux administration.
- Adjust the privileges assigned to your user account by using the sudo command. You need to edit the /etc/sudoers file by using the visudo command.
4. Use text editors
- Create a certification study plan by using Vim. List tasks that you intend to accomplish as part of your Linux skill development.
- List three (or more) resources by using the Nano text editor.
- List three Linux skills you are confident in and three Linux skills you are not confident in using a GUI text editor. This should be the only time you use a GUI editor during this entire activity.
5. Manage users and groups
- Use the /etc/skel directory to define profile settings before adding any user accounts.
- Set password and account expirations using the /etc/login.defs file before adding any user accounts. Use the following password requirements:
- Passwords should expire after 90 days, with a five-day warning period.