website annotate en/doc/handbook/cmdline.html @ rev 99

en: Typo Hdk
author Paul Issott <paul@slitaz.org>
date Sat Jul 05 13:31:32 2008 +0000 (2008-07-05)
parents 503cb2f011fc
children 3043897130bf
rev   line source
paul@95 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
paul@95 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
paul@95 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
paul@95 4 <head>
paul@95 5 <title>SliTaz Handbook (en) - Commands</title>
paul@95 6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
paul@95 7 <meta name="description" content="slitaz English handbook" />
paul@95 8 <meta name="expires" content="never" />
paul@95 9 <meta name="modified" content="2008-02-26 18:30:00" />
paul@95 10 <meta name="publisher" content="www.slitaz.org" />
paul@95 11 <meta name="author" content="Christophe Lincoln"/>
paul@95 12 <link rel="shortcut icon" href="favicon.ico" />
paul@95 13 <link rel="stylesheet" type="text/css" href="book.css" />
paul@95 14 </head>
paul@95 15 <body bgcolor="#ffffff">
paul@95 16
paul@95 17 <!-- Header and quick navigation -->
paul@95 18 <div id="header">
paul@95 19 <div align="right" id="quicknav">
paul@95 20 <a name="top"></a>
paul@95 21 <a href="install.html">Installation</a> |
paul@95 22 <a href="index.html">Table of contents</a>
paul@95 23 </div>
paul@95 24 <h1><font color="#3E1220">SliTaz Handbook (en)</font></h1>
paul@95 25 </div>
paul@95 26
paul@95 27 <!-- Content. -->
paul@95 28 <div id="content">
paul@95 29 <div class="content-right"></div>
paul@95 30
paul@95 31 <h2><font color="#DF8F06">Command Line Reference (<em>cmdline</em>)</font></h2>
paul@95 32
paul@95 33 <ul>
paul@95 34 <li><a href="#intro">Introduction to the commands.</a></li>
paul@95 35 <li><a href="#help">Help and list available commands.</a></li>
paul@95 36 <li><a href="#ls">List the files in a directory.</a></li>
paul@95 37 <li><a href="#cd">Moving around directories.</a></li>
paul@95 38 <li><a href="#cp">Copy files.</a></li>
paul@95 39 <li><a href="#mkdir">Create a new directory.</a></li>
paul@95 40 <li><a href="#rm">Remove files or directories.</a></li>
paul@95 41 <li><a href="#read">View the files.</a></li>
paul@95 42 <li><a href="#edit">Edit files in ncurses mode.</a></li>
paul@95 43 <li><a href="#cat">Cat</a> - Edit a line of commands.</li>
paul@95 44 <li><a href="#web-nav">Navigate the web.</a></li>
paul@95 45 <li><a href="#irc-chat">Chat on IRC channels.</a></li>
paul@95 46 <li><a href="#wget">Download files.</a></li>
paul@95 47 <li><a href="#partitions">List the available partitions.</a></li>
paul@95 48 <li><a href="#mount">Mount a partition, cdrom or USB key.</a></li>
paul@95 49 <li><a href="#halt">Halt the system or Reboot.</a></li>
paul@95 50 </ul>
paul@95 51
paul@95 52 <a name="intro"></a>
paul@95 53 <h3><font color="#6c0023">Introduction to the commands</font></h3>
paul@95 54 <p>
paul@95 55 This document is intended as a quick reference for using commands on SliTaz via
paul@95 56 a Linux terminal or a graphical terminal (xterm). There are many GNU/Linux commands
paul@95 57 for file handling, system maintenance or network management. You can also browse
paul@95 58 the web, chat on IRC, download files, edit scripts or even play games in text mode.
paul@95 59 Note it is necessary to operate in <em>root</em> to assemble the hard drive or cdrom.
paul@95 60 You can use the command <code>su</code> to become system administrator.
paul@95 61 </p>
paul@95 62 <a name="help"></a>
paul@95 63 <h3><font color="#6c0023">Help and list available commands</font></h3>
paul@95 64 <p>
paul@95 65 Most GNU/Linux system commands have an option for assisting information on
paul@95 66 their use. For support on the use of a command it is necessary to type the
paul@95 67 command followed by the <code>--help</code> option. Example using the
paul@95 68 <code>cp</code> command to copy files:
paul@95 69 </p>
paul@95 70 <pre>
paul@95 71 $ cp --help
paul@95 72 </pre>
paul@95 73 <p>
paul@95 74 To list all the commands available on the system, you can simply press the
paul@95 75 Tab button to the left of the keyboard twice. For commands provided by the
paul@95 76 Busybox utility you can type <code>busybox --help</code>.
paul@95 77 </p>
paul@95 78
paul@95 79 <a name="ls"></a>
paul@95 80 <h3><font color="#6c0023">List the files in a directory</font></h3>
paul@95 81 <p>
paul@95 82 To list the files and folders contained in a directory, you can use the
paul@95 83 <code>ls</code> command. For all options remember to use the <code>--help</code>
paul@95 84 flag. To simply list the files in the current directory:
paul@95 85 </p>
paul@95 86 <pre>
paul@95 87 $ ls
paul@95 88 </pre>
paul@95 89 <p>
paul@95 90 List all the files using the <code>-al</code> option:
paul@95 91 </p>
paul@95 92 <pre>
paul@95 93 $ ls -al
paul@95 94 </pre>
paul@95 95 <p>
paul@95 96 List a directory:
paul@95 97 </p>
paul@95 98 <pre>
paul@95 99 $ ls /home/slitaz
paul@95 100 </pre>
paul@95 101
paul@95 102 <a name="cd"></a>
paul@95 103 <h3><font color="#6c0023">Moving around directories</font></h3>
paul@95 104 <p>
paul@95 105 To browse to the files you can use the <code>cd</code> command:
paul@95 106 </p>
paul@95 107 <pre>
paul@95 108 $ cd /usr/share/doc
paul@95 109 Back to the parent directory:
paul@95 110 $ cd ..
paul@95 111 </pre>
paul@95 112 <p>
paul@95 113 To go into the directory of the user (root = /root):
paul@95 114 </p>
paul@95 115 <pre>
paul@95 116 $ cd
paul@95 117 Or :
paul@95 118 $ cd ~
paul@95 119 Or :
paul@95 120 $ cd $HOME
paul@95 121 </pre>
paul@95 122
paul@95 123 <a name="cp"></a>
paul@95 124 <h3><font color="#6c0023">Copy files</font></h3>
paul@95 125 <p>
paul@95 126 The <code>cp</code> command copies files or folders. The example copies the
paul@95 127 info.txt file in the current directory into the Documents directory:
paul@95 128 </p>
paul@95 129 <pre>
paul@95 130 $ cp info.txt Documents/
paul@95 131 </pre>
paul@95 132 <p>
paul@95 133 Copy a whole directory. Here the command copies the Templates directory
paul@95 134 into /home/hacker:
paul@95 135 </p>
paul@95 136 <pre>
paul@95 137 $ cp -a Templates /home/hacker
paul@95 138 </pre>
paul@95 139
paul@95 140 <a name="mkdir"></a>
paul@95 141 <h3><font color="#6c0023">Create a new directory</font></h3>
paul@95 142 <p>
paul@95 143 This command will create a new directory. The following command creates a
paul@95 144 directory called Projects. It will be created in the directory /home of the
paul@95 145 current user or in the directory which one is in. Note you can display
paul@95 146 your current working directory with the <code>pwd</code> command:
paul@95 147 </p>
paul@95 148 <pre>
paul@95 149 $ mkdir Projects
paul@95 150 </pre>
paul@95 151 <p>
paul@95 152 Creation of a directory named script-1.0 in the Projects folder:
paul@95 153 </p>
paul@95 154 <pre>
paul@95 155 $ mkdir Projects/script-1.0
paul@95 156 </pre>
paul@95 157 <p>
paul@95 158 You can also create a directory tree with the <code>-p</code> parents option:
paul@95 159 </p>
paul@95 160 <pre>
paul@95 161 $ mkdir -p one/two/three/four
paul@95 162 </pre>
paul@95 163
paul@95 164 <a name="rm"></a>
paul@95 165 <h3><font color="#6c0023">Delete files or directories</font></h3>
paul@95 166 <p>
paul@95 167 The command <code>rm</code> lets you delete a file. Let's remove the
paul@95 168 file work.txt which is in the current directory:
paul@95 169 </p>
paul@95 170 <pre>
paul@95 171 $ rm work.txt
paul@95 172 </pre>
paul@95 173 <p>
paul@95 174 The command <code>rm</code> has several options. To delete a directory and
paul@95 175 it's contents, we use the <code>-rf</code> option.
paul@95 176 Example:
paul@95 177 </p>
paul@95 178 <pre>
paul@95 179 $ rm -rf /home/hacker/Templates
paul@95 180 </pre>
paul@95 181 <p>
paul@99 182 Note you can also use the <code>-i</code> option to remove files or directories and their contents interactively:
paul@95 183 </p>
paul@95 184
paul@95 185 <a name="read"></a>
paul@95 186 <h3><font color="#6c0023">View files</font></h3>
paul@95 187 <p>
paul@95 188 To read the contents of a file or script, you can use the
paul@95 189 <code>less</code>, <code>more</code> or <code>cat</code> commands, or the web
paul@95 190 browser Retawq. Examples with a README file, essential.txt, and
paul@95 191 script.sh:
paul@95 192 </p>
paul@95 193 <pre>
paul@95 194 $ less -EM essential.txt
paul@95 195 or :
paul@95 196 $ more README
paul@95 197 or :
paul@95 198 $ cat /path/to/script.sh
paul@95 199 </pre>
paul@95 200 <p>
paul@95 201 Display a text or html file with the web browser Retawq:
paul@95 202 </p>
paul@95 203 <pre>
paul@95 204 $ retawq /usr/share/doc/index.html
paul@95 205 </pre>
paul@95 206
paul@95 207 <a name="edit"></a>
paul@95 208 <h3><font color="#6c0023">Edit files</font></h3>
paul@95 209 <p>
paul@95 210 Editing text files, scripts, configuration files etc, can be done easily using
paul@95 211 the text editor GNU Nano in a console or graphical terminal.
paul@95 212 Example with a file bookmarks.html (&lt;Ctrl+X&gt; to quit
paul@95 213 and save):
paul@95 214 </p>
paul@95 215 <pre>
paul@95 216 $ nano Public/bookmarks.html
paul@95 217 </pre>
paul@95 218
paul@95 219 <a name="cat"></a>
paul@95 220 <h3><font color="#6c0023">Cat</font></h3>
paul@95 221 <p>
paul@95 222 You can use the <code>cat</code> command to create various text files. EOF signifies
paul@95 223 End Of File, this is where the file ends. Example with a file packages.list, this
paul@95 224 removes the current contents of the file and lets you add some new text:
paul@95 225 </p>
paul@95 226 <pre>
paul@95 227 $ cat &gt; packages.list &lt;&lt; "EOF"
paul@95 228 The text...
paul@95 229 and more text
paul@95 230
paul@95 231 EOF
paul@95 232 </pre>
paul@95 233 <p>
paul@95 234 To amend to the following text file, put two greater than signs
paul@95 235 (&gt;&gt;) after <code>cat</code>, example:
paul@95 236 </p>
paul@95 237 <pre>
paul@95 238 $ cat &gt;&gt; packages.list &lt;&lt; "EOF"
paul@95 239 The text...
paul@95 240
paul@95 241 EOF
paul@95 242 </pre>
paul@95 243
paul@95 244 <a name="web-nav"></a>
paul@95 245 <h3><font color="#6c0023">Navigate the web</font></h3>
paul@95 246 <p>
paul@95 247 Surf the web quickly and simply with the 'retawq' text-mode web browser.
paul@95 248 Note that you can also use the local browser. You can then navigate easily
paul@95 249 with the arrows on your keyboard - links are colored blue and can be
paul@95 250 followed by pressing &lt;ENTER&gt;:
paul@95 251 </p>
paul@95 252 <pre>
paul@95 253 $ retawq http://slitaz.org/en
paul@95 254 or :
paul@95 255 $ retawq http://localhost/
paul@95 256 </pre>
paul@95 257
paul@95 258 <a name="irc-chat"></a>
paul@95 259 <h3><font color="#6c0023">Talk on IRC</font></h3>
paul@95 260 <p>
paul@95 261 To discuss and transfer files via the many IRC servers available, SliTaz
paul@95 262 provides Rhapsody. The IRC client is simple, fast and lightweight, providing
paul@95 263 a pleasant, easy to handle ncurses configuration menu. To start the application
paul@95 264 from a terminal connecting to server (irc.freenode.net) and joining #slitaz:
paul@95 265 </p>
paul@95 266 <pre>
paul@95 267 $ rhapsody
paul@95 268 /connect irc.freenode.net
paul@95 269 /join #slitaz
paul@95 270 </pre>
paul@95 271 <a name="wget"></a>
paul@95 272 <h3><font color="#6c0023">Download files</font></h3>
paul@95 273 <p>
paul@95 274 To download various file formats on the internet, you have the <code>wget</code>
paul@95 275 command. To grab a simple html page, the contents of a folder or an entire
paul@95 276 website:
paul@95 277 </p>
paul@95 278 <pre>
paul@95 279 $ wget http://www.slitaz.org/en/doc/handbook/
paul@95 280 </pre>
paul@95 281
paul@95 282 <a name="partitions"></a>
paul@95 283 <h3><font color="#6c0023">List the available partitions</font></h3>
paul@95 284 <p>
paul@95 285 To list the partitions on an internal or external hard drive, you can use
paul@95 286 <code>cat</code> to display the contents of <code>/proc/partitions</code>
paul@95 287 or use the <code>fdisk</code> utility with the <code>-l</code> option
paul@95 288 meaning <em>list</em>. You can then mount the individual partition(s)
paul@95 289 that you want to use:
paul@95 290 </p>
paul@95 291 <pre>
paul@95 292 $ cat /proc/partitions
paul@95 293 or :
paul@95 294 # fdisk -l
paul@95 295 </pre>
paul@95 296
paul@95 297 <a name="mount"></a>
paul@95 298 <h3><font color="#6c0023">Mount a partition, CD or USB drive</font></h3>
paul@95 299 <p>
paul@95 300 To mount a local partition in the SliTaz filesystem, we advise you to use
paul@95 301 the /mnt directory. Example creating the necessary directory and mounting
paul@95 302 the <code>hda6</code> partition of the first local hard drive on /mnt/hda6:
paul@95 303 </p>
paul@95 304 <pre>
paul@95 305 # mkdir -p /mnt/hda6
paul@95 306 # mount -t ext3 /dev/hda6 /mnt/hda6
paul@95 307 </pre>
paul@95 308 <p>
paul@95 309 SliTaz functions in RAM, you can mount the same cdrom or remove it
paul@95 310 to mount another (/dev/cdrom is a link on the first cdrom drive).
paul@95 311 Note that a cdrom is a removable medium, it should be
paul@95 312 mounted on /media:
paul@95 313 </p>
paul@95 314 <pre>
paul@95 315 # mount -t iso9660 /dev/cdrom /media/cdrom
paul@95 316 </pre>
paul@95 317 <p>
paul@95 318 To mount a USB or flash drive you must specify the proper filesystem.
paul@95 319 Normally a USB key is formatted in FAT32 which can be read from GNU/Linux
paul@95 320 and Windows operating systems. On a GNU/Linux system is it generally
paul@95 321 recognized as the sda1 device - we now prepare a link <code>sda1</code> on
paul@95 322 <code>flash</code> to facilitate the task. Note it is also a removable medium
paul@95 323 and should be mounted on /media:
paul@95 324 </p>
paul@95 325 <pre>
paul@95 326 # mount -t vfat /dev/flash /media/flash
paul@95 327 </pre>
paul@95 328
paul@95 329 <a name="halt"></a>
paul@95 330 <h3><font color="#6c0023">Turn off the system or restart</font></h3>
paul@95 331 <p>
paul@95 332 To stop or restart SliTaz, you can use the <code>halt</code>, <code>reboot</code>
paul@95 333 commands or the &lt;Ctrl+Alt+Delete&gt; key combinations, which enable a
paul@95 334 system reboot. In case of any problems you can use the <code>-f</code>
paul@95 335 option signifing <em>forced</em>:
paul@95 336 </p>
paul@95 337 <pre>
paul@95 338 # halt
paul@95 339 To restart :
paul@95 340 # reboot
paul@95 341 Or :
paul@95 342 # reboot -f
paul@95 343 </pre>
paul@95 344
paul@95 345 <!-- End of content -->
paul@95 346 </div>
paul@95 347
paul@95 348 <!-- Footer. -->
paul@95 349 <div id="footer">
paul@95 350 <div class="footer-right"></div>
paul@95 351 <a href="#top">Top of the page</a> |
paul@95 352 <a href="index.html">Table of contents</a>
paul@95 353 </div>
paul@95 354
paul@95 355 <div id="copy">
paul@95 356 Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
paul@95 357 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
paul@95 358 Documentation is under
paul@95 359 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
paul@95 360 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
paul@95 361 </div>
paul@95 362
paul@95 363 </body>
paul@95 364 </html>
paul@95 365