SEESenv/web/html/ch9Using_Linux_Tools.html
author amit@thunder
Sun, 21 Feb 2010 13:14:37 +0530
changeset 6 1ce9b33fb6ff
parent 2 52d12eb31c30
child 15 f2383fee6584
permissions -rw-r--r--
sorted the problem related to paths
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
     1
<html>
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     2
 <head>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     3
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     4
  <title>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     5
   Chapter. Using_Linux_Tools
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     6
  </title>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     7
  <link rel="stylesheet" href="hgbook.css" type="text/css" />
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     8
  <meta name="generator" content="DocBook XSL Stylesheets V1.75.1" />
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
     9
 </head>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    10
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    11
  <div class="chapter" id="Using_Linux_Tools">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    12
   <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    13
   </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    14
   <div class="toc">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    15
    <p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    16
     <b>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    17
      Table of Contents
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    18
     </b>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    19
    </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    20
    <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    21
     <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    22
      <span class="article">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    23
       <a href="#id2438728">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    24
       </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    25
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    26
     </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    27
     <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    28
      <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    29
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    30
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    31
         <a href="#id2248853">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    32
          1. Introducing Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    33
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    34
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    35
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    36
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    37
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    38
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    39
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    40
           <a href="#id2438532">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    41
            1.1. Historical Background
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    42
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    43
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    44
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    45
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    46
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    47
           <a href="#id2489779">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    48
            1.2. Design and Implications
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    49
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    50
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    51
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    52
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    53
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    54
           <a href="#id2490190">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    55
            1.3. Reasons for Using Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    56
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    57
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    58
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    59
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    60
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    61
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    62
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    63
         <a href="#id2490330">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    64
          2. Getting Started
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    65
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    66
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    67
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    68
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    69
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    70
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    71
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    72
           <a href="#id2490339">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    73
            2.1. Logging in, activating the user interface and logging out
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    74
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    75
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    76
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    77
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    78
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    79
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    80
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    81
         <a href="#id2490619">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    82
          3. Basic Commands
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    83
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    84
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    85
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    86
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    87
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    88
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    89
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    90
           <a href="#id2490627">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    91
            3.1. ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    92
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    93
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    94
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    95
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    96
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    97
           <a href="#id2490791">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    98
            3.2. date
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
    99
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   100
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   101
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   102
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   103
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   104
           <a href="#id2490852">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   105
            3.3. cd
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   106
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   107
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   108
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   109
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   110
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   111
           <a href="#id2490955">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   112
            3.4. who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   113
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   114
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   115
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   116
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   117
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   118
           <a href="#id2491038">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   119
            3.5. mkdir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   120
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   121
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   122
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   123
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   124
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   125
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   126
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   127
         <a href="#id2491219">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   128
          4. Getting Help
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   129
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   130
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   131
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   132
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   133
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   134
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   135
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   136
           <a href="#id2491227">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   137
            4.1. apropos and whatis
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   138
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   139
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   140
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   141
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   142
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   143
           <a href="#id2491311">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   144
            4.2. man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   145
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   146
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   147
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   148
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   149
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   150
           <a href="#id2491522">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   151
            4.3. info
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   152
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   153
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   154
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   155
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   156
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   157
           <a href="#id2491614">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   158
            4.4. --help
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   159
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   160
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   161
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   162
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   163
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   164
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   165
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   166
         <a href="#id2491666">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   167
          5. Basic file handling
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   168
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   169
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   170
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   171
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   172
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   173
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   174
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   175
           <a href="#id2491675">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   176
            5.1. cp
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   177
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   178
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   179
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   180
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   181
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   182
           <a href="#id2491990">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   183
            5.2. mv
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   184
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   185
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   186
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   187
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   188
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   189
           <a href="#id2492122">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   190
            5.3. rm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   191
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   192
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   193
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   194
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   195
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   196
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   197
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   198
         <a href="#id2492294">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   199
          6. Command Line Arguments
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   200
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   201
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   202
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   203
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   204
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   205
         <a href="#id2492388">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   206
          7. Basic Text Processing
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   207
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   208
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   209
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   210
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   211
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   212
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   213
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   214
           <a href="#id2492396">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   215
            7.1. head
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   216
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   217
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   218
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   219
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   220
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   221
           <a href="#id2492483">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   222
            7.2. tail
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   223
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   224
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   225
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   226
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   227
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   228
           <a href="#id2492611">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   229
            7.3. cut
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   230
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   231
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   232
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   233
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   234
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   235
           <a href="#id2492698">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   236
            7.4. paste
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   237
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   238
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   239
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   240
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   241
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   242
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   243
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   244
         <a href="#id2492832">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   245
          8. Shell Meta Characters
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   246
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   247
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   248
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   249
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   250
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   251
         <a href="#id2492941">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   252
          9. Looking At Files
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   253
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   254
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   255
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   256
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   257
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   258
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   259
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   260
           <a href="#id2492949">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   261
            9.1. cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   262
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   263
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   264
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   265
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   266
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   267
           <a href="#id2493137">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   268
            9.2. more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   269
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   270
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   271
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   272
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   273
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   274
           <a href="#id2493248">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   275
            9.3. less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   276
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   277
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   278
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   279
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   280
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   281
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   282
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   283
         <a href="#id2493498">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   284
          10. Directory Structure
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   285
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   286
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   287
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   288
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   289
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   290
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   291
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   292
           <a href="#id2493772">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   293
            10.1. man hier
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   294
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   295
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   296
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   297
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   298
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   299
           <a href="#id2493788">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   300
            10.2. ls -l
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   301
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   302
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   303
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   304
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   305
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   306
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   307
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   308
         <a href="#id2493811">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   309
          11. Permissions and Ownership
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   310
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   311
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   312
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   313
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   314
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   315
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   316
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   317
           <a href="#id2493820">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   318
            11.1. chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   319
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   320
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   321
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   322
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   323
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   324
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   325
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   326
         <a href="#id2494598">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   327
          12. Redirection and Piping
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   328
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   329
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   330
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   331
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   332
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   333
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   334
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   335
           <a href="#id2494633">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   336
            12.1. Redirecting standard input and standard output
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   337
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   338
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   339
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   340
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   341
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   342
           <a href="#id2494702">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   343
            12.2. Piping
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   344
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   345
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   346
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   347
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   348
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   349
           <a href="#id2494764">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   350
            12.3. Redirecting to and from the standard file handles
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   351
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   352
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   353
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   354
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   355
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   356
           <a href="#id2494971">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   357
            12.4. Chained pipelines
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   358
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   359
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   360
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   361
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   362
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   363
           <a href="#id2495005">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   364
            12.5. Redirect to multiple outputs
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   365
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   366
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   367
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   368
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   369
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   370
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   371
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   372
         <a href="#id2495036">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   373
          13. More Text Processing
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   374
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   375
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   376
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   377
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   378
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   379
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   380
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   381
           <a href="#id2495045">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   382
            13.1. grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   383
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   384
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   385
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   386
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   387
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   388
           <a href="#id2495235">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   389
            13.2. tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   390
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   391
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   392
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   393
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   394
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   395
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   396
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   397
         <a href="#id2495386">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   398
          14. Elementary Regex
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   399
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   400
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   401
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   402
       <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   403
        <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   404
         <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   405
          <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   406
           <a href="#id2495602">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   407
            14.1. Lazy quantification
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   408
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   409
          </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   410
         </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   411
        </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   412
       </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   413
       <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   414
        <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   415
         <a href="#id2495679">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   416
          15. One Liners
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   417
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   418
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   419
       </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   420
      </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   421
     </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   422
    </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   423
   </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   424
   <div class="article">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   425
    <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   426
     <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   427
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   428
       <h2 class="title" id="id2438728">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   429
       </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   430
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   431
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   432
     <hr />
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   433
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   434
    <div class="toc">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   435
     <p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   436
      <b>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   437
       Table of Contents
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   438
      </b>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   439
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   440
     <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   441
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   442
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   443
        <a href="#id2248853">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   444
         1. Introducing Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   445
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   446
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   447
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   448
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   449
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   450
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   451
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   452
          <a href="#id2438532">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   453
           1.1. Historical Background
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   454
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   455
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   456
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   457
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   458
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   459
          <a href="#id2489779">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   460
           1.2. Design and Implications
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   461
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   462
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   463
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   464
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   465
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   466
          <a href="#id2490190">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   467
           1.3. Reasons for Using Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   468
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   469
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   470
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   471
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   472
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   473
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   474
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   475
        <a href="#id2490330">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   476
         2. Getting Started
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   477
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   478
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   479
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   480
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   481
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   482
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   483
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   484
          <a href="#id2490339">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   485
           2.1. Logging in, activating the user interface and logging out
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   486
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   487
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   488
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   489
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   490
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   491
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   492
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   493
        <a href="#id2490619">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   494
         3. Basic Commands
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   495
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   496
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   497
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   498
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   499
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   500
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   501
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   502
          <a href="#id2490627">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   503
           3.1. ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   504
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   505
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   506
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   507
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   508
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   509
          <a href="#id2490791">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   510
           3.2. date
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   511
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   512
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   513
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   514
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   515
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   516
          <a href="#id2490852">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   517
           3.3. cd
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   518
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   519
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   520
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   521
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   522
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   523
          <a href="#id2490955">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   524
           3.4. who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   525
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   526
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   527
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   528
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   529
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   530
          <a href="#id2491038">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   531
           3.5. mkdir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   532
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   533
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   534
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   535
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   536
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   537
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   538
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   539
        <a href="#id2491219">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   540
         4. Getting Help
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   541
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   542
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   543
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   544
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   545
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   546
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   547
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   548
          <a href="#id2491227">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   549
           4.1. apropos and whatis
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   550
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   551
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   552
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   553
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   554
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   555
          <a href="#id2491311">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   556
           4.2. man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   557
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   558
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   559
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   560
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   561
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   562
          <a href="#id2491522">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   563
           4.3. info
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   564
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   565
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   566
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   567
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   568
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   569
          <a href="#id2491614">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   570
           4.4. --help
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   571
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   572
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   573
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   574
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   575
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   576
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   577
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   578
        <a href="#id2491666">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   579
         5. Basic file handling
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   580
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   581
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   582
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   583
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   584
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   585
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   586
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   587
          <a href="#id2491675">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   588
           5.1. cp
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   589
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   590
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   591
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   592
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   593
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   594
          <a href="#id2491990">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   595
           5.2. mv
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   596
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   597
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   598
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   599
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   600
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   601
          <a href="#id2492122">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   602
           5.3. rm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   603
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   604
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   605
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   606
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   607
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   608
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   609
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   610
        <a href="#id2492294">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   611
         6. Command Line Arguments
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   612
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   613
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   614
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   615
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   616
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   617
        <a href="#id2492388">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   618
         7. Basic Text Processing
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   619
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   620
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   621
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   622
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   623
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   624
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   625
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   626
          <a href="#id2492396">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   627
           7.1. head
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   628
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   629
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   630
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   631
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   632
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   633
          <a href="#id2492483">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   634
           7.2. tail
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   635
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   636
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   637
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   638
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   639
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   640
          <a href="#id2492611">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   641
           7.3. cut
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   642
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   643
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   644
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   645
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   646
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   647
          <a href="#id2492698">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   648
           7.4. paste
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   649
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   650
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   651
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   652
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   653
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   654
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   655
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   656
        <a href="#id2492832">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   657
         8. Shell Meta Characters
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   658
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   659
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   660
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   661
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   662
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   663
        <a href="#id2492941">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   664
         9. Looking At Files
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   665
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   666
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   667
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   668
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   669
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   670
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   671
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   672
          <a href="#id2492949">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   673
           9.1. cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   674
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   675
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   676
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   677
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   678
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   679
          <a href="#id2493137">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   680
           9.2. more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   681
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   682
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   683
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   684
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   685
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   686
          <a href="#id2493248">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   687
           9.3. less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   688
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   689
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   690
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   691
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   692
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   693
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   694
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   695
        <a href="#id2493498">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   696
         10. Directory Structure
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   697
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   698
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   699
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   700
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   701
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   702
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   703
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   704
          <a href="#id2493772">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   705
           10.1. man hier
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   706
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   707
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   708
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   709
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   710
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   711
          <a href="#id2493788">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   712
           10.2. ls -l
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   713
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   714
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   715
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   716
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   717
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   718
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   719
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   720
        <a href="#id2493811">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   721
         11. Permissions and Ownership
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   722
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   723
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   724
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   725
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   726
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   727
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   728
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   729
          <a href="#id2493820">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   730
           11.1. chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   731
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   732
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   733
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   734
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   735
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   736
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   737
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   738
        <a href="#id2494598">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   739
         12. Redirection and Piping
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   740
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   741
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   742
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   743
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   744
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   745
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   746
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   747
          <a href="#id2494633">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   748
           12.1. Redirecting standard input and standard output
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   749
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   750
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   751
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   752
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   753
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   754
          <a href="#id2494702">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   755
           12.2. Piping
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   756
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   757
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   758
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   759
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   760
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   761
          <a href="#id2494764">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   762
           12.3. Redirecting to and from the standard file handles
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   763
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   764
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   765
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   766
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   767
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   768
          <a href="#id2494971">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   769
           12.4. Chained pipelines
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   770
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   771
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   772
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   773
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   774
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   775
          <a href="#id2495005">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   776
           12.5. Redirect to multiple outputs
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   777
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   778
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   779
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   780
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   781
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   782
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   783
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   784
        <a href="#id2495036">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   785
         13. More Text Processing
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   786
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   787
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   788
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   789
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   790
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   791
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   792
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   793
          <a href="#id2495045">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   794
           13.1. grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   795
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   796
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   797
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   798
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   799
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   800
          <a href="#id2495235">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   801
           13.2. tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   802
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   803
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   804
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   805
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   806
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   807
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   808
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   809
        <a href="#id2495386">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   810
         14. Elementary Regex
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   811
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   812
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   813
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   814
      <dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   815
       <dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   816
        <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   817
         <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   818
          <a href="#id2495602">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   819
           14.1. Lazy quantification
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   820
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   821
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   822
        </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   823
       </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   824
      </dd>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   825
      <dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   826
       <span class="section">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   827
        <a href="#id2495679">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   828
         15. One Liners
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   829
        </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   830
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   831
      </dt>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   832
     </dl>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   833
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   834
    <div class="section" title="1.Introducing Linux">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   835
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   836
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   837
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   838
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   839
         <a name="id2248853">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   840
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   841
         1.Introducing Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   842
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   843
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   844
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   845
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   846
     <p id="ch9Using_Linux_Tools_1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   847
      (Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   848
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   849
     <p id="ch9Using_Linux_Tools_2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   850
      Linux (usually pronounced lnks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   851
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   852
     <p id="ch9Using_Linux_Tools_3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   853
      Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   854
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   855
     <p id="ch9Using_Linux_Tools_4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   856
      The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   857
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   858
     <div class="section" title="1.1.Historical Background">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   859
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   860
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   861
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   862
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   863
          <a name="id2438532">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   864
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   865
          1.1.Historical Background
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   866
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   867
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   868
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   869
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   870
      <div class="section" title="1.1.1.Events leading to the creation">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   871
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   872
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   873
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   874
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   875
           <a name="id2436514">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   876
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   877
           1.1.1.Events leading to the creation
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   878
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   879
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   880
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   881
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   882
       <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   883
        <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   884
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   885
          <p id="ch9Using_Linux_Tools_5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   886
           The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   887
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   888
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   889
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   890
          <p id="ch9Using_Linux_Tools_6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   891
           In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   892
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   893
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   894
        </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   895
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   896
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   897
      <div class="section" title="1.1.2.The Creation of Linux">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   898
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   899
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   900
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   901
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   902
           <a name="id2489744">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   903
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   904
           1.1.2.The Creation of Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   905
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   906
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   907
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   908
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   909
       <p id="ch9Using_Linux_Tools_7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   910
        In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   911
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   912
       <p id="ch9Using_Linux_Tools_8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   913
        Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   914
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   915
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   916
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   917
     <div class="section" title="1.2.Design and Implications">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   918
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   919
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   920
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   921
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   922
          <a name="id2489779">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   923
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   924
          1.2.Design and Implications
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   925
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   926
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   927
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   928
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   929
      <p id="ch9Using_Linux_Tools_9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   930
       A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   931
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   932
      <div class="section" title="1.2.1.User Interface">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   933
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   934
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   935
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   936
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   937
           <a name="id2489804">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   938
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   939
           1.2.1.User Interface
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   940
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   941
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   942
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   943
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   944
       <p id="ch9Using_Linux_Tools_a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   945
        Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   946
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   947
       <p id="ch9Using_Linux_Tools_b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   948
        A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A headless system (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   949
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   950
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   951
      <div class="section" title="1.2.2.Development">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   952
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   953
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   954
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   955
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   956
           <a name="id2489858">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   957
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   958
           1.2.2.Development
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   959
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   960
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   961
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   962
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   963
       <p id="ch9Using_Linux_Tools_c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   964
        The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   965
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   966
       <p id="ch9Using_Linux_Tools_d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   967
        Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   968
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   969
       <p id="ch9Using_Linux_Tools_e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   970
        A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   971
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   972
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   973
      <div class="section" title="1.2.3.Community">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   974
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   975
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   976
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   977
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   978
           <a name="id2489559">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   979
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   980
           1.2.3.Community
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   981
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   982
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   983
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   984
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   985
       <p id="ch9Using_Linux_Tools_f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   986
        A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   987
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   988
       <p id="ch9Using_Linux_Tools_10">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   989
        In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   990
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   991
       <p id="ch9Using_Linux_Tools_11">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   992
        Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   993
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   994
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   995
      <div class="section" title="1.2.4.Can I make a profit out of running a business involving Linux?">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   996
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   997
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   998
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
   999
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1000
           <a name="id2489604">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1001
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1002
           1.2.4.Can I make a profit out of running a business involving Linux?
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1003
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1004
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1005
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1006
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1007
       <p id="ch9Using_Linux_Tools_12">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1008
        The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1009
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1010
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1011
      <div class="section" title="1.2.5.Programming on Linux">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1012
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1013
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1014
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1015
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1016
           <a name="id2489650">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1017
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1018
           1.2.5.Programming on Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1019
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1020
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1021
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1022
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1023
       <p id="ch9Using_Linux_Tools_13">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1024
        Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1025
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1026
       <p id="ch9Using_Linux_Tools_14">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1027
        Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1028
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1029
       <p id="ch9Using_Linux_Tools_15">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1030
        The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1031
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1032
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1033
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1034
     <div class="section" title="1.3.Reasons for Using Linux">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1035
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1036
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1037
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1038
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1039
          <a name="id2490190">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1040
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1041
          1.3.Reasons for Using Linux
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1042
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1043
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1044
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1045
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1046
      <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1047
       <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1048
        <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1049
         <p id="ch9Using_Linux_Tools_16">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1050
          Linux is free:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1051
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1052
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1053
       </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1054
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1055
      <p id="ch9Using_Linux_Tools_17">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1056
       As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1057
Most of all, Linux is free as in "free speech":
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1058
The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1059
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1060
      <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1061
       <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1062
        <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1063
         <p id="ch9Using_Linux_Tools_18">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1064
          Linux is portable to any hardware platform:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1065
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1066
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1067
       </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1068
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1069
      <p id="ch9Using_Linux_Tools_19">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1070
       A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1071
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1072
      <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1073
       <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1074
        <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1075
         <p id="ch9Using_Linux_Tools_1a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1076
          Linux was made to keep on running:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1077
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1078
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1079
       </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1080
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1081
      <p id="ch9Using_Linux_Tools_1b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1082
       As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1083
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1084
      <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1085
       <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1086
        <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1087
         <p id="ch9Using_Linux_Tools_1c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1088
          Linux is secure and versatile:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1089
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1090
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1091
       </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1092
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1093
      <p id="ch9Using_Linux_Tools_1d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1094
       The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1095
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1096
      <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1097
       <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1098
        <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1099
         <p id="ch9Using_Linux_Tools_1e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1100
          Linux is scalable:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1101
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1102
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1103
       </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1104
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1105
      <p id="ch9Using_Linux_Tools_1f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1106
       From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1107
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1108
      <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1109
       <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1110
        <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1111
         <p id="ch9Using_Linux_Tools_20">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1112
          The Linux OS and Linux applications have very short debugtimes:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1113
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1114
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1115
       </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1116
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1117
      <p id="ch9Using_Linux_Tools_21">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1118
       Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1119
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1120
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1121
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1122
    <div class="section" title="2.Getting Started">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1123
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1124
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1125
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1126
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1127
         <a name="id2490330">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1128
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1129
         2.Getting Started
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1130
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1131
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1132
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1133
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1134
     <div class="section" title="2.1.Logging in, activating the user interface and logging out">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1135
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1136
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1137
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1138
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1139
          <a name="id2490339">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1140
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1141
          2.1.Logging in, activating the user interface and logging out
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1142
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1143
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1144
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1145
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1146
      <p id="ch9Using_Linux_Tools_22">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1147
       In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PCbased Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multiuser features, or in graphical console mode, which looks better but eats more system resources.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1148
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1149
      <div class="section" title="2.1.1.Graphical Mode">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1150
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1151
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1152
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1153
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1154
           <a name="id2490369">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1155
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1156
           2.1.1.Graphical Mode
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1157
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1158
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1159
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1160
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1161
       <p id="ch9Using_Linux_Tools_23">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1162
        This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1163
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1164
       <p id="ch9Using_Linux_Tools_24">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1165
        To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1166
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1167
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1168
          OK
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1169
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1170
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1171
        or press
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1172
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1173
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1174
          Enter
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1175
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1176
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1177
        .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1178
It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1179
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1180
       <p id="ch9Using_Linux_Tools_25">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1181
        After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1182
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1183
       <p id="ch9Using_Linux_Tools_26">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1184
        To continue, you will need to open a
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1185
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1186
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1187
          terminal window
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1188
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1189
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1190
        or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1191
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1192
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1193
          xterm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1194
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1195
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1196
        for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1197
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1198
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1199
          Applications&gt;Utilities-&gt;System Tools
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1200
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1201
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1202
        or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1203
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1204
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1205
          Internet menu
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1206
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1207
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1208
        , depending on what window manager you are using. There might be icons that you can use as a shortcut to get an
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1209
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1210
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1211
          xterm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1212
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1213
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1214
        window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1215
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1216
       <p id="ch9Using_Linux_Tools_27">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1217
        While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old pointnclick method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1218
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1219
       <p id="ch9Using_Linux_Tools_28">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1220
        A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1221
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1222
       <p id="ch9Using_Linux_Tools_29">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1223
        Another common form for a prompt is this one:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1224
[
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1225
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1226
       <div class="reference">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1227
        <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1228
         <hr />
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1229
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1230
        user@host
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1231
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1232
       <p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1233
        dir]
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1234
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1235
       <p id="ch9Using_Linux_Tools_2a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1236
        In the above example,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1237
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1238
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1239
          user
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1240
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1241
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1242
        will be your login name,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1243
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1244
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1245
          hosts
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1246
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1247
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1248
        the name of the machine you are working on, and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1249
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1250
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1251
          dir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1252
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1253
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1254
        an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1255
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1256
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1257
          logout
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1258
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1259
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1260
        icon or find
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1261
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1262
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1263
          Log Out
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1264
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1265
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1266
        in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1267
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1268
       <p id="ch9Using_Linux_Tools_2b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1269
        When you see the login screen again, asking to enter user name and password, logout was successful.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1270
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1271
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1272
      <div class="section" title="2.1.2.Text Mode">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1273
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1274
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1275
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1276
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1277
           <a name="id2490529">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1278
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1279
           2.1.2.Text Mode
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1280
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1281
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1282
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1283
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1284
       <p id="ch9Using_Linux_Tools_2c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1285
        One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1286
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1287
       <p id="ch9Using_Linux_Tools_2d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1288
        The login is different from a graphical login, in that you have to hit the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1289
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1290
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1291
          Enter
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1292
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1293
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1294
        key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1295
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1296
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1297
          Enter
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1298
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1299
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1300
        . You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1301
reasons.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1302
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1303
       <p id="ch9Using_Linux_Tools_2e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1304
        When the system has accepted you as a valid user, you may get some more information, called the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1305
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1306
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1307
          message of the day
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1308
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1309
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1310
        , which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1311
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1312
       <p id="ch9Using_Linux_Tools_2f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1313
        Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a nonprivileged user.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1314
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1315
       <p id="ch9Using_Linux_Tools_30">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1316
        Logging out is done by entering the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1317
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1318
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1319
          logout
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1320
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1321
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1322
        command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't poweroff the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1323
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1324
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1325
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1326
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1327
    <div class="section" title="3.Basic Commands">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1328
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1329
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1330
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1331
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1332
         <a name="id2490619">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1333
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1334
         3.Basic Commands
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1335
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1336
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1337
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1338
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1339
     <div class="section" title="3.1.ls">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1340
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1341
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1342
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1343
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1344
          <a name="id2490627">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1345
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1346
          3.1.ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1347
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1348
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1349
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1350
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1351
      <p id="ch9Using_Linux_Tools_31">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1352
       When invoked without any arguments,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1353
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1354
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1355
         ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1356
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1357
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1358
       lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1359
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1360
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1361
         ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1362
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1363
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1364
       is derived from
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1365
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1366
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1367
         list segments
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1368
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1369
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1370
       which was used in earlier systems.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1371
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1372
      <p id="ch9Using_Linux_Tools_32">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1373
       Files whose names start with "." are not listed, unless the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1374
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1375
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1376
         -a
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1377
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1378
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1379
       flag is specified or the files are specified explicitly.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1380
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1381
      <p id="ch9Using_Linux_Tools_33">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1382
       Without options,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1383
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1384
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1385
         ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1386
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1387
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1388
       displays files in a bare format. This bare format however makes it difficult to establish the type, permissions, and size of the files. The most common options to reveal this information or change the list of files are:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1389
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1390
      <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1391
       &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1392
       <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1393
        <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1394
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1395
          <p id="ch9Using_Linux_Tools_34">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1396
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1397
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1398
             -l
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1399
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1400
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1401
           long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1402
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1403
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1404
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1405
          <p id="ch9Using_Linux_Tools_35">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1406
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1407
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1408
             -F
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1409
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1410
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1411
           appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1412
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1413
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1414
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1415
          <p id="ch9Using_Linux_Tools_36">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1416
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1417
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1418
             -a
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1419
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1420
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1421
           lists all files in the given directory, including those whose names start with "." (which are hidden files in Unix). By default, these files are excluded from the list.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1422
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1423
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1424
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1425
          <p id="ch9Using_Linux_Tools_37">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1426
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1427
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1428
             -R
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1429
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1430
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1431
           recursively lists subdirectories. The command ls -R / would therefore list all files.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1432
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1433
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1434
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1435
          <p id="ch9Using_Linux_Tools_38">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1436
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1437
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1438
             -d
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1439
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1440
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1441
           shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1442
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1443
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1444
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1445
          <p id="ch9Using_Linux_Tools_39">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1446
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1447
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1448
             -t
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1449
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1450
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1451
           sort the list of files by modification time.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1452
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1453
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1454
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1455
          <p id="ch9Using_Linux_Tools_3a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1456
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1457
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1458
             -h
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1459
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1460
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1461
           print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1462
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1463
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1464
        </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1465
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1466
       &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1467
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1468
      <p id="ch9Using_Linux_Tools_3b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1469
       In some environments, providing the option
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1470
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1471
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1472
         --color
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1473
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1474
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1475
       (for GNU ls) or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1476
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1477
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1478
         -G
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1479
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1480
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1481
       (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1482
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1483
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1484
         -F
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1485
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1486
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1487
       would. To determine what color to use for a file, GNU
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1488
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1489
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1490
         ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1491
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1492
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1493
       checks the Unix file type, the file permissions, and the file extension, while FreeBSD
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1494
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1495
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1496
         ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1497
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1498
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1499
       checks only the Unix file type and file permissions.:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1500
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1501
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1502
       $ ls
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1503
jeeves.rst psmith.html blandings.html
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1504
$ ls -l
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1505
drwxr--r--   1 plum  editors   4096  jeeves
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1506
-rw-r--r--   1 plum  editors  30405  psmith
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1507
-r-xr-xr-x   1 plum  plum      8460  blandings
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1508
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1509
      <p id="ch9Using_Linux_Tools_3c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1510
       Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1511
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1512
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1513
     <div class="section" title="3.2.date">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1514
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1515
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1516
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1517
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1518
          <a name="id2490791">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1519
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1520
          3.2.date
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1521
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1522
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1523
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1524
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1525
      <p id="ch9Using_Linux_Tools_3d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1526
       The Unix date command displays the time and date. The super-user can use it to set the system clock.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1527
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1528
      <p id="ch9Using_Linux_Tools_3e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1529
       With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1530
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1531
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1532
       $date
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1533
Tue Sep  8 12:01:45 IST 2009
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1534
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1535
      <p id="ch9Using_Linux_Tools_3f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1536
       On some systems to set the current date and time to September 8, 2004 01:22 you type:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1537
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1538
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1539
       $date --set="20040908 01:22"
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1540
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1541
      <p id="ch9Using_Linux_Tools_40">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1542
       In order to view the various options for the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1543
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1544
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1545
         date
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1546
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1547
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1548
       command, type:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1549
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1550
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1551
       $man date
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1552
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1553
      <p id="ch9Using_Linux_Tools_41">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1554
       This will take you to the "Manual" page comprising of all the details on the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1555
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1556
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1557
         date
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1558
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1559
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1560
       command. You can return to the terminal from the "man" page by pressing the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1561
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1562
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1563
         Esc
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1564
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1565
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1566
       key in the keyboard and typing ":q" in that order.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1567
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1568
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1569
     <div class="section" title="3.3.cd">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1570
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1571
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1572
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1573
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1574
          <a name="id2490852">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1575
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1576
          3.3.cd
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1577
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1578
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1579
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1580
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1581
      <p id="ch9Using_Linux_Tools_42">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1582
       This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered,  cd .. can be used.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1583
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1584
      <p id="ch9Using_Linux_Tools_43">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1585
       One dot '.' represents the current directory while two dots '..' represent the parent directory.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1586
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1587
      <p id="ch9Using_Linux_Tools_44">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1588
       cd - will return you to the previous directory (a bit like an undo).
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1589
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1590
      <p id="ch9Using_Linux_Tools_45">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1591
       You can also use cd absolute path or cd relative path (see below):
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1592
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1593
      <p id="ch9Using_Linux_Tools_46">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1594
       Absolute paths:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1595
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1596
      <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1597
       &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1598
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1599
      <p id="ch9Using_Linux_Tools_47">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1600
       An  absolute path is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1601
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1602
      &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1603
      <p id="ch9Using_Linux_Tools_48">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1604
       For example to get to /boot/grub you would type:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1605
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1606
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1607
       $cd /boot/grub
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1608
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1609
      <p id="ch9Using_Linux_Tools_49">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1610
       This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1611
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1612
      <p id="ch9Using_Linux_Tools_4a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1613
       Relative paths:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1614
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1615
      <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1616
       &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1617
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1618
      <p id="ch9Using_Linux_Tools_4b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1619
       A  relative path doesn't have a preceding slash. Use a relative path when you start from a directory below the top level directory structure. This is dependent on where you are in the filesystem.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1620
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1621
      <p id="ch9Using_Linux_Tools_4c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1622
       For example if you are in root's home directory and want to get to /root/music, you type:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1623
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1624
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1625
       $ cd music
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1626
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1627
      &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1628
      <p id="ch9Using_Linux_Tools_4d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1629
       Please note that there is no / using the above cd command. Using a / would cause this to be an absolute path, working from the top of the hierarchy downward.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1630
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1631
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1632
     <div class="section" title="3.4.who">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1633
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1634
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1635
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1636
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1637
          <a name="id2490955">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1638
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1639
          3.4.who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1640
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1641
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1642
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1643
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1644
      <p id="ch9Using_Linux_Tools_4e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1645
       The standard Unix command
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1646
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1647
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1648
         who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1649
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1650
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1651
       displays a list of users who are currently logged into a computer.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1652
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1653
      <p id="ch9Using_Linux_Tools_4f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1654
       The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1655
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1656
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1657
         who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1658
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1659
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1660
       command is related to the command
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1661
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1662
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1663
         w
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1664
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1665
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1666
       , which provides the same information but also displays additional data and statistics.:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1667
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1668
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1669
       $who
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1670
beeblebrox tty7         2009-09-08 10:50 (:0)
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1671
beeblebrox pts/0        2009-09-08 11:25 (:0.0)
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1672
dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1673
beeblebrox pts/2        2009-09-08 18:53 (:0.0)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1674
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1675
      <p id="ch9Using_Linux_Tools_50">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1676
       The command can be invoked with the arguments
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1677
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1678
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1679
         am i
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1680
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1681
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1682
       or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1683
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1684
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1685
         am I
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1686
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1687
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1688
       (so it is invoked as
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1689
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1690
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1691
         who am i
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1692
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1693
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1694
       or * who am I*), showing information about the current terminal only (see the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1695
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1696
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1697
         -m
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1698
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1699
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1700
       option below, of which this invocation is equivalent).
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1701
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1702
      <p id="ch9Using_Linux_Tools_51">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1703
       In order to find out the various options that can be appended to the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1704
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1705
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1706
         who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1707
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1708
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1709
       command, check the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1710
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1711
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1712
         man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1713
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1714
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1715
       page by typing out the following in the terminal:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1716
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1717
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1718
       $man who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1719
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1720
      <p id="ch9Using_Linux_Tools_52">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1721
       This will take you to the "Manual" page containing details about the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1722
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1723
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1724
         who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1725
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1726
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1727
       command
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1728
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1729
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1730
     <div class="section" title="3.5.mkdir">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1731
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1732
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1733
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1734
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1735
          <a name="id2491038">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1736
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1737
          3.5.mkdir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1738
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1739
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1740
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1741
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1742
      <p id="ch9Using_Linux_Tools_53">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1743
       This command is used to make a new directory. Normal usage is as straightforward as follows:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1744
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1745
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1746
       $mkdir name_of_directory
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1747
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1748
      <p id="ch9Using_Linux_Tools_54">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1749
       Where
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1750
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1751
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1752
         name_of_directory
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1753
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1754
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1755
       is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1756
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1757
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1758
         mkdir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1759
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1760
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1761
       will try to create all of them.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1762
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1763
      <div class="section" title="3.5.1.Options">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1764
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1765
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1766
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1767
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1768
           <a name="id2491070">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1769
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1770
           3.5.1.Options
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1771
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1772
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1773
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1774
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1775
       <p id="ch9Using_Linux_Tools_55">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1776
        On Unix-like operating systems,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1777
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1778
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1779
          mkdir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1780
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1781
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1782
        takes options. Three of the most common options are:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1783
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1784
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1785
        &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1786
        <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1787
         <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1788
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1789
           <p id="ch9Using_Linux_Tools_56">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1790
            <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1791
             <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1792
              -p
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1793
             </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1794
            </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1795
            : will also create all directories leading up to the given directory that do not exist already. If the given directory already exists, ignore the error.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1796
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1797
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1798
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1799
           <p id="ch9Using_Linux_Tools_57">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1800
            <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1801
             <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1802
              -v
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1803
             </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1804
            </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1805
            : display each directory that mkdir creates. Most often used with -p.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1806
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1807
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1808
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1809
           <p id="ch9Using_Linux_Tools_58">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1810
            <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1811
             <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1812
              -m
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1813
             </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1814
            </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1815
            : specify the octal permissions of directories created by mkdir.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1816
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1817
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1818
         </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1819
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1820
        &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1821
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1822
       <p id="ch9Using_Linux_Tools_59">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1823
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1824
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1825
          -p
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1826
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1827
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1828
        is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1829
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1830
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1831
      <div class="section" title="3.5.2.Examples">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1832
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1833
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1834
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1835
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1836
           <a name="id2491132">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1837
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1838
           3.5.2.Examples
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1839
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1840
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1841
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1842
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1843
       <p id="ch9Using_Linux_Tools_5a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1844
        An example of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1845
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1846
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1847
          -p
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1848
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1849
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1850
        in action is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1851
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1852
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1853
        $mkdir -p /tmp/a/b/c
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1854
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1855
       <p id="ch9Using_Linux_Tools_5b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1856
        If
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1857
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1858
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1859
          /tmp/a
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1860
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1861
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1862
        exists but
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1863
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1864
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1865
          /tmp/a/b
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1866
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1867
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1868
        does not, mkdir will create
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1869
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1870
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1871
          /tmp/a/b
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1872
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1873
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1874
        before creating
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1875
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1876
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1877
          /tmp/a/b/c
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1878
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1879
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1880
        .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1881
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1882
       <p id="ch9Using_Linux_Tools_5c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1883
        And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1884
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1885
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1886
        $mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1887
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1888
       <p id="ch9Using_Linux_Tools_5d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1889
        This will create:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1890
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1891
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1892
        &lt;definition_list&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1893
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1894
         &lt;definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1895
         <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1896
          &lt;term&gt;tmpdir  - branches&lt;/term&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1897
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1898
         <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1899
          &lt;definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1900
          <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1901
           <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1902
            <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1903
             <p id="ch9Using_Linux_Tools_5e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1904
              tag
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1905
             </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1906
            </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1907
            <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1908
             <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1909
              &lt;definition_list&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1910
              <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1911
               &lt;definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1912
               <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1913
                &lt;term&gt;trunk - sources - includes&lt;/term&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1914
               </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1915
               <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1916
                &lt;definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1917
                <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1918
                 <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1919
                  <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1920
                   <p id="ch9Using_Linux_Tools_5f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1921
                    docs
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1922
                   </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1923
                  </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1924
                 </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1925
                </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1926
                &lt;/definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1927
               </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1928
               &lt;/definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1929
              </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1930
              &lt;/definition_list&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1931
             </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1932
            </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1933
           </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1934
          </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1935
          &lt;/definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1936
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1937
         &lt;/definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1938
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1939
        &lt;/definition_list&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1940
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1941
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1942
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1943
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1944
    <div class="section" title="4.Getting Help">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1945
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1946
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1947
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1948
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1949
         <a name="id2491219">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1950
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1951
         4.Getting Help
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1952
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1953
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1954
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1955
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1956
     <div class="section" title="4.1.apropos and whatis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1957
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1958
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1959
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1960
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1961
          <a name="id2491227">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1962
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1963
          4.1.apropos and whatis
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1964
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1965
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1966
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1967
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1968
      <p id="ch9Using_Linux_Tools_60">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1969
       This is a command to search the manual pages files in Unix and Unix-like operating systems.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1970
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1971
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1972
       $ apropos grep
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1973
egrep       egrep (1)       Search a file for a pattern using full regular expressions
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1974
fgrep       fgrep (1)       Search a file for a fixed-character string
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1975
fmlgrep     fmlgrep (1)     Search a file for a pattern
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1976
grep        grep (1)        Search a file for a pattern
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1977
gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1978
nisgrep     nismatch (1)    Utilities for searching NIS+ tables
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1979
pgrep       pgrep (1)       Find or signal a process by name or other attribute
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  1980
zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1981
...
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1982
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1983
      <p id="ch9Using_Linux_Tools_61">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1984
       In this example, the user uses
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1985
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1986
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1987
         apropos
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1988
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1989
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1990
       to search for the string "grep", and apropos returns the indicated
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1991
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1992
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1993
         man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1994
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1995
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1996
       pages that include the term "grep".
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1997
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1998
      <p id="ch9Using_Linux_Tools_62">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  1999
       A short index of explanations for commands is available using the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2000
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2001
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2002
         whatis
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2003
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2004
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2005
       command, like in the examples below:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2006
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2007
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2008
       $whatis ls
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2009
ls (1)           - list directory contents
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2010
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2011
      <p id="ch9Using_Linux_Tools_63">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2012
       This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2013
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2014
      <p id="ch9Using_Linux_Tools_64">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2015
       If you don't know where to get started and which man page to read,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2016
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2017
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2018
         apropos
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2019
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2020
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2021
       gives more information. Say that you do not know how to start a browser, then you could enter the following command:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2022
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2023
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2024
       $apropos browser
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2025
gmusicbrowser (1)    - Jukebox for large collections of audio files
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2026
infobrowser (1)      - read Info documents
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2027
libsmbclient (7)     - An extension library for browsers and that               can be used...
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2028
opera (1)            - a standards-compliant graphical Web browser
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2029
sensible-browser (1) - sensible editing, paging, and web browsing
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2030
smbtree (1)          - A text based smb network browser
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2031
tvtk_doc (1)         - A GUI based TVTK documentation search browser.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2032
viewres (1)          - graphical class browser for Xt
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2033
w3m (1)              - a text based Web browser and pager
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2034
www-browser (1)      - a text based Web browser and pager
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2035
...
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2036
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2037
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2038
     <div class="section" title="4.2.man">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2039
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2040
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2041
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2042
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2043
          <a name="id2491311">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2044
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2045
          4.2.man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2046
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2047
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2048
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2049
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2050
      <p id="ch9Using_Linux_Tools_65">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2051
       Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2052
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2053
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2054
         man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2055
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2056
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2057
       . Each page is a self-contained document.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2058
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2059
      <p id="ch9Using_Linux_Tools_66">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2060
       To read a manual page for a Unix command, one can use:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2061
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2062
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2063
       $ man &lt;command_name&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2064
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2065
      <p id="ch9Using_Linux_Tools_67">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2066
       at a shell prompt; for example, "man ftp". In order to simplify navigation through the output,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2067
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2068
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2069
         man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2070
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2071
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2072
       generally uses the less terminal pager.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2073
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2074
      <p id="ch9Using_Linux_Tools_68">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2075
       Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2076
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2077
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2078
         man(1)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2079
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2080
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2081
       and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2082
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2083
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2084
         man(7)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2085
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2086
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2087
       , or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2088
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2089
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2090
         exit(2)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2091
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2092
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2093
       and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2094
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2095
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2096
         exit(3)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2097
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2098
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2099
       . The syntax for accessing the non-default manual section varies between different man implementations. On Linux and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2100
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2101
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2102
         BSD, for example, the syntax for reading *printf(3)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2103
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2104
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2105
       is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2106
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2107
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2108
       $man 3 printf
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2109
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2110
      <p id="ch9Using_Linux_Tools_69">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2111
       Another example:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2112
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2113
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2114
       $man man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2115
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2116
      <p id="ch9Using_Linux_Tools_6a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2117
       The previous example will take you to the "Manual" page entry about manual pages!
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2118
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2119
      <div class="section" title="4.2.1.Layout">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2120
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2121
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2122
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2123
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2124
           <a name="id2491394">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2125
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2126
           4.2.1.Layout
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2127
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2128
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2129
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2130
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2131
       <p id="ch9Using_Linux_Tools_6b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2132
        All man pages follow a common layout that is optimized for presentation on a simple ASCII text display, possibly without any form of highlighting or font control. Sections present may include:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2133
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2134
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2135
        &lt;definition_list&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2136
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2137
         &lt;definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2138
         <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2139
          &lt;term&gt;NAME&lt;/term&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2140
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2141
         <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2142
          &lt;definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2143
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2144
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2145
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2146
       <p id="ch9Using_Linux_Tools_6c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2147
        The name of the command or function, followed by a one-line description of what it does.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2148
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2149
       &lt;/definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2150
       &lt;/definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2151
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2152
        &lt;definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2153
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2154
         &lt;term&gt;SYNOPSIS&lt;/term&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2155
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2156
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2157
         &lt;definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2158
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2159
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2160
       <p id="ch9Using_Linux_Tools_6d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2161
        In the case of a command, you get a formal description of how to run it and what command line options it takes. For program functions, a list of the parameters the function takes and which header file contains its definition. For experienced users, this may be all the documentation they need.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2162
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2163
       &lt;/definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2164
       &lt;/definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2165
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2166
        &lt;definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2167
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2168
         &lt;term&gt;DESCRIPTION&lt;/term&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2169
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2170
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2171
         &lt;definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2172
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2173
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2174
       <p id="ch9Using_Linux_Tools_6e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2175
        A textual description of the functioning of the command or function.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2176
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2177
       &lt;/definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2178
       &lt;/definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2179
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2180
        &lt;definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2181
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2182
         &lt;term&gt;EXAMPLES&lt;/term&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2183
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2184
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2185
         &lt;definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2186
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2187
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2188
       <p id="ch9Using_Linux_Tools_6f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2189
        Some examples of common usage.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2190
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2191
       &lt;/definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2192
       &lt;/definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2193
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2194
        &lt;definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2195
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2196
         &lt;term&gt;SEE ALSO&lt;/term&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2197
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2198
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2199
         &lt;definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2200
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2201
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2202
       <p id="ch9Using_Linux_Tools_70">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2203
        A list of related commands or functions.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2204
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2205
       &lt;/definition&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2206
       &lt;/definition_list_item&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2207
       &lt;/definition_list&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2208
       <p id="ch9Using_Linux_Tools_71">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2209
        Other sections may be present, but these are not well standardized across man pages. Common examples include: OPTIONS, EXIT STATUS, ENVIRONMENT, KNOWN BUGS, FILES, AUTHOR, REPORTING BUGS, HISTORY and COPYRIGHT.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2210
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2211
       <p id="ch9Using_Linux_Tools_72">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2212
        These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2213
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2214
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2215
          man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2216
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2217
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2218
        have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2219
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2220
       <p id="ch9Using_Linux_Tools_73">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2221
        However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2222
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2223
       <p id="ch9Using_Linux_Tools_74">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2224
        Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2225
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2226
       <p id="ch9Using_Linux_Tools_75">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2227
        Usually the man pages are written in English. Translations into other languages can be also available on the system.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2228
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2229
       <p id="ch9Using_Linux_Tools_76">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2230
        The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2231
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2232
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2233
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2234
     <div class="section" title="4.3.info">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2235
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2236
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2237
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2238
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2239
          <a name="id2491522">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2240
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2241
          4.3.info
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2242
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2243
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2244
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2245
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2246
      <p id="ch9Using_Linux_Tools_77">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2247
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2248
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2249
         info
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2250
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2251
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2252
       is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2253
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2254
      <p id="ch9Using_Linux_Tools_78">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2255
       The syntax is
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2256
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2257
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2258
       $ info &lt;command_name&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2259
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2260
      <p id="ch9Using_Linux_Tools_79">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2261
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2262
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2263
         info
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2264
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2265
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2266
       processes info files, which are Texinfo formatted files, and presents the documentation as a tree, with simple commands to traverse the tree and to follow cross references. For instance
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2267
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2268
      <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2269
       &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2270
       <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2271
        <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2272
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2273
          <p id="ch9Using_Linux_Tools_7a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2274
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2275
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2276
             n
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2277
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2278
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2279
           goes to the next page.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2280
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2281
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2282
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2283
          <p id="ch9Using_Linux_Tools_7b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2284
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2285
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2286
             p
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2287
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2288
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2289
           goes to the previous page.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2290
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2291
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2292
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2293
          <p id="ch9Using_Linux_Tools_7c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2294
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2295
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2296
             u
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2297
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2298
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2299
           goes to the upper page.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2300
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2301
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2302
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2303
          <p id="ch9Using_Linux_Tools_7d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2304
           <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2305
            <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2306
             l
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2307
            </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2308
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2309
           goes to the last(visited) node
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2310
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2311
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2312
         <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2313
          <p id="ch9Using_Linux_Tools_7e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2314
           To follow a cross reference, the cursor can be moved over a link (a word preceded by a
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2315
           <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2316
            &lt;title_reference&gt;*&lt;/title_reference&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2317
           </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2318
           ) and enter pressed.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2319
          </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2320
         </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2321
        </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2322
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2323
       &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2324
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2325
      <p id="ch9Using_Linux_Tools_7f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2326
       info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2327
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2328
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2329
     <div class="section" title="4.4.--help">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2330
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2331
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2332
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2333
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2334
          <a name="id2491614">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2335
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2336
          4.4.--help
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2337
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2338
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2339
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2340
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2341
      <p id="ch9Using_Linux_Tools_80">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2342
       Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2343
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2344
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2345
         cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2346
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2347
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2348
       command:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2349
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2350
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2351
       $ userprompt@host: cat --help
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2352
Usage: cat [OPTION] [FILE]...
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2353
Concatenate FILE(s), or standard input, to standard output.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2354
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2355
  -A, --show-all           equivalent to -vET
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2356
  -b, --number-nonblank    number nonempty output lines
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2357
  -e                       equivalent to -vE
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2358
  -E, --show-ends          display $ at end of each line
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2359
  -n, --number             number all output lines
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2360
  -s, --squeeze-blank      suppress repeated empty output lines
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2361
  -t                       equivalent to -vT
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2362
  -T, --show-tabs          display TAB characters as ^I
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2363
  -u                       (ignored)
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2364
  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2365
  --help     display this help and exit
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2366
  --version  output version information and exit
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2367
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2368
With no FILE, or when FILE is -, read standard input.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2369
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2370
Examples:
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2371
  cat f - g  Output f's contents, then standard input, then g's           contents.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2372
  cat        Copy standard input to standard output.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2373
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2374
Report bugs to &lt;bug-coreutils@gnu.org&gt;.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2375
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2376
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2377
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2378
    <div class="section" title="5.Basic file handling">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2379
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2380
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2381
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2382
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2383
         <a name="id2491666">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2384
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2385
         5.Basic file handling
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2386
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2387
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2388
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2389
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2390
     <div class="section" title="5.1.cp">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2391
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2392
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2393
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2394
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2395
          <a name="id2491675">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2396
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2397
          5.1.cp
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2398
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2399
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2400
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2401
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2402
      <p id="ch9Using_Linux_Tools_81">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2403
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2404
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2405
         cp
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2406
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2407
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2408
       is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2409
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2410
      <div class="section" title="5.1.1.Usage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2411
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2412
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2413
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2414
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2415
           <a name="id2491692">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2416
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2417
           5.1.1.Usage
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2418
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2419
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2420
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2421
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2422
       <p id="ch9Using_Linux_Tools_82">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2423
        To copy a file to another file:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2424
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2425
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2426
        $ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2427
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2428
       <p id="ch9Using_Linux_Tools_83">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2429
        To copy a file to a directory:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2430
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2431
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2432
        $ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2433
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2434
       <p id="ch9Using_Linux_Tools_84">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2435
        To copy a directory to a directory:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2436
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2437
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2438
        $ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2439
SourceDirectory ... TargetDirectory
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2440
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2441
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2442
      <div class="section" title="5.1.2.Flags">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2443
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2444
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2445
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2446
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2447
           <a name="id2491727">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2448
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2449
           5.1.2.Flags
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2450
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2451
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2452
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2453
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2454
       <p id="ch9Using_Linux_Tools_85">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2455
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2456
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2457
          -f
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2458
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2459
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2460
        (force)  specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2461
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2462
       <p id="ch9Using_Linux_Tools_86">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2463
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2464
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2465
          -P
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2466
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2467
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2468
        makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2469
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2470
       <p id="ch9Using_Linux_Tools_87">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2471
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2472
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2473
          -i
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2474
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2475
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2476
        (interactive)  prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2477
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2478
       <p id="ch9Using_Linux_Tools_88">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2479
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2480
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2481
          -p
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2482
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2483
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2484
        (preserve)  duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2485
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2486
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2487
        &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2488
        <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2489
         <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2490
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2491
           <p id="ch9Using_Linux_Tools_89">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2492
            The time of the last data modification and the time of the last access.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2493
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2494
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2495
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2496
           <p id="ch9Using_Linux_Tools_8a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2497
            The user ID and group ID (only if it has permissions to do this)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2498
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2499
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2500
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2501
           <p id="ch9Using_Linux_Tools_8b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2502
            The file permission bits and the SUID and SGID bits.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2503
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2504
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2505
         </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2506
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2507
        &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2508
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2509
       <p id="ch9Using_Linux_Tools_8c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2510
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2511
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2512
          -R
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2513
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2514
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2515
        (recursive)  copy directories (recursively copying all the contents)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2516
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2517
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2518
      <div class="section" title="5.1.3.Examples">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2519
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2520
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2521
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2522
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2523
           <a name="id2491826">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2524
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2525
           5.1.3.Examples
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2526
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2527
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2528
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2529
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2530
       <p id="ch9Using_Linux_Tools_8d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2531
        To make a copy of a file in the current directory, enter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2532
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2533
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2534
        $ cp prog.c prog.bak
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2535
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2536
       <p id="ch9Using_Linux_Tools_8e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2537
        This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2538
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2539
       <p id="ch9Using_Linux_Tools_8f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2540
        To copy a file in your current directory into another directory, enter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2541
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2542
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2543
        $ cp zaphod /home/books/hhgg
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2544
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2545
       <p id="ch9Using_Linux_Tools_90">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2546
        This copies the jones file to /home/books/hhgg/zaphod.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2547
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2548
       <p id="ch9Using_Linux_Tools_91">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2549
        To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2550
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2551
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2552
        $ cp -p martin_luther_king martin_luther_king.jr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2553
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2554
       <p id="ch9Using_Linux_Tools_92">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2555
        This copies the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2556
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2557
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2558
          martin_luther_king
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2559
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2560
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2561
        file to the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2562
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2563
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2564
          martin_luther_king.jr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2565
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2566
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2567
        file. Instead of creating the file with the current date and time stamp, the system gives the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2568
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2569
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2570
          martin_luther_king.jr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2571
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2572
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2573
        file the same date and time as the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2574
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2575
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2576
          martin_luther_king
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2577
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2578
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2579
        file. The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2580
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2581
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2582
          martin_luther_king.jr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2583
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2584
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2585
        file also inherits the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2586
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2587
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2588
          martin_luther_king
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2589
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2590
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2591
        file's access control protection.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2592
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2593
       <p id="ch9Using_Linux_Tools_93">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2594
        To copy all the files in a directory to a new directory, enter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2595
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2596
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2597
        $ cp /home/galactica/clients/* /home/hhgg/customers
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2598
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2599
       <p id="ch9Using_Linux_Tools_94">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2600
        This copies only the files in the clients directory to the customers directory.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2601
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2602
       <p id="ch9Using_Linux_Tools_95">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2603
        To copy a directory, including all its files and subdirectories, to another directory, enter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2604
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2605
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2606
        &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2607
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2608
       <p id="ch9Using_Linux_Tools_96">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2609
        $ cp -R /home/hhgg/clients /home/hhgg/customers
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2610
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2611
       &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2612
       <p id="ch9Using_Linux_Tools_97">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2613
        This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2614
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2615
       <p id="ch9Using_Linux_Tools_98">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2616
        To copy a specific set of files of any extension to another directory, enter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2617
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2618
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2619
        $ cp zaphod arthur ford /home/hhgg/clients
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2620
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2621
       <p id="ch9Using_Linux_Tools_99">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2622
        This copies the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2623
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2624
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2625
          zaphod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2626
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2627
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2628
        ,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2629
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2630
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2631
          arthur
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2632
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2633
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2634
        , and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2635
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2636
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2637
          ford
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2638
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2639
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2640
        files in your current working directory to the /home/hhgg/clients directory.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2641
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2642
       <p id="ch9Using_Linux_Tools_9a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2643
        To use pattern-matching characters to copy files, enter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2644
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2645
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2646
        $ cp programs/*.py .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2647
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2648
       <p id="ch9Using_Linux_Tools_9b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2649
        This copies the files in the programs directory that end with
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2650
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2651
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2652
          .py
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2653
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2654
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2655
        to the current directory, signified by the single "." (dot). You must type a space between the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2656
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2657
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2658
          py
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2659
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2660
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2661
        and the final dot.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2662
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2663
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2664
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2665
     <div class="section" title="5.2.mv">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2666
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2667
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2668
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2669
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2670
          <a name="id2491990">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2671
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2672
          5.2.mv
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2673
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2674
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2675
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2676
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2677
      <p id="ch9Using_Linux_Tools_9c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2678
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2679
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2680
         mv
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2681
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2682
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2683
       (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system),
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2684
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2685
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2686
         mv
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2687
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2688
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2689
       will rename the file instead. Write permission is required on all directories being modified.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2690
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2691
      <div class="section" title="5.2.1.Conflicting existing file">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2692
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2693
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2694
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2695
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2696
           <a name="id2492014">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2697
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2698
           5.2.1.Conflicting existing file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2699
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2700
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2701
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2702
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2703
       <p id="ch9Using_Linux_Tools_9d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2704
        In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2705
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2706
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2707
      <div class="section" title="5.2.2.Differences with copy and delete">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2708
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2709
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2710
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2711
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2712
           <a name="id2492033">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2713
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2714
           5.2.2.Differences with copy and delete
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2715
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2716
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2717
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2718
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2719
       <p id="ch9Using_Linux_Tools_9e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2720
        Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2721
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2722
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2723
      <div class="section" title="5.2.3.Examples">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2724
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2725
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2726
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2727
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2728
           <a name="id2492063">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2729
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2730
           5.2.3.Examples
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2731
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2732
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2733
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2734
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2735
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2736
        $ mv myfile mynewfilename    renames a file
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2737
$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2738
$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2739
$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2740
$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2741
$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2742
$ mv foo bar baz dir         moves multiple files to directory dir
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  2743
$ mv --help                  shows a very concise help about the                syntax of the command
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2744
$ man mv                     prints an extensive user manual for                'mv' in the terminal
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2745
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2746
       <p id="ch9Using_Linux_Tools_9f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2747
        In all cases, the file or files being moved or renamed can be a directory.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2748
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2749
       <p id="ch9Using_Linux_Tools_a0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2750
        Note that when the command is called with two arguments (as
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2751
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2752
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2753
          mv name1 name2
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2754
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2755
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2756
        or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2757
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2758
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2759
          mv name1 /dir/name2
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2760
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2761
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2762
        ), it can have three different effects, depending on whether
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2763
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2764
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2765
          name2
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2766
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2767
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2768
        does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2769
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2770
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2771
          /.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2772
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2773
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2774
        (or in some Unix versions
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2775
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2776
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2777
          /
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2778
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2779
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2780
        is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2781
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2782
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2783
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2784
     <div class="section" title="5.3.rm">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2785
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2786
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2787
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2788
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2789
          <a name="id2492122">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2790
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2791
          5.3.rm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2792
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2793
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2794
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2795
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2796
      <p id="ch9Using_Linux_Tools_a1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2797
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2798
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2799
         rm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2800
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2801
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2802
       (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2803
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2804
      <p id="ch9Using_Linux_Tools_a2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2805
       Here's example to remove a file named "foo" from a directory, here shown with the -i option:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2806
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2807
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2808
       $ rm -i foo
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2809
remove foo? y
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2810
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2811
      <div class="section" title="5.3.1.Options">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2812
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2813
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2814
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2815
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2816
           <a name="id2492152">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2817
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2818
           5.3.1.Options
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2819
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2820
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2821
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2822
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2823
       <p id="ch9Using_Linux_Tools_a3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2824
        Common options that rm accepts include:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2825
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2826
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2827
        &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2828
        <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2829
         <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2830
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2831
           <p id="ch9Using_Linux_Tools_a4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2832
            <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2833
             <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2834
              -r
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2835
             </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2836
            </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2837
            , which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2838
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2839
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2840
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2841
           <p id="ch9Using_Linux_Tools_a5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2842
            <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2843
             <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2844
              -i
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2845
             </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2846
            </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2847
            , which asks for every deletion to be confirmed ("interactive")
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2848
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2849
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2850
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2851
           <p id="ch9Using_Linux_Tools_a6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2852
            <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2853
             <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2854
              -f
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2855
             </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2856
            </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2857
            , which ignores non-existent files and overrides any confirmation prompts ("force")
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2858
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2859
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2860
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2861
           <p id="ch9Using_Linux_Tools_a7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2862
            <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2863
             <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2864
              -v
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2865
             </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2866
            </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2867
            , which shows what is being removed as it happens ("verbose")
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2868
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2869
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2870
         </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2871
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2872
        &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2873
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2874
       <p id="ch9Using_Linux_Tools_a8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2875
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2876
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2877
          rm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2878
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2879
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2880
        is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2881
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2882
       <p id="ch9Using_Linux_Tools_a9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2883
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2884
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2885
          rm -rf
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2886
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2887
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2888
        (variously, rm -rf /, rm -rf
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2889
        <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2890
         &lt;title_reference&gt;*&lt;/title_reference&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2891
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2892
        , and others) is frequently used in jokes and anecdotes about Unix disasters. The rm -rf variant of the command, if run by a superuser on the root directory, would cause the contents of every writable mounted filesystem on the computer to be deleted.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2893
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2894
       <p id="ch9Using_Linux_Tools_aa">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2895
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2896
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2897
          rm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2898
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2899
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2900
        is often used in conjunction with xargs to supply a list of files to delete:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2901
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2902
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2903
        xargs rm &lt; filelist
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2904
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2905
       <p id="ch9Using_Linux_Tools_ab">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2906
        When
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2907
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2908
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2909
          rm
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2910
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2911
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2912
        is used on a symbolic link, it deletes the link, but does not affect the target of the link.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2913
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2914
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2915
      <div class="section" title="5.3.2.Permissions">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2916
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2917
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2918
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2919
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2920
           <a name="id2492255">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2921
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2922
           5.3.2.Permissions
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2923
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2924
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2925
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2926
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2927
       <p id="ch9Using_Linux_Tools_ac">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2928
        Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2929
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2930
       <p id="ch9Using_Linux_Tools_ad">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2931
        To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2932
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2933
       <p id="ch9Using_Linux_Tools_ae">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2934
        If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2935
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2936
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2937
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2938
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2939
    <div class="section" title="6.Command Line Arguments">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2940
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2941
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2942
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2943
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2944
         <a name="id2492294">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2945
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2946
         6.Command Line Arguments
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2947
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2948
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2949
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2950
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2951
     <p id="ch9Using_Linux_Tools_af">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2952
      In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2953
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2954
     <p id="ch9Using_Linux_Tools_b0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2955
      For example, in Unix and Unix-like environments, an example of a command-line argument is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2956
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2957
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2958
      rm file.s
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2959
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2960
     <p id="ch9Using_Linux_Tools_b1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2961
      "file.s" is a command line argument which tells the program rm to remove the file "file.s".
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2962
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2963
     <p id="ch9Using_Linux_Tools_b2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2964
      Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2965
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2966
     <p id="ch9Using_Linux_Tools_b3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2967
      A command line option or simply
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2968
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2969
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2970
        option
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2971
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2972
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2973
      (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2974
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2975
     <p id="ch9Using_Linux_Tools_b4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2976
      Long options are introduced via "--", and are typically whole words. For example,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2977
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2978
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2979
        ls --long --classify --all
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2980
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2981
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2982
      . Arguments to long options are provided with "=", as
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2983
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2984
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2985
        ls --block-size=1024
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2986
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2987
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2988
      . Some Unix programs use long options with single dashes, for example MPlayer as in
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2989
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2990
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2991
        mplayer -nosound
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2992
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2993
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2994
      .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2995
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2996
     <p id="ch9Using_Linux_Tools_b5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2997
      Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2998
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  2999
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3000
        -file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3001
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3002
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3003
      by using
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3004
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3005
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3006
        rm -file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3007
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3008
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3009
      may produce an error, since rm may interpret
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3010
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3011
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3012
        -file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3013
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3014
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3015
      as a command line switch. Using
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3016
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3017
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3018
        rm -- -file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3019
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3020
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3021
      removes ambiguity.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3022
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3023
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3024
    <div class="section" title="7.Basic Text Processing">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3025
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3026
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3027
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3028
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3029
         <a name="id2492388">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3030
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3031
         7.Basic Text Processing
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3032
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3033
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3034
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3035
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3036
     <div class="section" title="7.1.head">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3037
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3038
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3039
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3040
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3041
          <a name="id2492396">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3042
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3043
          7.1.head
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3044
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3045
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3046
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3047
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3048
      <p id="ch9Using_Linux_Tools_b6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3049
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3050
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3051
         head
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3052
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3053
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3054
       is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3055
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3056
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3057
       $ head [options] &lt;file_name&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3058
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3059
      <p id="ch9Using_Linux_Tools_b7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3060
       By default,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3061
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3062
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3063
         head
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3064
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3065
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3066
       will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3067
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3068
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3069
       $ head -n 20 filename
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3070
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3071
      <p id="ch9Using_Linux_Tools_b8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3072
       This displays the first 5 lines of all files starting with
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3073
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3074
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3075
         foo
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3076
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3077
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3078
       :
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3079
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3080
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3081
       $ head -n 5 foo*
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3082
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3083
      <p id="ch9Using_Linux_Tools_b9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3084
       Some versions omit the n and just let you say -5.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3085
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3086
      <div class="section" title="7.1.1.Flags">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3087
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3088
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3089
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3090
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3091
           <a name="id2492448">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3092
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3093
           7.1.1.Flags
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3094
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3095
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3096
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3097
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3098
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3099
        -c &lt;x number of bytes&gt; Copy first x number of bytes.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3100
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3101
       <p id="ch9Using_Linux_Tools_ba">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3102
        Other options:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3103
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3104
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3105
          sed
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3106
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3107
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3108
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3109
       <p id="ch9Using_Linux_Tools_bb">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3110
        Many early versions of Unix did not have this command, and so documentation and books had
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3111
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3112
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3113
          sed
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3114
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3115
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3116
        do this job:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3117
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3118
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3119
        sed 5q foo
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3120
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3121
       <p id="ch9Using_Linux_Tools_bc">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3122
        This says to print every line (implicit), and quit after the fifth.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3123
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3124
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3125
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3126
     <div class="section" title="7.2.tail">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3127
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3128
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3129
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3130
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3131
          <a name="id2492483">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3132
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3133
          7.2.tail
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3134
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3135
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3136
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3137
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3138
      <p id="ch9Using_Linux_Tools_bd">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3139
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3140
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3141
         tail
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3142
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3143
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3144
       is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3145
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3146
      <p id="ch9Using_Linux_Tools_be">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3147
       The command-syntax is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3148
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3149
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3150
       $ tail [options] &lt;file_name&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3151
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3152
      <p id="ch9Using_Linux_Tools_bf">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3153
       By default,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3154
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3155
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3156
         tail
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3157
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3158
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3159
       will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3160
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3161
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3162
       $ tail -n 20 filename
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3163
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3164
      <p id="ch9Using_Linux_Tools_c0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3165
       This example shows the last 15 bytes of all files starting with
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3166
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3167
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3168
         foo
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3169
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3170
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3171
       :
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3172
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3173
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3174
       $ tail -c 15 foo*
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3175
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3176
      <p id="ch9Using_Linux_Tools_c1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3177
       This example shows all lines of filename from the second line onwards:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3178
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3179
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3180
       $ tail -n +2 filename
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3181
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3182
      <p id="ch9Using_Linux_Tools_c2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3183
       Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3184
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3185
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3186
       $ tail -20 filename
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3187
$ tail -50c filename
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3188
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3189
      <p id="ch9Using_Linux_Tools_c3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3190
       However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3191
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3192
      <div class="section" title="7.2.1.File monitoring">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3193
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3194
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3195
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3196
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3197
           <a name="id2492562">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3198
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3199
           7.2.1.File monitoring
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3200
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3201
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3202
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3203
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3204
       <p id="ch9Using_Linux_Tools_c4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3205
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3206
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3207
          tail
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3208
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3209
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3210
        has a special command line option
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3211
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3212
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3213
          -f
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3214
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3215
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3216
        (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3217
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3218
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3219
        $ tail -f /var/adm/messages
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3220
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3221
       <p id="ch9Using_Linux_Tools_c5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3222
        To interrupt tail while it is monitoring, break-in with
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3223
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3224
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3225
          Ctrl+C
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3226
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3227
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3228
        . This command can be run "in the background" with &amp;, see job control.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3229
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3230
       <p id="ch9Using_Linux_Tools_c6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3231
        If you have a command's result to monitor, you can use the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3232
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3233
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3234
          watch
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3235
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3236
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3237
        command.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3238
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3239
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3240
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3241
     <div class="section" title="7.3.cut">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3242
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3243
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3244
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3245
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3246
          <a name="id2492611">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3247
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3248
          7.3.cut
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3249
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3250
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3251
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3252
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3253
      <p id="ch9Using_Linux_Tools_c7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3254
       In computing,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3255
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3256
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3257
         cut
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3258
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3259
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3260
       is a Unix command line utility which is used to extract sections from each line of input  usually from a file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3261
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3262
      <p id="ch9Using_Linux_Tools_c8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3263
       Extraction of line segments can typically be done by
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3264
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3265
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3266
         bytes (-b), characters (-c)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3267
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3268
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3269
       , or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3270
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3271
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3272
         fields (-f)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3273
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3274
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3275
       separated by a
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3276
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3277
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3278
         delimiter (-d  the tab character by default)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3279
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3280
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3281
       . A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3282
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3283
      <p id="ch9Using_Linux_Tools_c9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3284
       Assuming a file named file containing the lines:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3285
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3286
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3287
       foo:bar:baz:qux:quux
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3288
one:two:three:four:five:six:seven
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3289
alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3290
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3291
      <p id="ch9Using_Linux_Tools_ca">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3292
       To output the fourth through tenth characters of each line:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3293
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3294
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3295
       $ cut -c 4-10 file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3296
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3297
      <p id="ch9Using_Linux_Tools_cb">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3298
       This gives the output:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3299
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3300
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3301
       :bar:ba
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3302
:two:th
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3303
ha:beta
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3304
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3305
      <p id="ch9Using_Linux_Tools_cc">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3306
       To output the fifth field through the end of the line of each line using the colon character as the field delimiter:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3307
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3308
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3309
       $ cut -d : -f 5- file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3310
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3311
      <p id="ch9Using_Linux_Tools_cd">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3312
       This gives the output:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3313
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3314
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3315
       quux
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3316
five:six:seven
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3317
epsilon:zeta:eta:teta:iota:kappa:lambda:mu
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3318
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3319
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3320
     <div class="section" title="7.4.paste">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3321
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3322
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3323
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3324
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3325
          <a name="id2492698">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3326
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3327
          7.4.paste
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3328
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3329
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3330
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3331
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3332
      <p id="ch9Using_Linux_Tools_ce">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3333
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3334
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3335
         paste
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3336
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3337
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3338
       is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3339
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3340
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3341
         cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3342
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3343
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3344
       command which operates on the vertical plane of two or more files.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3345
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3346
      <p id="ch9Using_Linux_Tools_cf">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3347
       To paste several columns of data together into the file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3348
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3349
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3350
         www
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3351
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3352
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3353
       from files
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3354
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3355
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3356
         who
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3357
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3358
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3359
       ,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3360
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3361
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3362
         where
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3363
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3364
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3365
       , and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3366
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3367
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3368
         when
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3369
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3370
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3371
       :
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3372
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3373
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3374
       $ paste who where when &gt; www
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3375
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3376
      <p id="ch9Using_Linux_Tools_d0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3377
       If the files contain:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3378
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3379
      <table summary="paste" border="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3380
       <colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3381
        <col width="11">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3382
        </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3383
        <col width="12">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3384
        </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3385
        <col width="12">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3386
        </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3387
       </colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3388
      </table>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3389
      <p id="ch9Using_Linux_Tools_dd">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3390
       This creates the file named
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3391
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3392
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3393
         www
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3394
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3395
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3396
       containing:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3397
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3398
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3399
       Batman            GothamCity       January 3
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3400
Trillian          Andromeda        February 4
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3401
Jeeves            London           March 19
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3402
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3403
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3404
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3405
    <div class="section" title="8.Shell Meta Characters">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3406
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3407
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3408
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3409
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3410
         <a name="id2492832">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3411
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3412
         8.Shell Meta Characters
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3413
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3414
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3415
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3416
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3417
     <p id="ch9Using_Linux_Tools_de">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3418
      Unix recognizes certain special characters, called "meta characters," as command directives. The shell meta characters are recognized anywhere they appear in the command line, even if they are not surrounded by blank space. For that reason, it is safest to only use the characters A-Z, a-z, 0-9, and the period, dash, and underscore characters when naming files and directories on Unix. If your file or directory has a shell meta character in the name, you will find it difficult to use the name in a shell command.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3419
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3420
     <p id="ch9Using_Linux_Tools_df">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3421
      The shell meta characters include:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3422
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3423
     <p id="ch9Using_Linux_Tools_e0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3424
      / &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3425
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3426
     <p id="ch9Using_Linux_Tools_e1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3427
      Different shells may differ in the meta characters recognized.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3428
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3429
     <p id="ch9Using_Linux_Tools_e2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3430
      As an example,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3431
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3432
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3433
      $ ls file.*
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3434
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3435
     <p id="ch9Using_Linux_Tools_e3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3436
      run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3437
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3438
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3439
      $ ls file.?
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3440
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3441
     <p id="ch9Using_Linux_Tools_e4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3442
      run on the same directory would only list file.c because the ? only matches one character, no more, no less. This can save you a great deal of typing time. For example, if there is a file called california_cornish_hens_with_wild_rice and no other files whose names begin with 'c', you could view the file without typing the whole name by typing this:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3443
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3444
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3445
      $ more c*
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3446
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3447
     <p id="ch9Using_Linux_Tools_e5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3448
      because the c* matches that long file name.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3449
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3450
     <p id="ch9Using_Linux_Tools_e6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3451
      Filenames containing metacharacters can pose many problems and should never be intentionally created. If you do find that you've created a file with metacharacters, and you would like to remove it, you have three options. You may use wildcards to match metacharacter, use the  to directly enter the filename, or put the command in double quotes (except in the case of double quotes within the file name, these must be captured with one of the first two methods). For example, deleting a file named
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3452
      <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3453
       &lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3454
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3455
      "` can be accomplished with:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3456
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3457
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3458
      $ rm ??more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3459
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3460
     <p id="ch9Using_Linux_Tools_e7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3461
      or:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3462
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3463
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3464
      $ rm $\backslash$*$\backslash$|more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3465
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3466
     <p id="ch9Using_Linux_Tools_e8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3467
      or:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3468
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3469
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3470
      $ rm ''*|more''
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3471
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3472
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3473
    <div class="section" title="9.Looking At Files">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3474
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3475
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3476
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3477
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3478
         <a name="id2492941">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3479
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3480
         9.Looking At Files
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3481
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3482
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3483
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3484
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3485
     <div class="section" title="9.1.cat">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3486
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3487
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3488
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3489
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3490
          <a name="id2492949">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3491
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3492
          9.1.cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3493
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3494
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3495
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3496
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3497
      <p id="ch9Using_Linux_Tools_e9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3498
       The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3499
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3500
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3501
         cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3502
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3503
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3504
       command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3505
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3506
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3507
         concatenate
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3508
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3509
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3510
       .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3511
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3512
      <p id="ch9Using_Linux_Tools_ea">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3513
       The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3514
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3515
      <p id="ch9Using_Linux_Tools_eb">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3516
       If the filename is specified as -, then
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3517
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3518
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3519
         cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3520
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3521
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3522
       will read from standard input at that point in the sequence. If no files are specified,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3523
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3524
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3525
         cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3526
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3527
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3528
       will read from standard input entered.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3529
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3530
      <div class="section" title="9.1.1.Jargon File Definition">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3531
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3532
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3533
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3534
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3535
           <a name="id2492993">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3536
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3537
           9.1.1.Jargon File Definition
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3538
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3539
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3540
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3541
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3542
       <p id="ch9Using_Linux_Tools_ec">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3543
        The Jargon File version 4.4.7 lists this as the definition of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3544
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3545
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3546
          cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3547
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3548
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3549
        :
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3550
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3551
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3552
        1. To spew an entire file to the screen or some other output sink without
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3553
     pause (syn. blast).
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3554
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3555
2. By extension, to dump large amounts of data at an unprepared target or
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3556
     with no intention of browsing it carefully. Usage: considered silly.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3557
     Rare outside Unix sites. See also dd, BLT.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3558
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3559
     Among Unix fans, *cat(1)* is considered an excellent example of
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3560
     user-interface design, because it delivers the file contents without
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3561
     such verbosity as spacing or headers between the files, and because
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3562
     it does not require the files to consist of lines of text, but works
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3563
     with any sort of data.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3564
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3565
     Among Unix critics, *cat(1)* is considered the canonical example of
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3566
     bad user-interface design, because of its woefully unobvious name.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3567
     It is far more often used to blast a single file to standard output
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3568
     than to concatenate two or more files. The name cat for the former
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3569
     operation is just as unintuitive as, say, LISP's cdr.
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  3570
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3571
     Of such oppositions are holy wars made...
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3572
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3573
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3574
      <div class="section" title="9.1.2.Useless Use of 'cat'">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3575
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3576
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3577
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3578
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3579
           <a name="id2493032">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3580
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3581
           9.1.2.Useless Use of 'cat'
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3582
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3583
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3584
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3585
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3586
       <p id="ch9Using_Linux_Tools_ed">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3587
        UUOC (from comp.unix.shell on Usenet) stands for Useless Use of cat. As it is observed on
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3588
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3589
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3590
          comp.unix.shell
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3591
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3592
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3593
        , The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3594
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3595
       <p id="ch9Using_Linux_Tools_ee">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3596
        Nevertheless one sees people doing:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3597
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3598
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3599
        $ cat file | some_command and its args ...
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3600
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3601
       <p id="ch9Using_Linux_Tools_ef">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3602
        instead of the equivalent and cheaper:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3603
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3604
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3605
        &lt;file some_command and its args ...
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3606
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3607
       <p id="ch9Using_Linux_Tools_f0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3608
        or (equivalently and more classically):
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3609
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3610
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3611
        some_command and its args ... &lt;file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3612
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3613
       <p id="ch9Using_Linux_Tools_f1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3614
        Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3615
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3616
       <p id="ch9Using_Linux_Tools_f2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3617
        Amongst many, it is still considered safer to use
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3618
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3619
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3620
          cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3621
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3622
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3623
        for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3624
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3625
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3626
      <div class="section" title="9.1.3.zcat">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3627
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3628
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3629
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3630
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3631
           <a name="id2493103">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3632
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3633
           9.1.3.zcat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3634
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3635
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3636
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3637
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3638
       <p id="ch9Using_Linux_Tools_f3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3639
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3640
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3641
          zcat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3642
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3643
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3644
        is a Unix program similar to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3645
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3646
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3647
          cat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3648
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3649
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3650
        , that decompresses individual files and concatenates them to standard output. Traditionally
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3651
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3652
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3653
          zcat
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3654
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3655
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3656
        operated on files compressed by compress but today it is usually able to operate on
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3657
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3658
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3659
          gzip
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3660
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3661
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3662
        or even
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3663
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3664
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3665
          bzip2
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3666
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3667
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3668
        archives. On such systems, it is equivalent to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3669
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3670
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3671
          gunzip -c
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3672
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3673
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3674
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3675
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3676
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3677
     <div class="section" title="9.2.more">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3678
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3679
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3680
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3681
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3682
          <a name="id2493137">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3683
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3684
          9.2.more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3685
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3686
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3687
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3688
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3689
      <p id="ch9Using_Linux_Tools_f4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3690
       In computing,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3691
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3692
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3693
         more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3694
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3695
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3696
       is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3697
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3698
      <div class="section" title="9.2.1.Usage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3699
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3700
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3701
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3702
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3703
           <a name="id2493157">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3704
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3705
           9.2.1.Usage
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3706
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3707
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3708
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3709
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3710
       <p id="ch9Using_Linux_Tools_f5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3711
        The command-syntax is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3712
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3713
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3714
        $ more [options] [file_name]
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3715
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3716
       <p id="ch9Using_Linux_Tools_f6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3717
        If no file name is provided,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3718
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3719
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3720
          more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3721
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3722
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3723
        looks for input from stdin.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3724
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3725
       <p id="ch9Using_Linux_Tools_f7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3726
        Once
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3727
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3728
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3729
          more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3730
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3731
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3732
        has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3733
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3734
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3735
          more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3736
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3737
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3738
        to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3739
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3740
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3741
          more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3742
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3743
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3744
        has paged through. (This percentage includes the text displayed on the current screen.) When
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3745
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3746
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3747
          more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3748
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3749
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3750
        reaches the end of a file (100%) it exits. The most common methods of navigating through a file are
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3751
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3752
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3753
          Enter
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3754
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3755
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3756
        , which advances the output by one line, and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3757
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3758
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3759
          Space
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3760
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3761
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3762
        , which advances the output by one screen.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3763
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3764
       <p id="ch9Using_Linux_Tools_f8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3765
        There are also other commands that can be used while navigating through the document; consult
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3766
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3767
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3768
          more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3769
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3770
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3771
        's
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3772
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3773
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3774
          man
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3775
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3776
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3777
        page for more details.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3778
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3779
       <p id="ch9Using_Linux_Tools_f9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3780
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3781
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3782
          Options
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3783
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3784
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3785
        are typically entered before the file name, but can also be entered in the environment variable
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3786
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3787
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3788
          $MORE
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3789
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3790
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3791
        . Options entered in the actual command line will override those entered in the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3792
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3793
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3794
          $MORE
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3795
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3796
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3797
        environment variable. Available options may vary between Unix systems.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3798
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3799
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3800
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3801
     <div class="section" title="9.3.less">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3802
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3803
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3804
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3805
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3806
          <a name="id2493248">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3807
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3808
          9.3.less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3809
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3810
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3811
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3812
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3813
      <p id="ch9Using_Linux_Tools_fa">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3814
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3815
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3816
         less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3817
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3818
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3819
       is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3820
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3821
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3822
         more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3823
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3824
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3825
       , but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3826
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3827
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3828
         less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3829
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3830
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3831
       does not need to read the entire file before starting, resulting in faster load times with large files.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3832
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3833
      <div class="section" title="9.3.1.Usage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3834
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3835
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3836
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3837
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3838
           <a name="id2493277">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3839
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3840
           9.3.1.Usage
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3841
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3842
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3843
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3844
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3845
       <p id="ch9Using_Linux_Tools_fb">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3846
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3847
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3848
          less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3849
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3850
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3851
        can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3852
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3853
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3854
          less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3855
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3856
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3857
        is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3858
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3859
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3860
          more
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3861
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3862
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3863
        and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3864
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3865
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3866
          vi
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3867
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3868
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3869
        . It is also possible to search for character patterns in the file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3870
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3871
       <p id="ch9Using_Linux_Tools_fc">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3872
        By default,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3873
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3874
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3875
          less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3876
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3877
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3878
        displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3879
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3880
       <p id="ch9Using_Linux_Tools_fd">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3881
        The command-syntax is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3882
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3883
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3884
        $ less [options] file_name
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3885
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3886
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3887
      <div class="section" title="9.3.2.Frequently Used Options">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3888
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3889
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3890
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3891
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3892
           <a name="id2493338">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3893
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3894
           9.3.2.Frequently Used Options
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3895
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3896
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3897
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3898
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3899
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3900
        &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3901
        <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3902
         <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3903
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3904
           <p id="ch9Using_Linux_Tools_fe">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3905
            -g: Highlights just the current match of any searched string.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3906
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3907
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3908
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3909
           <p id="ch9Using_Linux_Tools_ff">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3910
            -I: Case-insensitive searches.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3911
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3912
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3913
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3914
           <p id="ch9Using_Linux_Tools_100">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3915
            -M: Shows more detailed prompt, including file position.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3916
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3917
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3918
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3919
           <p id="ch9Using_Linux_Tools_101">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3920
            -N: Shows line numbers (useful for source code viewing).
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3921
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3922
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3923
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3924
           <p id="ch9Using_Linux_Tools_102">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3925
            -S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3926
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3927
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3928
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3929
           <p id="ch9Using_Linux_Tools_103">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3930
            -?: Shows help.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3931
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3932
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3933
         </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3934
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3935
        &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3936
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3937
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3938
      <div class="section" title="9.3.3.Frequently Used Commands">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3939
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3940
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3941
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3942
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3943
           <a name="id2493391">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3944
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3945
           9.3.3.Frequently Used Commands
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3946
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3947
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3948
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3949
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3950
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3951
        &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3952
        <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3953
         <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3954
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3955
           <p id="ch9Using_Linux_Tools_104">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3956
            [Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3957
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3958
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3959
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3960
           <p id="ch9Using_Linux_Tools_105">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3961
            [Space bar]: Next page.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3962
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3963
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3964
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3965
           <p id="ch9Using_Linux_Tools_106">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3966
            b: Previous page.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3967
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3968
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3969
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3970
           <p id="ch9Using_Linux_Tools_107">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3971
            ng: Jump to line number n. Default is the start of the file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3972
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3973
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3974
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3975
           <p id="ch9Using_Linux_Tools_108">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3976
            nG: Jump to line number n. Default is the end of the file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3977
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3978
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3979
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3980
           <p id="ch9Using_Linux_Tools_109">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3981
            /pattern: Search for pattern. Regular expressions can be used.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3982
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3983
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3984
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3985
           <p id="ch9Using_Linux_Tools_10a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3986
            '^ or g: Go to start of file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3987
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3988
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3989
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3990
           <p id="ch9Using_Linux_Tools_10b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3991
            '$ or G: Go to end of file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3992
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3993
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3994
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3995
           <p id="ch9Using_Linux_Tools_10c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3996
            s: Save current content (got from another program like grep) in a file.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3997
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3998
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  3999
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4000
           <p id="ch9Using_Linux_Tools_10d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4001
            =: File information.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4002
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4003
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4004
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4005
           <p id="ch9Using_Linux_Tools_10e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4006
            h: Help.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4007
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4008
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4009
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4010
           <p id="ch9Using_Linux_Tools_10f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4011
            q: Quit.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4012
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4013
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4014
         </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4015
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4016
        &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4017
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4018
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4019
      <div class="section" title="9.3.4.Examples">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4020
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4021
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4022
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4023
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4024
           <a name="id2493482">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4025
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4026
           9.3.4.Examples
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4027
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4028
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4029
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4030
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4031
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4032
        $ less -M readme.txt                     #Read "readme.txt."
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  4033
$ less +F /var/log/mail.log              #Follow mode for log
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  4034
$ file * | less                          #Easier file analysis.
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4035
$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4036
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4037
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4038
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4039
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4040
    <div class="section" title="10.Directory Structure">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4041
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4042
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4043
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4044
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4045
         <a name="id2493498">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4046
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4047
         10.Directory Structure
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4048
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4049
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4050
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4051
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4052
     <p id="ch9Using_Linux_Tools_110">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4053
      In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4054
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4055
     <p id="ch9Using_Linux_Tools_111">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4056
      The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4057
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4058
     <table summary="Directory Structure" border="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4059
      <colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4060
       <col width="15">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4061
       </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4062
       <col width="48">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4063
       </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4064
      </colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4065
     </table>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4066
     <div class="section" title="10.1.man hier">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4067
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4068
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4069
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4070
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4071
          <a name="id2493772">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4072
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4073
          10.1.man hier
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4074
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4075
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4076
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4077
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4078
      <p id="ch9Using_Linux_Tools_136">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4079
       This is the manual page on the UNIX filesystem. The syntax for this is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4080
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4081
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4082
       $ man hier
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4083
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4084
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4085
     <div class="section" title="10.2.ls -l">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4086
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4087
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4088
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4089
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4090
          <a name="id2493788">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4091
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4092
          10.2.ls -l
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4093
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4094
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4095
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4096
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4097
      <p id="ch9Using_Linux_Tools_137">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4098
       Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4099
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4100
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4101
       $ ls -l
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4102
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4103
      <p id="ch9Using_Linux_Tools_138">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4104
       This can be done after entering the required directory.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4105
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4106
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4107
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4108
    <div class="section" title="11.Permissions and Ownership">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4109
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4110
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4111
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4112
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4113
         <a name="id2493811">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4114
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4115
         11.Permissions and Ownership
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4116
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4117
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4118
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4119
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4120
     <div class="section" title="11.1.chmod">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4121
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4122
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4123
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4124
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4125
          <a name="id2493820">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4126
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4127
          11.1.chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4128
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4129
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4130
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4131
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4132
      <p id="ch9Using_Linux_Tools_139">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4133
       The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4134
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4135
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4136
         chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4137
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4138
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4139
       command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4140
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4141
      <div class="section" title="11.1.1.Usage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4142
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4143
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4144
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4145
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4146
           <a name="id2493846">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4147
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4148
           11.1.1.Usage
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4149
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4150
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4151
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4152
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4153
       <p id="ch9Using_Linux_Tools_13a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4154
        The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4155
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4156
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4157
          chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4158
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4159
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4160
        command options are specified like this:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4161
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4162
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4163
        $ chmod [options] mode[,mode] file1 [file2 ...]
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4164
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4165
       <p id="ch9Using_Linux_Tools_13b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4166
        To view what the permissions currently are, type:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4167
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4168
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4169
        $ ls -l file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4170
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4171
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4172
      <div class="section" title="11.1.2.Command line options">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4173
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4174
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4175
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4176
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4177
           <a name="id2493874">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4178
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4179
           11.1.2.Command line options
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4180
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4181
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4182
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4183
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4184
       <p id="ch9Using_Linux_Tools_13c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4185
        The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4186
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4187
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4188
          chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4189
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4190
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4191
        command has a number of command line options that affect its behavior. The most common options are:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4192
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4193
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4194
        &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4195
        <div class="itemizedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4196
         <ul class="itemizedlist" type="*">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4197
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4198
           <p id="ch9Using_Linux_Tools_13d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4199
            -R: Changes the modes of directories and files recursively
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4200
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4201
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4202
          <li class="listitem" style="list-style-type: *">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4203
           <p id="ch9Using_Linux_Tools_13e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4204
            -v: Verbose mode; lists all files as they are being processed
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4205
           </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4206
          </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4207
         </ul>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4208
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4209
        &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4210
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4211
       <div class="section" title="11.1.2.1.Symbolic modes">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4212
        <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4213
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4214
          <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4215
           <h5 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4216
            <a name="id2493911">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4217
            </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4218
            11.1.2.1.Symbolic modes
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4219
           </h5>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4220
          </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4221
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4222
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4223
        <p id="ch9Using_Linux_Tools_13f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4224
         To the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4225
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4226
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4227
           chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4228
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4229
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4230
         utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4231
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4232
        <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4233
         $ chmod [references][operator][modes] file1 ...
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4234
        </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4235
        <p id="ch9Using_Linux_Tools_140">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4236
         The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to all but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4237
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4238
        <table summary="Symbolic modes" border="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4239
         <colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4240
          <col width="14">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4241
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4242
          <col width="8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4243
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4244
          <col width="45">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4245
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4246
         </colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4247
        </table>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4248
        <p id="ch9Using_Linux_Tools_150">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4249
         The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4250
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4251
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4252
           chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4253
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4254
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4255
         program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4256
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4257
        <table summary="Symbolic modes" border="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4258
         <colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4259
          <col width="14">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4260
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4261
          <col width="54">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4262
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4263
         </colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4264
        </table>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4265
        <p id="ch9Using_Linux_Tools_157">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4266
         The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4267
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4268
        <table summary="Symbolic modes" border="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4269
         <colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4270
          <col width="5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4271
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4272
          <col width="14">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4273
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4274
          <col width="48">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4275
          </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4276
         </colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4277
        </table>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4278
        <p id="ch9Using_Linux_Tools_16d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4279
         The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4280
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4281
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4282
       <div class="section" title="11.1.2.2.Symbolic examples">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4283
        <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4284
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4285
          <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4286
           <h5 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4287
            <a name="id2494472">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4288
            </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4289
            11.1.2.2.Symbolic examples
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4290
           </h5>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4291
          </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4292
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4293
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4294
        <p id="ch9Using_Linux_Tools_16e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4295
         Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4296
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4297
        <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4298
         $ chmod ug+rw mydir
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  4299
$ ls -ld mydir
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4300
drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4301
        </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4302
        <p id="ch9Using_Linux_Tools_16f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4303
         For a file, remove
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4304
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4305
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4306
           write
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4307
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4308
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4309
         permissions for all classes:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4310
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4311
        <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4312
         $ chmod a-w myfile
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  4313
$ ls -l myfile
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4314
-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4315
        </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4316
        <p id="ch9Using_Linux_Tools_170">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4317
         Set the permissions for the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4318
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4319
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4320
           u*ser and the *g*roup to read and execute only (no write permission) on *mydir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4321
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4322
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4323
         .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4324
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4325
        <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4326
         $ chmod ug=rx mydir
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  4327
$ ls -ld mydir
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4328
dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4329
        </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4330
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4331
       <div class="section" title="11.1.2.3.Octal numbers">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4332
        <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4333
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4334
          <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4335
           <h5 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4336
            <a name="id2494515">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4337
            </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4338
            11.1.2.3.Octal numbers
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4339
           </h5>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4340
          </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4341
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4342
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4343
        <p id="ch9Using_Linux_Tools_171">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4344
         The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4345
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4346
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4347
           chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4348
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4349
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4350
         command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4351
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4352
        <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4353
         $ chmod 664 myfile
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  4354
$ ls -l myfile
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4355
-rw-rw-r--  1   57 Jul  3 10:13  myfile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4356
        </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4357
        <p id="ch9Using_Linux_Tools_172">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4358
         Since the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4359
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4360
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4361
           setuid
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4362
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4363
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4364
         ,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4365
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4366
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4367
           setgid
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4368
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4369
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4370
         and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4371
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4372
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4373
           sticky
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4374
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4375
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4376
         bits are not set, this is equivalent to:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4377
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4378
        <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4379
         $ chmod 0664 myfile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4380
        </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4381
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4382
       <div class="section" title="11.1.2.4.Special modes">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4383
        <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4384
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4385
          <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4386
           <h5 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4387
            <a name="id2494554">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4388
            </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4389
            11.1.2.4.Special modes
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4390
           </h5>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4391
          </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4392
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4393
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4394
        <p id="ch9Using_Linux_Tools_173">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4395
         The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4396
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4397
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4398
           chmod
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4399
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4400
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4401
         command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4402
         <span class="strong">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4403
          <strong>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4404
           s
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4405
          </strong>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4406
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4407
         to represent the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4408
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4409
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4410
           setuid
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4411
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4412
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4413
         and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4414
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4415
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4416
           setgid
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4417
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4418
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4419
         modes, and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4420
         <span class="strong">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4421
          <strong>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4422
           t
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4423
          </strong>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4424
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4425
         to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4426
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4427
        <p id="ch9Using_Linux_Tools_174">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4428
         Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4429
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4430
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4431
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4432
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4433
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4434
    <div class="section" title="12.Redirection and Piping">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4435
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4436
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4437
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4438
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4439
         <a name="id2494598">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4440
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4441
         12.Redirection and Piping
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4442
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4443
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4444
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4445
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4446
     <p id="ch9Using_Linux_Tools_175">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4447
      In computing,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4448
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4449
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4450
        redirection
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4451
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4452
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4453
      is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4454
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4455
     <p id="ch9Using_Linux_Tools_176">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4456
      Programs do redirection with the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4457
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4458
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4459
        dup2(2)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4460
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4461
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4462
      system call, or its less-flexible but higher-level stdio analogues,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4463
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4464
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4465
        freopen(3)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4466
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4467
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4468
      and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4469
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4470
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4471
        popen(3)
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4472
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4473
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4474
      .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4475
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4476
     <div class="section" title="12.1.Redirecting standard input and standard output">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4477
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4478
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4479
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4480
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4481
          <a name="id2494633">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4482
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4483
          12.1.Redirecting standard input and standard output
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4484
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4485
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4486
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4487
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4488
      <p id="ch9Using_Linux_Tools_177">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4489
       Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4490
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4491
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4492
       $ command1 &gt; file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4493
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4494
      <p id="ch9Using_Linux_Tools_178">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4495
       executes
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4496
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4497
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4498
         command1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4499
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4500
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4501
       , placing the output in file1. Note that this will truncate any existing data in
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4502
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4503
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4504
         file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4505
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4506
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4507
       . To append output to the end of the file, use the &gt;&gt; operator.:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4508
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4509
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4510
       $ command1 &lt; file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4511
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4512
      <p id="ch9Using_Linux_Tools_179">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4513
       executes
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4514
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4515
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4516
         command1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4517
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4518
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4519
       , using
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4520
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4521
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4522
         file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4523
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4524
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4525
       as the source of input (as opposed to the keyboard).:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4526
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4527
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4528
       $ command1 &lt; infile &gt; outfile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4529
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4530
      <p id="ch9Using_Linux_Tools_17a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4531
       combines the two capabilities:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4532
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4533
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4534
         command1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4535
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4536
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4537
       reads from
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4538
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4539
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4540
         infile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4541
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4542
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4543
       and writes to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4544
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4545
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4546
         outfile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4547
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4548
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4549
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4550
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4551
     <div class="section" title="12.2.Piping">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4552
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4553
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4554
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4555
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4556
          <a name="id2494702">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4557
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4558
          12.2.Piping
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4559
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4560
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4561
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4562
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4563
      <p id="ch9Using_Linux_Tools_17b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4564
       Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4565
A pipeline of three programs run on a text terminal:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4566
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4567
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4568
       $ command1 | command2
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4569
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4570
      <p id="ch9Using_Linux_Tools_17c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4571
       executes
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4572
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4573
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4574
         command1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4575
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4576
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4577
       , using its output as the input for
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4578
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4579
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4580
         command2
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4581
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4582
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4583
       (commonly called piping, since the "|" character is known as a "pipe").
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4584
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4585
      <p id="ch9Using_Linux_Tools_17d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4586
       This is equivalent to using two redirects and a temporary file:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4587
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4588
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4589
       $ command1 &gt; tempfile
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  4590
$ command2 &lt; tempfile
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4591
$ rm tempfile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4592
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4593
      <p id="ch9Using_Linux_Tools_17e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4594
       A good example for command piping is combining
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4595
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4596
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4597
         echo
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4598
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4599
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4600
       with another command to achieve something interactive in a non-interactive shell, e.g.:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4601
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4602
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4603
       $ echo -e "user\npass" | ftp localhost
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4604
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4605
      <p id="ch9Using_Linux_Tools_17f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4606
       This runs the ftp client with input user, press return, then pass.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4607
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4608
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4609
     <div class="section" title="12.3.Redirecting to and from the standard file handles">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4610
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4611
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4612
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4613
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4614
          <a name="id2494764">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4615
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4616
          12.3.Redirecting to and from the standard file handles
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4617
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4618
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4619
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4620
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4621
      <p id="ch9Using_Linux_Tools_180">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4622
       In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4623
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4624
      <table summary="Redirecting to and from the standard file handles" border="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4625
       <colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4626
        <col width="12">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4627
        </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4628
        <col width="13">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4629
        </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4630
        <col width="24">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4631
        </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4632
       </colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4633
      </table>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4634
      <p id="ch9Using_Linux_Tools_18d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4635
       For example:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4636
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4637
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4638
       $ command1 2&gt; file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4639
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4640
      <p id="ch9Using_Linux_Tools_18e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4641
       executes
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4642
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4643
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4644
         command1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4645
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4646
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4647
       , directing the standard error stream to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4648
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4649
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4650
         file1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4651
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4652
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4653
       .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4654
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4655
      <p id="ch9Using_Linux_Tools_18f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4656
       In shells derived from
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4657
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4658
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4659
         csh
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4660
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4661
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4662
       (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4663
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4664
      <p id="ch9Using_Linux_Tools_190">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4665
       Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4666
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4667
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4668
       $ find / -name .profile &gt; results 2&gt;&amp;1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4669
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4670
      <p id="ch9Using_Linux_Tools_191">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4671
       will try to find all files named
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4672
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4673
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4674
         .profile
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4675
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4676
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4677
       . Executed without redirection, it will output hits to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4678
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4679
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4680
         stdout
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4681
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4682
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4683
       and errors (e.g. for lack of privilege to traverse protected directories) to
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4684
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4685
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4686
         stderr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4687
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4688
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4689
       . If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4690
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4691
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4692
         stderr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4693
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4694
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4695
       (handle 2) into
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4696
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4697
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4698
         stdout
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4699
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4700
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4701
       (handle 1) using 2&gt;&amp;1 .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4702
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4703
      <p id="ch9Using_Linux_Tools_192">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4704
       It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4705
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4706
      <p id="ch9Using_Linux_Tools_193">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4707
       If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4708
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4709
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4710
       $ find / -name .profile 2&gt;&amp;1 | less
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4711
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4712
      <p id="ch9Using_Linux_Tools_194">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4713
       A simplified form of the command:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4714
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4715
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4716
       $ command &gt; file 2&gt;&amp;1
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4717
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4718
      <p id="ch9Using_Linux_Tools_195">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4719
       is:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4720
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4721
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4722
       $ command &amp;&gt;file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4723
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4724
      <p id="ch9Using_Linux_Tools_196">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4725
       or:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4726
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4727
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4728
       $command &gt;&amp;file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4729
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4730
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4731
     <div class="section" title="12.4.Chained pipelines">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4732
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4733
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4734
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4735
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4736
          <a name="id2494971">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4737
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4738
          12.4.Chained pipelines
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4739
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4740
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4741
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4742
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4743
      <p id="ch9Using_Linux_Tools_197">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4744
       The redirection and piping tokens can be chained together to create complex commands. For example:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4745
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4746
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4747
       $ ls | grep '\.sh' | sort &gt; shlist
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4748
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4749
      <p id="ch9Using_Linux_Tools_198">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4750
       lists the contents of the current directory, where this output is filtered to only contain lines which contain
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4751
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4752
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4753
         .sh
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4754
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4755
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4756
       , sort this resultant output lexicographically, and place the final output in
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4757
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4758
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4759
         shlist
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4760
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4761
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4762
       . This type of construction is used very commonly in shell scripts and batch files.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4763
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4764
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4765
     <div class="section" title="12.5.Redirect to multiple outputs">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4766
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4767
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4768
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4769
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4770
          <a name="id2495005">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4771
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4772
          12.5.Redirect to multiple outputs
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4773
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4774
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4775
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4776
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4777
      <p id="ch9Using_Linux_Tools_199">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4778
       The standard command
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4779
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4780
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4781
         tee
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4782
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4783
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4784
       can redirect output from a command to several destinations.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4785
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4786
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4787
       $ ls -lrt | tee xyz
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4788
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4789
      <p id="ch9Using_Linux_Tools_19a">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4790
       This directs the file list output to both standard output as well as to the file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4791
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4792
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4793
         xyz
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4794
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4795
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4796
       .
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4797
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4798
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4799
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4800
    <div class="section" title="13.More Text Processing">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4801
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4802
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4803
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4804
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4805
         <a name="id2495036">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4806
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4807
         13.More Text Processing
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4808
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4809
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4810
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4811
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4812
     <div class="section" title="13.1.grep">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4813
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4814
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4815
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4816
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4817
          <a name="id2495045">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4818
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4819
          13.1.grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4820
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4821
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4822
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4823
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4824
      <p id="ch9Using_Linux_Tools_19b">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4825
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4826
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4827
         grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4828
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4829
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4830
       is a command line text search utility originally written for Unix. The name is taken from the first letters in
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4831
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4832
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4833
         global / regular expression / print
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4834
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4835
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4836
       , a series of instructions for the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4837
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4838
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4839
         ed
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4840
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4841
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4842
       text editor. The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4843
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4844
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4845
         grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4846
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4847
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4848
       command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4849
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4850
      <div class="section" title="13.1.1.Usage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4851
       <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4852
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4853
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4854
          <h4 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4855
           <a name="id2495076">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4856
           </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4857
           13.1.1.Usage
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4858
          </h4>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4859
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4860
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4861
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4862
       <p id="ch9Using_Linux_Tools_19c">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4863
        This is an example of a common
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4864
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4865
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4866
          grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4867
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4868
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4869
        usage:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4870
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4871
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4872
        $ grep apple fruitlist.txt
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4873
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4874
       <p id="ch9Using_Linux_Tools_19d">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4875
        In this case,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4876
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4877
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4878
          grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4879
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4880
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4881
        prints all lines containing 'apple' from the file
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4882
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4883
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4884
          fruitlist.txt
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4885
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4886
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4887
        , regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4888
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4889
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4890
          grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4891
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4892
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4893
        command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4894
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4895
       <p id="ch9Using_Linux_Tools_19e">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4896
        Like most Unix commands,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4897
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4898
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4899
          grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4900
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4901
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4902
        accepts command line arguments to change this and many other behaviors. For example:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4903
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4904
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4905
        $ grep -i apple fruitlist.txt
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4906
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4907
       <p id="ch9Using_Linux_Tools_19f">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4908
        This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4909
        <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4910
         <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4911
          grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4912
         </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4913
        </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4914
        to be case insensitive, or to ignore case.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4915
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4916
       <p id="ch9Using_Linux_Tools_1a0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4917
        To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4918
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4919
       <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4920
        $ grep -w apple fruitlist.txt
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4921
       </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4922
       <p id="ch9Using_Linux_Tools_1a1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4923
        Regular expressions can be used to match more complicated queries.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4924
       </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4925
       <div class="section" title="13.1.1.1.Variations">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4926
        <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4927
         <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4928
          <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4929
           <h5 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4930
            <a name="id2495155">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4931
            </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4932
            13.1.1.1.Variations
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4933
           </h5>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4934
          </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4935
         </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4936
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4937
        <p id="ch9Using_Linux_Tools_1a2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4938
         There are countless implementations and derivatives of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4939
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4940
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4941
           grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4942
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4943
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4944
         available for many operating systems. Early variants of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4945
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4946
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4947
           grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4948
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4949
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4950
         included
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4951
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4952
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4953
           egrep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4954
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4955
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4956
         and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4957
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4958
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4959
           fgrep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4960
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4961
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4962
         . The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4963
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4964
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4965
           grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4966
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4967
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4968
         implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4969
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4970
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4971
           grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4972
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4973
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4974
         may also behave differently depending on the name by which it is invoked, allowing
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4975
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4976
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4977
           fgrep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4978
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4979
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4980
         ,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4981
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4982
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4983
           egrep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4984
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4985
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4986
         , and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4987
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4988
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4989
           grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4990
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4991
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4992
         to be links to the same program.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4993
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4994
        <p id="ch9Using_Linux_Tools_1a3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4995
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4996
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4997
           pcregrep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4998
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  4999
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5000
         is an implementation of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5001
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5002
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5003
           grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5004
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5005
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5006
         that uses Perl regular expression syntax.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5007
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5008
        <p id="ch9Using_Linux_Tools_1a4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5009
         Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5010
         <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5011
          <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5012
           pgrep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5013
          </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5014
         </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5015
         utility, for instance, displays the processes whose names match a given regular expression.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5016
        </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5017
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5018
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5019
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5020
     <div class="section" title="13.2.tr">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5021
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5022
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5023
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5024
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5025
          <a name="id2495235">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5026
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5027
          13.2.tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5028
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5029
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5030
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5031
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5032
      <p id="ch9Using_Linux_Tools_1a5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5033
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5034
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5035
         tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5036
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5037
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5038
       (abbreviated from
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5039
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5040
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5041
         translate
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5042
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5043
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5044
       or
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5045
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5046
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5047
         transliterate
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5048
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5049
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5050
       ) is a command in Unix-like operating systems.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5051
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5052
      <p id="ch9Using_Linux_Tools_1a6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5053
       When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5054
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5055
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5056
       $ tr 'abcd' 'jkmn'
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5057
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5058
      <p id="ch9Using_Linux_Tools_1a7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5059
       maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5060
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5061
      <p id="ch9Using_Linux_Tools_1a8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5062
       Sets of characters may be abbreviated by using character ranges. The previous example could be written:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5063
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5064
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5065
       $ tr 'a-d' 'jkmn'
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5066
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5067
      <p id="ch9Using_Linux_Tools_1a9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5068
       In POSIX compliant versions of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5069
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5070
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5071
         tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5072
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5073
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5074
       the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5075
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5076
      <p id="ch9Using_Linux_Tools_1aa">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5077
       The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5078
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5079
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5080
         -c
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5081
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5082
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5083
       flag complements the first set of characters.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5084
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5085
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5086
       $ tr -cd '[:alnum:]'
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5087
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5088
      <p id="ch9Using_Linux_Tools_1ab">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5089
       therefore removes all non-alphanumeric characters.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5090
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5091
      <p id="ch9Using_Linux_Tools_1ac">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5092
       The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5093
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5094
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5095
         -s
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5096
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5097
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5098
       flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5099
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5100
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5101
       $ tr -s '\n' '\n'
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5102
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5103
      <p id="ch9Using_Linux_Tools_1ad">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5104
       replaces sequences of one or more newline characters with a single newline.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5105
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5106
      <p id="ch9Using_Linux_Tools_1ae">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5107
       The
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5108
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5109
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5110
         -d
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5111
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5112
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5113
       flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5114
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5115
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5116
       $ tr -d '\r'
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5117
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5118
      <p id="ch9Using_Linux_Tools_1af">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5119
       Most versions of
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5120
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5121
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5122
         tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5123
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5124
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5125
       , including GNU
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5126
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5127
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5128
         tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5129
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5130
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5131
       and classic Unix
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5132
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5133
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5134
         tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5135
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5136
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5137
       , operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5138
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5139
      <p id="ch9Using_Linux_Tools_1b0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5140
       Ruby and Perl also have an internal
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5141
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5142
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5143
         tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5144
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5145
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5146
       operator, which operates analogously. Tcl's
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5147
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5148
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5149
         string map
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5150
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5151
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5152
       command is more general in that it maps strings to strings while
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5153
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5154
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5155
         tr
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5156
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5157
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5158
       maps characters to characters.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5159
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5160
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5161
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5162
    <div class="section" title="14.Elementary Regex">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5163
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5164
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5165
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5166
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5167
         <a name="id2495386">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5168
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5169
         14.Elementary Regex
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5170
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5171
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5172
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5173
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5174
     <p id="ch9Using_Linux_Tools_1b1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5175
      In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5176
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5177
     <p id="ch9Using_Linux_Tools_1b2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5178
      Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributionsincluding the editor
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5179
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5180
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5181
        ed
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5182
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5183
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5184
      and the filter
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5185
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5186
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5187
        grep
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5188
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5189
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5190
      were the first to popularize the concept of regular expressions.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5191
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5192
     <p id="ch9Using_Linux_Tools_1b3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5193
      Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5194
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5195
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5196
        Basic Regular Expressions
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5197
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5198
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5199
      (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5200
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5201
     <p id="ch9Using_Linux_Tools_1b4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5202
      In the BRE syntax, most characters are treated as literals  they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5203
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5204
     <table summary="Elementary Regex" border="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5205
      <colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5206
       <col width="13">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5207
       </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5208
       <col width="60">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5209
       </col>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5210
      </colgroup>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5211
     </table>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5212
     <div class="section" title="14.1.Lazy quantification">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5213
      <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5214
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5215
        <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5216
         <h3 class="title">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5217
          <a name="id2495602">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5218
          </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5219
          14.1.Lazy quantification
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5220
         </h3>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5221
        </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5222
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5223
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5224
      <p id="ch9Using_Linux_Tools_1c9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5225
       The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5226
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5227
      <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5228
       Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5229
      </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5230
      <p id="ch9Using_Linux_Tools_1ca">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5231
       ...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5232
       <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5233
        &lt;title_reference&gt;*&lt;/title_reference&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5234
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5235
       quantifier is greedy  it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5236
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5237
      <p id="ch9Using_Linux_Tools_1cb">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5238
       Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5239
       <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5240
        <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5241
         lazy
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5242
        </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5243
       </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5244
       (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5245
      </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5246
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5247
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5248
    <div class="section" title="15.One Liners">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5249
     <div class="titlepage">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5250
      <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5251
       <div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5252
        <h2 class="title" style="clear: both">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5253
         <a name="id2495679">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5254
         </a>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5255
         15.One Liners
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5256
        </h2>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5257
       </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5258
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5259
     </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5260
     <p id="ch9Using_Linux_Tools_1cc">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5261
      A
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5262
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5263
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5264
        one-liner
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5265
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5266
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5267
      is textual input to the command-line of an operating system shell that performs some function in just one line of input.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5268
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5269
     <p id="ch9Using_Linux_Tools_1cd">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5270
      The one liner can be
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5271
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5272
     <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5273
      &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5274
      <div class="orderedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5275
       <ol class="orderedlist" type="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5276
        <li class="listitem">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5277
         <p id="ch9Using_Linux_Tools_1ce">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5278
          An expression written in the language of the shell.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5279
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5280
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5281
        <li class="listitem">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5282
         <p id="ch9Using_Linux_Tools_1cf">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5283
          The invocation of an interpreter together with program source for the interpreter to run.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5284
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5285
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5286
        <li class="listitem">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5287
         <p id="ch9Using_Linux_Tools_1d0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5288
          The invocation of a compiler together with source to compile and
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5289
instructions for executing the compiled program.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5290
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5291
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5292
       </ol>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5293
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5294
      &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5295
     </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5296
     <p id="ch9Using_Linux_Tools_1d1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5297
      Certain dynamic scripting languages such as AWK, sed, and perl have traditionally been adept at expressing one-liners. Specialist shell interpreters such as these Unix shells or the Windows PowerShell, allow for the construction of powerful one-liners.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5298
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5299
     <p id="ch9Using_Linux_Tools_1d2">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5300
      The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5301
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5302
     <p id="ch9Using_Linux_Tools_1d3">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5303
      The word
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5304
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5305
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5306
        One-liner
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5307
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5308
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5309
      has two references in the index of the book
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5310
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5311
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5312
        The AWK Programming Language
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5313
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5314
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5315
      (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5316
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5317
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5318
      The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5319
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5320
     <p id="ch9Using_Linux_Tools_1d4">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5321
      Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5322
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5323
     <p id="ch9Using_Linux_Tools_1d5">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5324
      The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5325
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5326
     <p id="ch9Using_Linux_Tools_1d6">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5327
      Here are the first few of them:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5328
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5329
     <span style="color: red">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5330
      &lt;block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5331
      <div class="orderedlist">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5332
       <ol class="orderedlist" type="1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5333
        <li class="listitem">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5334
         <p id="ch9Using_Linux_Tools_1d7">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5335
          Print the total number of input lines:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5336
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5337
         <p id="ch9Using_Linux_Tools_1d8">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5338
          END { print NR }
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5339
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5340
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5341
        <li class="listitem">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5342
         <p id="ch9Using_Linux_Tools_1d9">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5343
          Print the tenth input line:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5344
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5345
         <p id="ch9Using_Linux_Tools_1da">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5346
          NR == 10
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5347
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5348
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5349
        <li class="listitem">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5350
         <p id="ch9Using_Linux_Tools_1db">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5351
          Print the last field of every input line:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5352
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5353
         <p id="ch9Using_Linux_Tools_1dc">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5354
          { print $NF }
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5355
         </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5356
        </li>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5357
       </ol>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5358
      </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5359
      &lt;/block_quote&gt;
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5360
     </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5361
     <p id="ch9Using_Linux_Tools_1dd">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5362
      One-liners are also used to show off the differential expressive power of programming languages. Frequently, one-liners are used to demonstrate programming ability. Contests are often held to see who can create the most exceptional one-liner.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5363
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5364
     <p id="ch9Using_Linux_Tools_1de">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5365
      The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5366
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5367
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5368
      main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5369
*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5370
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5371
     <p id="ch9Using_Linux_Tools_1df">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5372
      This one-liner program is a
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5373
      <span class="emphasis">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5374
       <em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5375
        glob pattern matcher
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5376
       </em>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5377
      </span>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5378
      . It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5379
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5380
     <p id="ch9Using_Linux_Tools_1e0">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5381
      Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5382
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5383
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5384
      $ prog foo 'f??'; echo $?
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  5385
6
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5386
$ prog 'best short program' '??st*o**p?*'; echo $?
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5387
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5388
     <p id="ch9Using_Linux_Tools_1e1">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5389
      Here is a one line shell script to show directories:
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5390
     </p>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5391
     <pre class="programlisting">
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5392
      $ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5393
     </pre>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5394
    </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5395
   </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5396
  </div>
1ce9b33fb6ff sorted the problem related to paths
amit@thunder
parents: 2
diff changeset
  5397
 </body>
1
672eaaab9204 Added some new html files that failed earlier during change from rst
amit@thunder
parents:
diff changeset
  5398
</html>