Book Image

Learn Linux Quickly

By : Ahmed AlKabary
Book Image

Learn Linux Quickly

By: Ahmed AlKabary

Overview of this book

Linux is one of the most sought-after skills in the IT industry, with jobs involving Linux being increasingly in demand. Linux is by far the most popular operating system deployed in both public and private clouds; it is the processing power behind the majority of IoT and embedded devices. Do you use a mobile device that runs on Android? Even Android is a Linux distribution. This Linux book is a practical guide that lets you explore the power of the Linux command-line interface. Starting with the history of Linux, you'll quickly progress to the Linux filesystem hierarchy and learn a variety of basic Linux commands. You'll then understand how to make use of the extensive Linux documentation and help tools. The book shows you how to manage users and groups and takes you through the process of installing and managing software on Linux systems. As you advance, you'll discover how you can interact with Linux processes and troubleshoot network problems before learning the art of writing bash scripts and automating administrative tasks with Cron jobs. In addition to this, you'll get to create your own Linux commands and analyze various disk management techniques. By the end of this book, you'll have gained the Linux skills required to become an efficient Linux system administrator and be able to manage and work productively on Linux systems.
Table of Contents (24 chapters)

Removing users

Sometimes a user is no longer needed to be on the system, for example, an employee leaving the company or a user that only needed temporary access to a server. In any case, you need to know how to delete users.

The last user we created was spy, right? Well, we don't need any spies on our system, so let's delete the user spy; you can delete user spy by running the command userdel spy:

root@ubuntu-linux:~# userdel spy

And just like that, user spy is deleted. However, the home directory of spy still exists:

root@ubuntu-linux:~# ls -ld /home/spy
drwxr-xr-x 2 1008 1010 4096 Apr 17 10:24 /home/spy

We would have to manually delete it:

root@ubuntu-linux:~# rm -r /home/spy

But this is inconvenient. Imagine after every user you delete, you then have to go and manually remove their home directory. Luckily, there is a better solution; you can use the -r option to automatically remove the user's home directory.

Let's give it a try with user edward:

root@ubuntu-linux...