# HG changeset patch # User Paul Issott # Date 1215215169 0 # Node ID 503cb2f011fcd47b9846847c742dc6f7ee71bedb # Parent a5e20c75073a2995ee6d8a642e27432ca59e6ee9 en: Add Commands to Hbk diff -r a5e20c75073a -r 503cb2f011fc en/doc/handbook/cmdline.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/en/doc/handbook/cmdline.html Fri Jul 04 23:46:09 2008 +0000 @@ -0,0 +1,365 @@ + + + + SliTaz Handbook (en) - Commands + + + + + + + + + + + + + + + +
+
+ +

Command Line Reference (cmdline)

+ + + + +

Introduction to the commands

+

+This document is intended as a quick reference for using commands on SliTaz via +a Linux terminal or a graphical terminal (xterm). There are many GNU/Linux commands +for file handling, system maintenance or network management. You can also browse +the web, chat on IRC, download files, edit scripts or even play games in text mode. +Note it is necessary to operate in root to assemble the hard drive or cdrom. +You can use the command su to become system administrator. +

+ +

Help and list available commands

+

+Most GNU/Linux system commands have an option for assisting information on +their use. For support on the use of a command it is necessary to type the +command followed by the --help option. Example using the +cp command to copy files: +

+
+ $ cp --help
+
+

+To list all the commands available on the system, you can simply press the +Tab button to the left of the keyboard twice. For commands provided by the +Busybox utility you can type busybox --help. +

+ + +

List the files in a directory

+

+To list the files and folders contained in a directory, you can use the +ls command. For all options remember to use the --help +flag. To simply list the files in the current directory: +

+
+ $ ls
+
+

+List all the files using the -al option: +

+
+ $ ls -al
+
+

+List a directory: +

+
+ $ ls /home/slitaz
+
+ + +

Moving around directories

+

+To browse to the files you can use the cd command: +

+
+ $ cd /usr/share/doc
+ Back to the parent directory:
+ $ cd ..
+
+

+To go into the directory of the user (root = /root): +

+
+ $ cd
+ Or :
+ $ cd ~
+ Or :
+ $ cd $HOME
+
+ + +

Copy files

+

+The cp command copies files or folders. The example copies the +info.txt file in the current directory into the Documents directory: +

+
+ $ cp info.txt Documents/
+
+

+Copy a whole directory. Here the command copies the Templates directory +into /home/hacker: +

+
+ $ cp -a Templates /home/hacker
+
+ + +

Create a new directory

+

+This command will create a new directory. The following command creates a +directory called Projects. It will be created in the directory /home of the +current user or in the directory which one is in. Note you can display +your current working directory with the pwd command: +

+
+ $ mkdir Projects
+
+

+Creation of a directory named script-1.0 in the Projects folder: +

+
+ $ mkdir Projects/script-1.0
+
+

+You can also create a directory tree with the -p parents option: +

+
+ $ mkdir -p one/two/three/four
+
+ + +

Delete files or directories

+

+The command rm lets you delete a file. Let's remove the +file work.txt which is in the current directory: +

+
+ $ rm work.txt
+
+

+The command rm has several options. To delete a directory and +it's contents, we use the -rf option. +Example: +

+
+ $ rm -rf /home/hacker/Templates
+
+

+Note you can also use the -i option to remove files interactively. +

+ + +

View files

+

+To read the contents of a file or script, you can use the +less, more or cat commands, or the web +browser Retawq. Examples with a README file, essential.txt, and +script.sh: +

+
+ $ less -EM essential.txt
+ or :
+ $ more README
+ or :
+ $ cat /path/to/script.sh
+
+

+Display a text or html file with the web browser Retawq: +

+
+ $ retawq /usr/share/doc/index.html
+
+ + +

Edit files

+

+Editing text files, scripts, configuration files etc, can be done easily using +the text editor GNU Nano in a console or graphical terminal. +Example with a file bookmarks.html (<Ctrl+X> to quit +and save): +

+
+ $ nano Public/bookmarks.html
+
+ + +

Cat

+

