website view en/doc/handbook/cmdline.html @ rev 669

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