Search Engine

Loading

Sallar

Sallar
RedhatEnterpriseLinux Blog
Showing posts with label Commands Directory. Show all posts
Showing posts with label Commands Directory. Show all posts

The rsync Utility


The rsync Utility
When developing backup scripts, consider using the rsync utility. The rsync utility allows you to copy from the local system to a remote system or copy between two local directories. If the files exist in the destination directory, rsync only transfers the differences in the files, which is ideal for backups. The rsync RPM package is required and should already be installed on your system.
After the rsync command-line arguments are listed, the first directory listed is the source, and the second directory listed is the destination. If either directory is preceded by a hostname and a colon (:), the directory is a remote directory. For example, to transfer all home directories to the backup/ directory on the remote server backup.example.com:

The tar Utility and compression


 The tar Utility
When backing up data that is no longer being used or data that is not frequently changed, consider creating a compressed archive file using the tar archive utility in combination with one of the compression tools such as gzip or bzip2. Creating a compressed archive file results in one file that must be decompressed and unarchived before files can be restored from it. The compression of the files saves room on the backup media. To use tar, the tar RPM package must be installed. It should be installed on your system unless you chose to only install a specific set of packages. The tar utility does not preserve access control lists.

How to Listing USB Devices

Because USB devices are connected to a separate controller, a different command, lsusb, must be used to list them. The lsusb utility is provided by the usbutils package. Install this package via Red Hat Network.
If executed without arguments, the lsusb command displays each USB bus and any devices attached to them on a separate line as shown.
USB Device List
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000

How to Listing PCI Devices


Many devices such as network and video cards are attached to the PCI bus. It is important that the operating system load the correct driver for each device so that the proper device settings are configured. For example, if your server contains a Gigabit network card connected to a Gigabit network switch, you can use a few simple Linux utilities to verify and, if necessary, change the transfer rate of the NIC.
To list all the PCI buses on the system and all the devices attached to them, use the lspci utility from the pciutils package. Install this package via Red Hat Network.

Understanding How RPM Works


How does RPM work? Each software program consists of files and directories, most of which must be located in a particular place on the filesystem. If the software program is distributed in RPM format, these files are compressed together into one RPM file along with instructions on where the files should be located on the filesystem and any additional scripts or executables that must be run before or after the files are installed. These RPM files are often referred to as packages.
A software program, such as the Firefox web browser, might consist of one RPM file. However, some programs are divided into multiple RPM files to allow the administrator to customize which parts are necessary for the system’s usage. For example, the GNOME graphical desktop is divided into many packages that contain parts of the overall desktop.

How to Finds File in linux


There are two invaluable commands that can be used to find files on the filesystem: locate and find. The locate command is the easier of the two to use. Just type the command followed by part or all of the filename you are searching for such as locate .odt to find all OpenOffice.org text files or locate compare to find all filenames that contain the word compare. Notice that no wildcard characters are used. It is assumed that what you type may only be part of the filename you are looking for.
The only catch to this command is that it relies on the generation of a database file so it can quickly display results. The locate command is provided by the mlocate package, which also provides the cron script /etc/cron.daily/mlocate.cron to

How to Find Commands


If you know a command exists on the system but keep getting the error message command not found, check to make sure you are typing the command correctly. Otherwise, it might not be in your PATH environment variable. To view the value of your PATH, execute the command echo $PATH from the command line. As you can see, your PATH is a list of directories. When you execute a command without providing its full path, it must be in one of the directories listed in your PATH. Otherwise, the command not found error is displayed. You can provide the full path to the command if you know it, such as /sbin/lspci to execute the command to list the PCI devices. If you use the command often, but it is not in your PATH, you can add the directory to your PATH.

wget Command


NAME
       Wget - The non-interactive network downloader.
SYNOPSIS
       wget [option]... [URL]...
DESCRIPTION
       GNU Wget is a free utility for non-interactive download of files from the Web.  It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.

echo Command


NAME
       echo - display a line of text
SYNOPSIS
       echo [SHORT-OPTION]... [STRING]...
       echo LONG-OPTION
DESCRIPTION
       Echo the STRING(s) to standard output.

login Command


NAME
       login - sign on
SYNOPSIS
       login [ name ]
       login -p
       login -h hostname
       login -f name
DESCRIPTION
       login is used when signing onto a system. If an argument is not given, login prompts for the username. If  the  user  is not root, and if /etc/nologin exists, the contents of this file are printed to the

umount Command


NAME
       umount - unmount file systems
SYNOPSIS
       umount [-hV]
       umount -a [-dflnrv] [-t vfstype] [-O options]
       umount [-dflnrv] {dir|device}...
DESCRIPTION
       The umount command detaches the file system(s) mentioned from the file hierarchy.  A file system is specified by giving the directory where it has been mounted.  Giving the special device on which the file system lives may also work, but is obsolete, mainly because it will fail in case this device was mounted on more than one directory.

mount Command


NAME
       mount - mount a filesystem
SYNOPSIS
       mount [-lhV]
       mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
       mount [-fnrsvw] [-o option[,option]...]  device|dir
       mount [-fnrsvw] [-t vfstype] [-o options] device dir
