Archive for the tag 'command'

SBDavid

The rpm command modes of operation

The rpm command modes of operation

The command used to work with RPM package files is rpm. To manage RPM packages, the rpm command has options that let you list all the packages that are installed, upgrade existing packages to newer versions, and query packages for information (such as the files or documentation included with the package). There is also a verify option to check that all files that make up the package are present and unchanged.

The rpm command has the following modes of operation:

. install (-i)
. upgrade (-U)
. freshen (-F)
. query (-q)
. verify (-V)
. signature check (–checksig)
. uninstall (-e)
. rebuild database (–rebuilddb)
. fix permissions (–setperms)
. set owners/groups (–setugids)
. show RC (–showrc)

Command line utilities for managing users and groups

useradd, userm od, userdel > Standard utilities for adding, modifying, and deleting user accounts.
groupadd, groupmod,groupdel > Standard utilities for adding, modifying, and deleting groups.

gpasswd > Standard utility for administering the /etc/group configuration file.
pwck, grpck > Utilities that can be used for verification of the password, group,and associated shadow files.

pwconv, pwunconv > Utilities that can be used for the conversion of passwords to shadow passwords, or back from shadow passwords to standard passwords

SBDavid

Bash Command line Arguments

Bash Command line Arguments

These are variables that contain the arguments to a script when it is run. These variables are accessed using $1, $2, … $n, where $1 is the first command-line argument, $2 the second, etc. Arguments are delimited by spaces. $0 is the name of the script. The variable $# will display the number of command-line arguments supplied; this number is limited to 9 arguments in the older shells, and is practically unlimited in the modern ones.

Example:

Consider a script that will take two command-line arguments and display them.

#!/bin/sh
echo “The first variable is $1″
echo “The second variable is $2
SBDavid

mdadm command for Raid

mdadm command for Raid

mdadm –create /dev/md0 –level=0 –raid-devices=2 /dev/sdb1 /dev/sdb2

This will crate raid devices level 0 with /dev/sdb1 /dev/sdb2

mdadm –query /dev/name-of-device

This will find out if a given device is a RAID array, or is part of one, and will provide brief information about the device.

mdadm –assemble –scan

This will assemble and start all arrays listed in the standard config file. This command will typically go in a system startup file.

mdadm –stop –scan

This will shut down all arrays that can be shut down (i.e. are not currently in use). This will typically go in a system shutdown script.

SBDavid

The yum history command

The yum history command

The yum history command allows users to review information about a timeline of Yum transactions, the dates and times on when they occurred, the number of packages affected, whether transactions succeeded or were aborted, and if the RPM database was changed between transactions. Additionally, this command can be used to undo or redo certain transactions.

Listing Transactions

To display a list of twenty most recent transactions, as root, either run yum history with no additional arguments, or type the following at a shell prompt:

Examples

[fedora@localhost ~]$ sudo yum history list

Loaded plugins: langpacks, presto, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
——————————————————————————-
8 | fedora | 2012-08-09 20:04 | Install | 1
7 | fedora | 2012-08-07 00:32 | Install | 40
6 | fedora | 2012-08-06 23:29 | Install | 1
5 | fedora | 2012-08-06 23:23 | Install | 3 <
4 | fedora | 2012-08-06 22:49 | Install | 5 >
3 | fedora | 2012-08-06 22:46 | Install | 2
2 | fedora | 2012-08-06 22:01 | Update | 1
1 | System | 2012-05-23 02:09 | Install | 1046
history list

Next »