Kali, Kernal, Linux, Linux commands, security

LINUX(For Beginners) EP-2

Managing Users and Groups in Linux:

Every computer system, including Linux, has users. Yes, you read that right; you are a user too! In this blog post, we’ll dive into the fascinating world of Linux users and groups and explore how you can manage them like a true superhero.

Adding a User

Adding a user to your Linux system is a straightforward process, but there’s a catch. Only the all-powerful ‘root’ user can add new users.

However, before we add our new user, let’s take a moment to understand who or what ‘root’ is. ‘root’ is another user on your system, but it holds superuser privileges. To add a user, we need to use ‘sudo‘ which stands for “superuser do.”

your new user has been added to the system. But where can you find all the users on your Linux machine? You can check by using the following command:

You can see User with the name “david”. the ‘x’ you see under the ‘User’ column represents the password. The actual passwords are stored in /etc/shadow and are hidden from view.

To get more information about users, you can check /etc/shadow. Additionally, you’ll notice two numbers associated with each user: the User ID (UID) and the Group ID (GID). When you create a user in Linux, it automatically creates a user and a group with the same name.

Customizing User

Linux gives us the flexibility to customize user properties. For example, we can change the shell assigned to a user by using the following command:

To change the username itself:

You can also perform more advanced user modifications using

Managing Groups

Linux also allows you to create and manage groups. To create a new group, use the following command:

To view all the groups on your system:

But what’s the use of a group without power? To grant superpowers to a group, add it to the sudoers file:

Open sudoiers file by following command:

Add the following line to give the group unlimited power:

%groupname ALL = NOPASSWD:ALL

Now, any member of that group can execute superuser commands without a password prompt.

Adding Users to Groups

The real fun begins when you start adding users to groups. Use this command to add a user to a group:

The -aG flag appends the user to the specified group, while ensuring they remain members of their existing groups.

Removing Users from Groups

To remove a user from a group:

Deleting Users and Groups

Finally, when you’re done with a user, you can delete them using:

And to delete a group:

In the world of Linux, managing users and groups is crucial for system security and organization. With these commands at your fingertips, you can wield the power of the gauntlet and make your Linux system dance to your tune.

Kernal, Linux commands, Uncategorized

LINUX(For Beginners) EP-1

Terminal:

The terminal isn’t just a simple terminal; it’s more like a terminal emulator. It’s a physical tool, much like a keyboard or monitor, used for interacting with the Shell through commands. The Shell is the user interface we use to communicate with the Linux operating system’s core, known as the Linux kernel. There are various shells available, such as bash and zsh.

You can identify which shell you’re using by executing the following command:

Mastering the Art of Linux Commands:

Now, let’s say you’re not so great at remembering all those complex commands. When you need assistance with any command, you can consult the manual by using the “man” command. For example:

if you’re unsure about how the “ls” command works, type:

Now, imagine you’re typing a command, like “Uname,” and you forget how it works. To get help with that specific command, you can use:

The Secret Weapon: “Apropos”

Sometimes, you may not even know which command to use for a specific task. In such cases, there’s a secret weapon – the “apropos” command. It helps you find the right command based on your intent.

For instance, if you need to discover what devices are connected to your computer through USB but can’t recall the command, try this:

Similarly, if you’re on a quest to find the perfect command for compressing a file, simply enter:

In simple terms, the terminal is like a communication tool that lets you talk to your computer’s core. If you forget a command or need help finding the right one, just use “man” or “apropos” to get the information you need. It’s like having a handy guide to navigate your way through Linux.

Kernal, Linux, Linux commands

LINUX(For Beginners)

Introduction:

In the world of operating systems, Linux stands tall as an open-source (open and free to use) powerhouse. With its flexibility, security, and diverse community, Linux has become a prominent player in both personal and enterprise computing.

The Linux terminal stands as a powerful gateway to the heart of your operating system. Unlike the graphical user interface (GUI), where your current location is visually apparent, the terminal requires a different approach, This is where the pwd (present working directory) command comes into play.

So I’m right here in home/kali directory.

If you want to see stuff in your current working directory for that there is a command

ls(list) it just list the content of your current working directory.

Let say if you want to go inside in Desktop directory we have a cd(change directory) command.

In the next blog we’ll talk about linux file system. See you in the next blog as we continue our Linux adventure!

Uncategorized

BASIC LINUX COMMANDS FOR TEXT MANIPULATION

Hello Linux folks, In this blog I’ll tell you about some basic Linux text manipulation commands.

1: echo

The echo command is used to display a line of text to the standard output(stdout).

2: printf

The printf command is used to format and print data to the standard output.

3: cat

Cat is used to concatenate files and print their contents to standard output. In other words, it simply displays the contents of a file.

You know there is a modern version of cat (batcat) with syntax highlighting.

4: tac

The tac command, like the cat command, concatenates and prints file contents in reverse order. The name suggests that this command is the inverse of the popular cat command.

5: paste


The paste command, like the cat command, merges lines in a file into a single large line.

6: head


This command shows the first section of a file. Assume we have a lengthy file and you only want to see the first few lines. This is where the head command comes in; the head command, by default, displays the first 10 lines of a file.

If you only want to see the first 5 lines.

7: tail

The tail command, like the head command, displays the last 10 lines of a file by default. However, you can change it and specify the number of lines to display. I’ve chosen to show the last 5 lines in this case.

8: rev

This command reverses lines characterwise.

9: sort


The sort command is very useful for sorting files, and text lines.

The sort command also has the capability of sorting in reverse order by using its -r option.

you can use the sort command to remove repeated lines, resulting in only unique lines. This is done by using the sort command with -u option.

10: wc

Word Count (wc) prints the number of lines, words, and bytes respectively in each file.

You can also specify what you want to display by using the l-, -w, or -c options, which will display the number of lines, words, or characters (bytes) respectively.

11: nl

The nl (number lines) is another command It displays the contents of a file as well as line numbers.

12: grep

The grep command is one of the most common text processing commands you will use. It allows you to search files for characters that match a certain pattern.