0% found this document useful (0 votes)
14 views3 pages

Копия Assignment2

The document discusses various Linux commands for managing users, packages, and the GRUB bootloader configuration. It provides commands to list, add, modify and search for users. It also covers commands to install, uninstall, update, and manage packages with YUM. Finally, it discusses commands to view, edit and update the GRUB configuration file.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Копия Assignment2

The document discusses various Linux commands for managing users, packages, and the GRUB bootloader configuration. It provides commands to list, add, modify and search for users. It also covers commands to install, uninstall, update, and manage packages with YUM. Finally, it discusses commands to view, edit and update the GRUB configuration file.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

To list out all users in Linux using the awk command, you can use the following
command:

awk -F: '{ print $1 }' /etc/passwd

2. To display user and group IDs, you can use the following command:

awk -F: '{ printf "User: %-10s UID: %-5s GID: %s\n", $1, $3, $4 }' /etc/passwd

3. To add a user and assign a password, you can use the following commands:

sudo useradd username


sudo passwd username

4. User configuration files contain information such as username, user ID, group ID,
home directory, shell, and more.
5. To change the user ID for any user, you can use the following command:

sudo usermod -u new_uid username

6. The commands head and tail are used to display the first and last few lines of a
file, respectively. The numbers following the command specify the number of lines to display.
For example, head -3 /etc/passwd will display the first 3 lines of the /etc/passwd file.
7. To grep for a user in authentication files, you can use the following command:

grep username /etc/passwd /etc/shadow /etc/group /etc/gshadow

1. YUM (Yellowdog Updater, Modified) and RPM (Red Hat Package Manager) are
package management tools used in Linux. YUM is a high-level command-line utility for
managing packages, while RPM is a low-level tool for installing, uninstalling, querying, and
updating individual software packages.
2. To install a new package using YUM, you can use the following command:

sudo yum install package_name

2. To refresh the local package information, you can use:

sudo yum makecache


3. To search for packages based on keywords, you can use:

yum search keyword

4. To display a list of all installed packages, you can use:

yum list installed

5. To show information about a specific package, you can use:

yum info package_name

6. To remove a package, you can use:

sudo yum remove package_name

7. To install a group of related packages, you can use:

sudo yum groupinstall group_name

8. To display a list of enabled repositories, you can use:

yum repolist enabled

9. To enable or disable a specific repository, you can use:

sudo yum-config-manager --enable repository_name


sudo yum-config-manager --disable repository_name

10. To check for updates without installing them, you can use:

yum check-update
1. To view the Grub configuration file, you can use:

cat /etc/default/grub

2. To edit the Grub configuration file, you can use:

sudo nano /etc/default/grub

3. After editing the configuration file, you need to update Grub to apply the changes:

sudo update-grub

4. To set the default operating system or kernel to boot, you can edit the
GRUB_DEFAULT parameter in the Grub configuration file.
5. To set a password to protect the Grub menu, you can set the
GRUB_PASSWORD parameter in the Grub configuration file and generate the password using
grub2-mkpasswd-pbkdf2.
6. To change the boot timeout, you can set the GRUB_TIMEOUT parameter in the
Grub configuration file to adjust the time Grub waits for user input before booting the default
entry

You might also like