+You can use the cat command to create various text files. EOF signifies +End Of File, this is where the file ends. Example with a file packages.list, this +removes the current contents of the file and lets you add some new text: +

+
+ $ cat > packages.list << "EOF"
+ The text...
+ and more text
+ 
+ EOF
+
+

+To amend to the following text file, put two greater than signs +(>>) after cat, example: +

+
+ $ cat >> packages.list << "EOF"
+ The text...
+ 
+ EOF
+
+ + +

Navigate the web

+

+Surf the web quickly and simply with the 'retawq' text-mode web browser. +Note that you can also use the local browser. You can then navigate easily +with the arrows on your keyboard - links are colored blue and can be +followed by pressing <ENTER>: +

+
+ $ retawq http://slitaz.org/en
+ or :
+ $ retawq http://localhost/
+
+ + +

Talk on IRC

+

+To discuss and transfer files via the many IRC servers available, SliTaz +provides Rhapsody. The IRC client is simple, fast and lightweight, providing +a pleasant, easy to handle ncurses configuration menu. To start the application +from a terminal connecting to server (irc.freenode.net) and joining #slitaz: +

+
+ $ rhapsody
+ /connect irc.freenode.net
+ /join #slitaz
+
+ +

Download files

+

+To download various file formats on the internet, you have the wget +command. To grab a simple html page, the contents of a folder or an entire +website: +

+
+ $ wget http://www.slitaz.org/en/doc/handbook/
+
+ + +

List the available partitions

+

+To list the partitions on an internal or external hard drive, you can use +cat to display the contents of /proc/partitions +or use the fdisk utility with the -l option +meaning list. You can then mount the individual partition(s) +that you want to use: +

+
+ $ cat /proc/partitions
+ or :
+ # fdisk -l
+
+ + +

Mount a partition, CD or USB drive

+

+To mount a local partition in the SliTaz filesystem, we advise you to use +the /mnt directory. Example creating the necessary directory and mounting +the hda6 partition of the first local hard drive on /mnt/hda6: +

+
+ # mkdir -p /mnt/hda6
+ # mount -t ext3 /dev/hda6 /mnt/hda6
+
+

+SliTaz functions in RAM, you can mount the same cdrom or remove it +to mount another (/dev/cdrom is a link on the first cdrom drive). +Note that a cdrom is a removable medium, it should be +mounted on /media: +

+
+ # mount -t iso9660 /dev/cdrom /media/cdrom
+
+

+To mount a USB or flash drive you must specify the proper filesystem. +Normally a USB key is formatted in FAT32 which can be read from GNU/Linux +and Windows operating systems. On a GNU/Linux system is it generally +recognized as the sda1 device - we now prepare a link sda1 on +flash to facilitate the task. Note it is also a removable medium +and should be mounted on /media: +

+
+ # mount -t vfat /dev/flash /media/flash
+
+ + +

Turn off the system or restart

+

+To stop or restart SliTaz, you can use the halt, reboot +commands or the <Ctrl+Alt+Delete> key combinations, which enable a +system reboot. In case of any problems you can use the -f +option signifing forced: +

+
+ # halt
+ To restart :
+ # reboot
+ Or :
+ # reboot -f
+
+ + +
+ + + + +
+ Copyright © 2008 SliTaz - + GNU General Public License;
+ Documentation is under + GNU Free Documentation License + and code is valid xHTML 1.0. +
+ + + + diff -r a5e20c75073a -r 503cb2f011fc en/doc/handbook/index.html --- a/en/doc/handbook/index.html Mon Jun 30 21:10:19 2008 +0000 +++ b/en/doc/handbook/index.html Fri Jul 04 23:46:09 2008 +0000 @@ -34,6 +34,7 @@ diff -r a5e20c75073a -r 503cb2f011fc en/doc/handbook/livecd.html --- a/en/doc/handbook/livecd.html Mon Jun 30 21:10:19 2008 +0000 +++ b/en/doc/handbook/livecd.html Fri Jul 04 23:46:09 2008 +0000 @@ -18,7 +18,7 @@