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

en: Edit Assoc page (again)
author Paul Issott <paul@slitaz.org>
date Tue Oct 27 21:11:51 2009 +0000 (2009-10-27)
parents fa2c5bed2417
children 0e0bc81a63ee
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" />
MikeDSmith25@117 9 <meta name="modified" content="2008-07-16 22:00: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>
pascal@550 34 <li><a href="cmdline.html#intro">Introduction to the commands.</a></li>
pascal@550 35 <li><a href="cmdline.html#help">Help and list available commands.</a></li>
pascal@550 36 <li><a href="cmdline.html#ls">List the files in a directory.</a></li>
pascal@550 37 <li><a href="cmdline.html#cd">Moving around directories.</a></li>
pascal@550 38 <li><a href="cmdline.html#cp">Copy files.</a></li>
pascal@550 39 <li><a href="cmdline.html#mkdir">Create a new directory.</a></li>
pascal@550 40 <li><a href="cmdline.html#rm">Remove files or directories.</a></li>
pascal@550 41 <li><a href="cmdline.html#read">View the files.</a></li>
pascal@550 42 <li><a href="cmdline.html#edit">Edit files in ncurses mode.</a></li>
pascal@550 43 <li><a href="cmdline.html#cat">Cat</a> - Edit a line of commands.</li>
pascal@550 44 <li><a href="cmdline.html#web-nav">Navigate the web.</a></li>
pascal@550 45 <li><a href="cmdline.html#irc-chat">Chat on IRC channels.</a></li>
pascal@550 46 <li><a href="cmdline.html#wget">Download files.</a></li>
pascal@550 47 <li><a href="cmdline.html#partitions">List the available partitions.</a></li>
pascal@550 48 <li><a href="cmdline.html#mount">Mount a partition, cdrom or USB key.</a></li>
pascal@550 49 <li><a href="cmdline.html#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.
MikeDSmith25@117 59 Note it is necessary to operate as <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>
MikeDSmith25@117 65 Most GNU/Linux system commands have an option for providing information on
paul@166 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
MikeDSmith25@117 75 Tab button on 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@166 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@155 175 its 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@100 184 <pre>
paul@100 185 $ rm -ir /home/hacker/Templates
paul@100 186 </pre>
paul@95 187
paul@95 188 <a name="read"></a>
paul@95 189 <h3><font color="#6c0023">View files</font></h3>
paul@95 190 <p>
paul@95 191 To read the contents of a file or script, you can use the
paul@95 192 <code>less</code>, <code>more</code> or <code>cat</code> commands, or the web
paul@95 193 browser Retawq. Examples with a README file, essential.txt, and
paul@95 194 script.sh:
paul@95 195 </p>
paul@95 196 <pre>
paul@95 197 $ less -EM essential.txt
paul@95 198 or :
paul@95 199 $ more README
paul@95 200 or :
paul@95 201 $ cat /path/to/script.sh
paul@95 202 </pre>
paul@95 203 <p>
paul@95 204 Display a text or html file with the web browser Retawq:
paul@95 205 </p>
paul@95 206 <pre>
paul@95 207 $ retawq /usr/share/doc/index.html
paul@95 208 </pre>
paul@95 209
paul@95 210 <a name="edit"></a>
paul@95 211 <h3><font color="#6c0023">Edit files</font></h3>
paul@95 212 <p>
paul@156 213 Editing text files, scripts, configuration files, etc, can be done easily using
paul@95 214 the text editor GNU Nano in a console or graphical terminal.
paul@95 215 Example with a file bookmarks.html (&lt;Ctrl+X&gt; to quit
paul@95 216 and save):
paul@95 217 </p>
paul@95 218 <pre>
paul@95 219 $ nano Public/bookmarks.html
paul@95 220 </pre>
paul@95 221
paul@95 222 <a name="cat"></a>
paul@95 223 <h3><font color="#6c0023">Cat</font></h3>
paul@95 224 <p>
paul@95 225 You can use the <code>cat</code> command to create various text files. EOF signifies
paul@95 226 End Of File, this is where the file ends. Example with a file packages.list, this
paul@95 227 removes the current contents of the file and lets you add some new text:
paul@95 228 </p>
paul@95 229 <pre>
paul@95 230 $ cat &gt; packages.list &lt;&lt; "EOF"
paul@95 231 The text...
paul@95 232 and more text
paul@95 233
paul@95 234 EOF
paul@95 235 </pre>
paul@95 236 <p>
paul@101 237 To append to the following text file, put two greater than signs
paul@95 238 (&gt;&gt;) after <code>cat</code>, example:
paul@95 239 </p>
paul@95 240 <pre>
paul@95 241 $ cat &gt;&gt; packages.list &lt;&lt; "EOF"
paul@95 242 The text...
paul@95 243
paul@95 244 EOF
paul@95 245 </pre>
paul@95 246
paul@95 247 <a name="web-nav"></a>
paul@95 248 <h3><font color="#6c0023">Navigate the web</font></h3>
paul@95 249 <p>
paul@95 250 Surf the web quickly and simply with the 'retawq' text-mode web browser.
paul@95 251 Note that you can also use the local browser. You can then navigate easily
paul@95 252 with the arrows on your keyboard - links are colored blue and can be
paul@95 253 followed by pressing &lt;ENTER&gt;:
paul@95 254 </p>
paul@95 255 <pre>
paul@102 256 $ retawq http://www.slitaz.org/en
paul@95 257 or :
paul@95 258 $ retawq http://localhost/
paul@95 259 </pre>
paul@95 260
paul@95 261 <a name="irc-chat"></a>
paul@95 262 <h3><font color="#6c0023">Talk on IRC</font></h3>
paul@95 263 <p>
paul@95 264 To discuss and transfer files via the many IRC servers available, SliTaz
paul@95 265 provides Rhapsody. The IRC client is simple, fast and lightweight, providing
paul@95 266 a pleasant, easy to handle ncurses configuration menu. To start the application
erjo@133 267 from a terminal connecting to server (irc.toile-libre.org) and joining #slitaz:
paul@95 268 </p>
paul@95 269 <pre>
paul@95 270 $ rhapsody
paul@95 271 /connect irc.freenode.net
paul@95 272 /join #slitaz
paul@95 273 </pre>
paul@95 274 <a name="wget"></a>
paul@95 275 <h3><font color="#6c0023">Download files</font></h3>
paul@95 276 <p>
paul@95 277 To download various file formats on the internet, you have the <code>wget</code>
paul@95 278 command. To grab a simple html page, the contents of a folder or an entire
paul@95 279 website:
paul@95 280 </p>
paul@95 281 <pre>
paul@95 282 $ wget http://www.slitaz.org/en/doc/handbook/
paul@95 283 </pre>
paul@95 284
paul@95 285 <a name="partitions"></a>
paul@95 286 <h3><font color="#6c0023">List the available partitions</font></h3>
paul@95 287 <p>
paul@95 288 To list the partitions on an internal or external hard drive, you can use
paul@95 289 <code>cat</code> to display the contents of <code>/proc/partitions</code>
paul@95 290 or use the <code>fdisk</code> utility with the <code>-l</code> option
paul@95 291 meaning <em>list</em>. You can then mount the individual partition(s)
paul@95 292 that you want to use:
paul@95 293 </p>
paul@95 294 <pre>
paul@95 295 $ cat /proc/partitions
paul@95 296 or :
paul@95 297 # fdisk -l
paul@95 298 </pre>
paul@95 299
paul@95 300 <a name="mount"></a>
paul@95 301 <h3><font color="#6c0023">Mount a partition, CD or USB drive</font></h3>
paul@95 302 <p>
MikeDSmith25@117 303 To mount a local partition in the SliTaz filesystem, we recommend you use
paul@95 304 the /mnt directory. Example creating the necessary directory and mounting
paul@95 305 the <code>hda6</code> partition of the first local hard drive on /mnt/hda6:
paul@95 306 </p>
paul@95 307 <pre>
paul@95 308 # mkdir -p /mnt/hda6
paul@95 309 # mount -t ext3 /dev/hda6 /mnt/hda6
paul@95 310 </pre>
paul@95 311 <p>
paul@95 312 SliTaz functions in RAM, you can mount the same cdrom or remove it
paul@146 313 to mount another (/dev/cdrom is a link to the first cdrom drive).
MikeDSmith25@117 314 Note that a cdrom is a removable medium and should be
paul@95 315 mounted on /media:
paul@95 316 </p>
paul@95 317 <pre>
paul@95 318 # mount -t iso9660 /dev/cdrom /media/cdrom
paul@95 319 </pre>
paul@95 320 <p>
paul@95 321 To mount a USB or flash drive you must specify the proper filesystem.
paul@95 322 Normally a USB key is formatted in FAT32 which can be read from GNU/Linux
paul@95 323 and Windows operating systems. On a GNU/Linux system is it generally
paul@95 324 recognized as the sda1 device - we now prepare a link <code>sda1</code> on
paul@95 325 <code>flash</code> to facilitate the task. Note it is also a removable medium
paul@95 326 and should be mounted on /media:
paul@95 327 </p>
paul@95 328 <pre>
paul@95 329 # mount -t vfat /dev/flash /media/flash
paul@95 330 </pre>
paul@95 331
paul@95 332 <a name="halt"></a>
paul@95 333 <h3><font color="#6c0023">Turn off the system or restart</font></h3>
paul@95 334 <p>
MikeDSmith25@117 335 To stop or restart SliTaz, you can use the <code>halt</code> or <code>reboot</code>
paul@138 336 commands or the &lt;Ctrl+Alt+Delete&gt; key combination which enables a
paul@95 337 system reboot. In case of any problems you can use the <code>-f</code>
paul@95 338 option signifing <em>forced</em>:
paul@95 339 </p>
paul@95 340 <pre>
paul@95 341 # halt
paul@95 342 To restart :
paul@95 343 # reboot
paul@95 344 Or :
paul@95 345 # reboot -f
paul@95 346 </pre>
paul@95 347
paul@95 348 <!-- End of content -->
paul@95 349 </div>
paul@95 350
paul@95 351 <!-- Footer. -->
paul@95 352 <div id="footer">
paul@95 353 <div class="footer-right"></div>
pascal@550 354 <a href="cmdline.html#top">Top of the page</a> |
paul@95 355 <a href="index.html">Table of contents</a>
paul@95 356 </div>
paul@95 357
paul@95 358 <div id="copy">
paul@95 359 Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
paul@95 360 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
paul@95 361 Documentation is under
paul@95 362 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
paul@95 363 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
paul@95 364 </div>
paul@95 365
paul@95 366 </body>
paul@95 367 </html>
paul@95 368