DESCRIPTION
       All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /.  These files can be spread out  over  several  devices.  The mount command serves to attach the filesystem found on some device to the big file tree. Conversely, the umount(8)  command will detach it again.
The standard form of the mount command, is
              mount -t type device dir
This  tells  the kernel to attach the filesystem found on device (which is of type type) at the directory dir.  The previous contents (if  any) and  owner  and  mode  of  dir  become  invisible,  and as long as this filesystem remains mounted, the pathname dir refers to the root of  the filesystem on device.
The listing and help
              Three forms of invocation do not actually mount anything:
              mount –h          prints a help message
              mount –V          prints a version string
              mount [-l] [-t type]           lists all mounted filesystems (of type type).  The option -l adds the labels in this listing.  See below.

ejact Command


NAME
       eject - eject removable media

SYNOPSIS
       eject -h
       eject [-vnrsfmqp] [<name>]
       eject [-vn] -d
       eject [-vn] -a on|off|1|0 [<name>]
       eject [-vn] -c slot [<name>]
       eject [-vn] -i on|off|1|0 [<name>]
       eject [-vn] -t [<name>]
       eject [-vn] -T [<name>]
       eject [-vn] -x <speed> [<name>]
       eject [-vn] -X [<name>]
       eject -V
DESCRIPTION
       Eject allows removable media (typically a CD-ROM, floppy disk, tape, or JAZ or ZIP disk) to be

Cal Command


NAME
     cal - displays a calendar
SYNOPSIS
     cal [-smjy13] [[[day] month] year]
DESCRIPTION
     Cal displays a simple calendar.  If arguments are not specified, the current month is displayed.  The options are as follows:
     -1      Display single month output.  (This is the default.)
     -3      Display prev/current/next month output.
     -s      Display Sunday as the first day of the week.
     -m     Display Monday as the first day of the week.
     -j       Display Julian dates (days one-based, numbered from January 1).
     -y      Display a calendar for the current year.
    -V         Display version information and exit.

Cat Command


NAME
       cat - concatenate files and print on the standard output
SYNOPSIS
       cat [OPTION]... [FILE]...
DESCRIPTION
       Concatenate FILE(s), or standard input, to standard output.
       -A, --show-all                    equivalent to -vET
       -b, --number-nonblank     number nonempty output lines
       -e     equivalent to –vE
       -E, --show-ends                display $ at end of each line
       -n, --number                     number all output lines

Touch Command


NAME
       touch - change file timestamps
SYNOPSIS
       touch [OPTION]... FILE...
DESCRIPTION
       Update the  access  and modification times of each FILE to the current time. A FILE argument that does not exist is created empty, unless -c  or  -h is supplied.
A  FILE argument  string of - is handled specially and causes touch to change the times of the file associated with standard output.
       Mandatory arguments to long options are mandatory  for  short  options too.

mkdir Command


NAME
       mkdir - make directories
SYNOPSIS
       mkdir [OPTION]... DIRECTORY...
DESCRIPTION
       Create the DIRECTORY(ies), if they do not already exist. Mandatory  arguments  to  long  options are mandatory for short options too.

rm Command


NAME
       rm - remove files or directories

SYNOPSIS
       rm [OPTION]... FILE...

DESCRIPTION
       This manual  page  documents  the  GNU version of rm.  rm removes each specified file.  By default, it does not remove directories.
If the -I or --interactive=once option is given,  and  there  are  more than  three  files  or  the  -r,  -R, or - -recursive are given, then rm prompts the user for whether to proceed with the entire operation.   If        the response is not affirmative, the entire command is aborted. Otherwise,  if  a file is unwritable, standard input is a terminal, and the -f or --force  option  is  not  given,  or  the  -i  or  --interactive=always  option is given, rm prompts the user for whether to remove the file.  If the response is not affirmative, the file is skipped.

mv Command


NAME
       mv - move (rename) files
SYNOPSIS
       mv [OPTION]... [-T] SOURCE DEST
       mv [OPTION]... SOURCE... DIRECTORY
       mv [OPTION]... -t DIRECTORY SOURCE...
DESCRIPTION
       Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. Mandatory arguments to long options are mandatory for short options too.
       --backup [=CONTROL]                 make a backup of each existing destination file
       -b                                                  like --backup but does not accept an argument
       -f, --force                                                  do not prompt before overwriting

CP Command


NAME
       cp - copy files and directories
SYNOPSIS
       cp [OPTION]... [-T] SOURCE DEST
       cp [OPTION]... SOURCE... DIRECTORY
       cp [OPTION]... -t DIRECTORY SOURCE...
DESCRIPTION
       Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. Mandatory  arguments  to  long  options are mandatory for short options too.
      -a, --archive                                  same as -dR --preserve=all
       --backup[=CONTROL]      make a backup of each existing destination file
       -b     like --backup            but does not accept an argument

Powered by Blogger.

Ads

 
Copyright © Redhat Enterprise linux. Original Concept and Design by My Blogger Themes
My name is Abdul Razaq but people call me Raziq. Here is my home page: www.redhatenterpriselinux.blogspot.com I live in Quetta, Pakistan and work as an IT-Engineer.