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