Tuesday, 13 August 2019

Search help for the linux commands

Search help for the linux commands

Sometimes you need to search what certain linux command does or what arguments the command needs.

There are several ways:

1. Ask coomand itself for help

Usually by adding --h or --help to command.
[root@rifle ~]# ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all                  do not ignore entries starting with .
.
.
.

Some commands needs -help parameter.
[root@rifle ~]# zip -h
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
Zip 3.0 (July 5th 2008). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
.
.
.

  -A, --show-all           equivalent to -vET
  -b, --number-nonblank    number nonempty output lines, overrides -n

2.Using man command

[root@rifle ~]# man ls

3.Using man command --k parameter

[root@rifle ~]# man -k sysctl
_sysctl (2)          - read/write system parameters
sysctl (2)           - read/write system parameters
sysctl (8)           - configure kernel parameters at runtime
sysctl.conf (5)      - sysctl preload/configuration file
sysctl.d (5)         - Configure kernel parameters at boot
systemd-sysctl (8)   - Configure kernel parameters at boot
systemd-sysctl.service (8) - Configure kernel parameters at boot

4. Using apropos or whatis commands

[root@rifle ~]# whatis ls
ls (1)               - list directory contents
ls (1p)              - list directory contents

5.Search the web






No comments: