From ddb1c3fcb40cf9ccfdcc39f0d6c20197a70f7302 Mon Sep 17 00:00:00 2001 From: tille <> Date: Tue, 24 May 2005 21:17:28 +0000 Subject: [PATCH] note about pagers, lots of clarifications, removed quite some RedHat-centric paragraphs, reviewed and updated lots in sound and video, removed xmms-mp3 stuff, added time zone info because I was just dealing with date and time, contrary to the title of the section, removed Mandrake refs. --- LDP/guide/docbook/Intro-Linux/abook.xml | 10 +- LDP/guide/docbook/Intro-Linux/app1.xml | 2 +- LDP/guide/docbook/Intro-Linux/chap1.xml | 6 +- LDP/guide/docbook/Intro-Linux/chap10.xml | 2 +- LDP/guide/docbook/Intro-Linux/chap2.xml | 3 + LDP/guide/docbook/Intro-Linux/chap3.xml | 5 +- LDP/guide/docbook/Intro-Linux/chap4.xml | 30 +++--- LDP/guide/docbook/Intro-Linux/chap5.xml | 41 +++++--- LDP/guide/docbook/Intro-Linux/chap6.xml | 4 +- LDP/guide/docbook/Intro-Linux/chap7.xml | 119 +++++++++-------------- 10 files changed, 110 insertions(+), 112 deletions(-) diff --git a/LDP/guide/docbook/Intro-Linux/abook.xml b/LDP/guide/docbook/Intro-Linux/abook.xml index e59cdfc4..b414b2f0 100644 --- a/LDP/guide/docbook/Intro-Linux/abook.xml +++ b/LDP/guide/docbook/Intro-Linux/abook.xml @@ -141,6 +141,12 @@ Revision History + + 1.18 + 2005-05-23 + MG + note about pagers, lots of clarifications, removed quite some RedHat-centric paragraphs, reviewed and updated lots in sound and video, removed xmms-mp3 stuff, added time zone info because I was just dealing with date and time, contrary to the title of the section, removed Mandrake refs. + 1.17 2005-03-01 @@ -303,9 +309,9 @@ And thanks to all the readers who notified me about missing topics and who helped to pick out the last errors, unclear definitions and typos by going through the trouble of mailing me all their remarks. These are also the people who help me keep - this guide up to date. + this guide up to date, like Filipus Klutiero who did a complete review in 2005. Finally, a big thank you for the volunteers who are currently translating this - document in French, Swedish, German, Hindi and more. It is a big work that should + document in French, Swedish, German, Farsi, Hindi and more. It is a big work that should not be underestimated; I admire your courage. diff --git a/LDP/guide/docbook/Intro-Linux/app1.xml b/LDP/guide/docbook/Intro-Linux/app1.xml index 9a418acc..e5bb8a3e 100644 --- a/LDP/guide/docbook/Intro-Linux/app1.xml +++ b/LDP/guide/docbook/Intro-Linux/app1.xml @@ -215,7 +215,7 @@ - Mandrake + Mandriva diff --git a/LDP/guide/docbook/Intro-Linux/chap1.xml b/LDP/guide/docbook/Intro-Linux/chap1.xml index 1d1489cc..7acccfc0 100644 --- a/LDP/guide/docbook/Intro-Linux/chap1.xml +++ b/LDP/guide/docbook/Intro-Linux/chap1.xml @@ -218,7 +218,7 @@ changes in the accessibility of the system. Linux for non-experienced users -Companies such as RedHat, SuSE and Mandrake have sprung up, providing +Companies such as RedHat, SuSE and Mandriva have sprung up, providing packaged Linux distributions suitable for mass consumption. They integrated a great deal of graphical user interfaces (GUIs), developed by the community, in order to ease management of programs and services. As a Linux user today you @@ -592,7 +592,7 @@ are not as reliable, since they are tested by fewer people. special packages containing optimized kernels for the x86 Intel based CPUs. These distributions are well-tested and maintained on a regular basis, focusing on reliant server implementation and easy installation and update procedures. -Examples are RedHat, SuSE and Mandrake, which are by far the most popular Linux +Examples are RedHat, SuSE and Mandriva, which are by far the most popular Linux systems and generally considered easy to handle for the beginning user, while not blocking professionals from getting the most out of their Linux machines. Linux also runs decently on laptops and middle-range servers. Drivers for new @@ -616,7 +616,7 @@ default. The following are very good choices for novices: SuSE Linux -Mandrake +Mandriva (former MandrakeSoft) Knoppix: an operating system that runs from your CD-ROM, you don't need to install anything. diff --git a/LDP/guide/docbook/Intro-Linux/chap10.xml b/LDP/guide/docbook/Intro-Linux/chap10.xml index 560b3eac..47505467 100644 --- a/LDP/guide/docbook/Intro-Linux/chap10.xml +++ b/LDP/guide/docbook/Intro-Linux/chap10.xml @@ -82,7 +82,7 @@ All the big, userfriendly Linux distributions come with various graphical tools, allowing for easy setup of the computer in a local network or for connecting it to an Internet Service Provider. These tools can be started up from the command line or from a menu: RedHat Linux comes with redhat-config-network, which has both a graphical and a text mode interface. Suse's YAST or YAST2 is an all-in-one configuration tool. -Mandrake comes with a Network and Internet Configuration Wizard, which is preferably started up from Mandrake's Control Center. +Mandrake/Mandriva comes with a Network and Internet Configuration Wizard, which is preferably started up from Mandrake's Control Center. Your system documentation provides plenty of advice and information about availability and use of tools. Information you'll need to provide: diff --git a/LDP/guide/docbook/Intro-Linux/chap2.xml b/LDP/guide/docbook/Intro-Linux/chap2.xml index def6023a..7b2ca980 100644 --- a/LDP/guide/docbook/Intro-Linux/chap2.xml +++ b/LDP/guide/docbook/Intro-Linux/chap2.xml @@ -262,6 +262,9 @@ OPTIONS lines 1-27 Browse to the next page using the space bar. You can go back to the previous page using the b-key. When you reach the end, man will usually quit and you get the prompt back. Type q if you want to leave the man page before reaching the end, or if the viewer does not quit automatically at the end of the page. +Pagers +The available key combinations for manipulating the man pages depend on the pager used in your distribution. Most distributions use less to view the man pages and to scroll around. See for more info on pagers. + Each man page usually contains a couple of standard sections, as we can see from the man example: The first line contains the name of the command you are reading about, and the id of the section in which this man page is located. The man pages are ordered in chapters. Commands are likely to have multiple man pages, for example the man page from the user section, the man page from the system admin section, and the man page from the programmer section. diff --git a/LDP/guide/docbook/Intro-Linux/chap3.xml b/LDP/guide/docbook/Intro-Linux/chap3.xml index 1e438597..7a32964b 100644 --- a/LDP/guide/docbook/Intro-Linux/chap3.xml +++ b/LDP/guide/docbook/Intro-Linux/chap3.xml @@ -995,7 +995,7 @@ psychotic_chaos.mp3 This command will call on rm as many times as a file answering the requirements is found. In the worst case, this might be thousands or millions of times. This is quite a load on your system. A more realistic way of working would be the use of a pipe (|) and the xargs tool with rm as an argument. This way, the rm command is only called when the command line is full, instead of for every file. See for more on using I/O redirection to ease everyday tasks. -Later on (in 1999 according to the man pages, after 20 years of find), locate was developed. This program is easier to use, but more restricted than find, since its output is based on a file index database that is updated only once every day. On the other hand, a search in the locate database uses less resources than find and therefor shows the results nearly instantly. +Later on (in 1999 according to the man pages, after 20 years of find), locate was developed. This program is easier to use, but more restricted than find, since its output is based on a file index database that is updated only once every day. On the other hand, a search in the locate database uses less resources than find and therefore shows the results nearly instantly. Most Linux distributions use slocate these days, security enhanced locate, the modern version of locate that prevents users from getting output they have no right to read. The files in root's home directory are such an example, these are not normally accessible to the public. A user who wants to find someone who knows about the C-shell may issue the command locate .cshrc, to display all users who have a customized configuration file for the C shell. Supposing the users root and jenny are running C shell, then only the file /home/jenny/.cshrc will be displayed, and not the one in root's home directory. On most systems, locate is a symbolic link to the slocate program: billy:~> ls -l /usr/bin/locate @@ -1101,6 +1101,7 @@ sent-mail: On Mon, 24 Dec 2001, Arno.Hintjens@celeb.com wrote: More information is located in the Info pages. +You already know about pagers by now, because they are used for viewing the man pages. <command>Head</command> and <command>tail</command> These two commands display the n first/last lines of a file respectively. To see the last ten commands entered: @@ -1145,7 +1146,7 @@ frm Note that removing the target file for a symbolic link makes the link useless. -Each regular file is in principal a hardlink. Hardlinks can not span across partitions, since they refer to inodes, and inode numbers are only unique within a given partition. +Each regular file is in principle a hardlink. Hardlinks can not span across partitions, since they refer to inodes, and inode numbers are only unique within a given partition. It may be argued that there is a third kind of link, the user-space link, which is similar to a shortcut in MS Windows. These are files containing meta-data which can only be interpreted by the graphical file manager. To the kernel and the shell these are just normal files. They may end in a .desktop or .lnk suffix; an example can be found in ~/.gnome-desktop: [dupont@boulot .gnome-desktop]$ cat La\ Maison\ Dupont diff --git a/LDP/guide/docbook/Intro-Linux/chap4.xml b/LDP/guide/docbook/Intro-Linux/chap4.xml index e0b47f96..c8c865d4 100644 --- a/LDP/guide/docbook/Intro-Linux/chap4.xml +++ b/LDP/guide/docbook/Intro-Linux/chap4.xml @@ -29,7 +29,7 @@ Process types Interactive processes -Interactive processes are initialized and controlled through a terminal session. In other words, there has to be someone connected to the system to start these processes; they are not started automatically as part of the system functions. These processes can run in the foreground, occupying the terminal that started the program, and you can't start other applications as long as this process is running in the foreground. Alternatively, they can run in the background, so that the terminal in which you started the program can accept new commands while the program is running. Until now, we only used programs running in the foreground - the length of time taken to run them was too short to notice - but viewing a file with the less command is a good example of a command occupying the terminal session. In this case, the activated program is waiting for you to do something. The program is still connected to the terminal from where it was started, and the terminal is only useful for entering commands this program can understand. Other commands will just result in errors or unresponsiveness of the system. +Interactive processes are initialized and controlled through a terminal session. In other words, there has to be someone connected to the system to start these processes; they are not started automatically as part of the system functions. These processes can run in the foreground, occupying the terminal that started the program, and you can't start other applications as long as this process is running in the foreground. Alternatively, they can run in the background, so that the terminal in which you started the program can accept new commands while the program is running. Until now, we mainly focussed on programs running in the foreground - the length of time taken to run them was too short to notice - but viewing a file with the less command is a good example of a command occupying the terminal session. In this case, the activated program is waiting for you to do something. The program is still connected to the terminal from where it was started, and the terminal is only useful for entering commands this program can understand. Other commands will just result in errors or unresponsiveness of the system. While a process runs in the background, however, the user is not prevented from doing other things in the terminal in which he started the program, while it is running. The shell offers a feature called job control which allows easy handling of multiple processes. This mechanism switches processes between the foreground and the background. Using this system, programs can also be started in the background immediately. Running a process in the background is only useful for programs that don't need user input (via the shell). Putting a job in the background is typically done when execution of a job is expected to take a long time. In order to free the issuing terminal after entering the command, a trailing ampersand is added. In the example, using graphical mode, we open an extra terminal window from the existing one: @@ -83,7 +83,7 @@ A process has a series of characteristics: The process ID or PID: a unique identification number used to refer to the process. -The parent process ID or PPID: the number of the process that started this process. +The parent process ID or PPID: the number of the process (PID) that started this process. Nice number: the degree of friendliness of this process toward other processes (not to be confused with process priority, which is calculated based on this nice number and recent CPU usage of the process). Terminal or TTY: terminal to which the process is connected. User name of the real and effective user (RUID and EUID): the owner of the process. The real owner is the user issuing the command, the effective user is the one determining access to system resources. RUID and EUID are usually the same, and the process has the same access rights the issuing user would have. An example to clarify this: the browser mozilla in /usr/bin is owned by user root: @@ -163,7 +163,7 @@ Swap: 1050176K av, 76428K used, 973748K free, 82756K cached jeff:~> uptime 3:30pm, up 12 days, 23:29, 6 users, load average: 0.01, 0.02, 0.00 -The data for these programs is stored among others in /var/run/utmp (information about currently connected users) and in the virtual file system /proc, for example /proc/loadavg (average load information). There are all sorts of graphical applications to view this data, such as the Gnome System Monitor and lavaps. Open Source initiatives like Big Brother centralize this information along with other server data and logs from multiple servers on one web server, allowing monitoring of the entire IT infrastructure from one workstation. +The data for these programs is stored among others in /var/run/utmp (information about currently connected users) and in the virtual file system /proc, for example /proc/loadavg (average load information). There are all sorts of graphical applications to view this data, such as the Gnome System Monitor and lavaps. Over at FreshMeat and SourceForge you will find tens of applications that centralize this information along with other server data and logs from multiple servers on one (web) server, allowing monitoring of the entire IT infrastructure from one workstation. The relations between processes can be visualized using the pstree command: @@ -221,7 +221,7 @@ init-+-amd |-xfs `-xinetd-ipv6 -The and options give additional information, and for more, refer to the Info pages. +The and options give additional information. For more options and what they do, refer to the Info pages. In the next section, we will see how one process can create another. @@ -371,9 +371,9 @@ GRUB supports both boot methods, allowing you to use it with almost any operatin When init starts, it becomes the parent or grandparent of all of the processes that start up automatically on your Linux system. The first thing init does, is reading its initialization file, /etc/inittab. This instructs init to read an initial configuration script for the environment, which sets the path, starts swapping, checks the file systems, and so on. Basically, this step takes care of everything that your system needs to have done at system initialization: setting the clock, initializing serial ports and so forth. Then init continues to read the /etc/inittab file, which describes how the system should be set up in each run level and sets the default run level. A run level is a configuration of processes. All UNIX-like systems can be run in different process configurations, such as the single user mode, which is referred to as run level 1 or run level S (or s). In this mode, only the system administrator can connect to the system. It is used to perform maintenance tasks without risks of damaging the system or user data. Naturally, in this configuration we don't need to offer user services, so they will all be disabled. Another run level is the reboot run level, or run level 6, which shuts down all running services according to the appropriate procedures and then restarts the system. Commonly, run level 3 is configured to be text mode on a Linux machine, and run level 5 initializes the graphical login and environment. More about run levels in the next section, see . -After having determined the default run level for your system, init starts all of the background processes necessary for the system to run by looking in the appropriate rc directory for that run level. init runs each of the kill scripts (their file names start with a K) with a stop parameter. It then runs all of the start scripts (their file names start with an S) in the appropriate run level directory so that all services and applications are started correctly. In fact, you can execute these same scripts manually after the system is finished booting with a command like /etc/rc.d/init.d/httpd stop or service httpd stop logged in as root, in this case stopping the web server. - None of the scripts that actually start and stop the services are located in /etc/rc.d/rc<x>.d. Rather, all of the files in /etc/rc.d/rc<x>.d are symbolic links that point to the actual scripts located in /etc/rc.d/init.d. A symbolic link is nothing more than a file that points to another file, and is used in this case because it can be created and deleted without affecting the actual scripts that kill or start the services. The symbolic links to the various scripts are numbered in a particular order so that they start in that order. You can change the order in which the services start up or are killed by changing the name of the symbolic link that refers to the script that actually controls the service. You can use the same number multiple times if you want a particular service started or stopped right before or after another service. -Below a sample of /etc/rc5.d content, which lists the services started up in run level 5: +After having determined the default run level for your system, init starts all of the background processes necessary for the system to run by looking in the appropriate rc directory for that run level. init runs each of the kill scripts (their file names start with a K) with a stop parameter. It then runs all of the start scripts (their file names start with an S) in the appropriate run level directory so that all services and applications are started correctly. In fact, you can execute these same scripts manually after the system is finished booting with a command like /etc/init.d/httpd stop or service httpd stop logged in as root, in this case stopping the web server. + None of the scripts that actually start and stop the services are located in /etc/rc<x>.d. Rather, all of the files in /etc/rc<x>.d are symbolic links that point to the actual scripts located in /etc/init.d. A symbolic link is nothing more than a file that points to another file, and is used in this case because it can be created and deleted without affecting the actual scripts that kill or start the services. The symbolic links to the various scripts are numbered in a particular order so that they start in that order. You can change the order in which the services start up or are killed by changing the name of the symbolic link that refers to the script that actually controls the service. You can use the same number multiple times if you want a particular service started or stopped right before or after another service, as in the example below, listing the content of /etc/rc5.d, where crond and xfs are both started from a linkname starting with S90. In this case, the scripts are started in alphabetical order. + [jean@blub /etc/rc5.d] ls K15httpd@ K45named@ S08ipchains@ S25netfs@ S85gpm@ @@ -390,13 +390,13 @@ K34yppasswdd@ S05kudzu@ S20random@ S80sendmail@ /etc/inittab can also tell init how it should handle a user pressing Ctrl+Alt+Delete at the console. As the system should be properly shut down and restarted rather than immediately power-cycled, init is told to execute the command /sbin/shutdown now, for instance, when a user hits those keys. In addition, /etc/inittab states what init should do in case of power failures, if your system has a UPS unit attached to it. -In run level 5, /etc/inittab runs a script called /etc/X11/prefdm. The prefdm script runs the preferred X display manager, based on the contents of the /etc/sysconfig/desktop directory. This is typically gdm if you run GNOME or kdm if you run KDE, but they can be mixed, and there's also the xdm that comes with a standard X installation. - -The /etc/sysconfig directory contains entries for a range of functions and services, these are all read at boot time. This last part, however, might be somewhat different depending on your Linux distribution. +On most RPM-based systems the graphical login screen is started in run level 5, where /etc/inittab runs a script called /etc/X11/prefdm. The prefdm script runs the preferred X display manager, based on the contents of the /etc/sysconfig/desktop directory. This is typically gdm if you run GNOME or kdm if you run KDE, but they can be mixed, and there's also the xdm that comes with a standard X installation. +But there are other possibilities as well. On Debian, for instance, There is an initscript for each of the display managers, and the content of the /etc/X11/default-display-manager is used to determine which one to start. More about the graphical interface can be read in . Ultimately, your system documentation will explain the details about the higher level aspects of init. +The /etc/default and/or /etc/sysconfig directories contain entries for a range of functions and services, these are all read at boot time. The location of the directory containing system defaults might be somewhat different depending on your Linux distribution. Besides the graphical user environment, a lot of other services may be started as well. But if all goes well, you should be looking at a login prompt or login screen when the boot process has finished. Other procedures -We explained how SysV init works on x86 based machines. Startup procedures may vary on other architectures and distributions. Other systems may use the BSD-style init, where startup files are not split up into multiple /etc/rc.d/rc<LEVEL>.d directories. It might also be possible that your system uses /etc/init.d instead of /etc/rc.d/init.d. +We explained how SysV init works on x86 based machines. Startup procedures may vary on other architectures and distributions. Other systems may use the BSD-style init, where startup files are not split up into multiple /etc/rc<LEVEL>.d directories. It might also be possible that your system uses /etc/rc.d/init.d instead of /etc/init.d. Init run levels The idea behind operating different services at different run levels essentially revolves around the fact that different systems can be used in different ways. Some services cannot be used until the system is in a particular state, or mode, such as being ready for more than one user or having networking available. @@ -431,9 +431,9 @@ id:5:initdefault: Tools -The chkconfig utility in /sbin provides a simple command-line tool for maintaining the /etc/rc.d/init.d directory hierarchy. It relieves system administrators from having to directly manipulate the numerous symbolic links in the directories under /etc/rc.d. +The chkconfig utility in /sbin, when installed on your system, provides a simple command-line tool for maintaining the /etc/init.d directory hierarchy. It relieves system administrators from having to directly manipulate the numerous symbolic links in the directories under /etc/rc[x].d. -In addition, some systems offer the ntsysv tool, which provides a text-based interface; you may find this easier to use than chkconfig's command-line interface. On SuSE Linux, you will find the yast and insserv tools. For Mandrake easy configuration, you may want to try DrakConf, which allows among other features switching between run levels 3 and 5. +In addition, some systems offer the ntsysv tool, which provides a text-based interface; you may find this easier to use than chkconfig's command-line interface. On SuSE Linux, you will find the yast and insserv tools. For Mandrake easy configuration, you may want to try DrakConf, which allows among other features switching between run levels 3 and 5. In Mandriva this became the Mandriva Linux COntrol Center. Most distributions provide a graphical user interface for configuring processes, check with your system documentation. @@ -562,7 +562,7 @@ Command exited with non-zero status 2 aggregate transfer rate too low: The maximum total bandwidth that the system can provide to all programs that run is not enough. -This kind of problem is more difficult to detect, and usually takes extra hardware in order to re-divide data streams over buses, controlers and disks, if overloaded hardware is cause of the problem. One solution to solve this is a RAID array configuration optimized for input and output actions. This way, you get to keep the same hardware. An upgrade to faster buses, controlers and disks is usually the other option. +This kind of problem is more difficult to detect, and usually takes extra hardware in order to re-divide data streams over buses, controllers and disks, if overloaded hardware is cause of the problem. One solution to solve this is a RAID array configuration optimized for input and output actions. This way, you get to keep the same hardware. An upgrade to faster buses, controlers and disks is usually the other option. If overload is not the cause, maybe your hardware is gradually failing, or not well connected to the system. Check contacts, connectors and plugs to start with. Users @@ -600,7 +600,7 @@ Command exited with non-zero status 2 Identify the process in the NI column, it will most likely have a negative priority. Type r and enter the process ID of the process that you want to renice. Then enter the nice value, for instance 20. That means that from now on, this process will take 1/5 of the CPU cycles at the most. Examples of processes that you want to keep on running are emulators, virtual machines, compilers and so on. -If you want to stop a process because it hangs or is going totally berserk in the way of I/O consumption, file creation or use of other system resources, use the kill. If you have the opportunity, first try to kill the process softly, sending it the SIGTERM signal. This is an instruction to terminate whatever it is doing, according to procedures as described in the code of the program: +If you want to stop a process because it hangs or is going totally berserk in the way of I/O consumption, file creation or use of other system resources, use the kill command. If you have the opportunity, first try to kill the process softly, sending it the SIGTERM signal. This is an instruction to terminate whatever it is doing, according to procedures as described in the code of the program: joe:~> ps | grep mozilla joe 25822 1 0 Mar11 ? 00:34:04 /usr/lib/mozilla-1.4.1/mozilla- diff --git a/LDP/guide/docbook/Intro-Linux/chap5.xml b/LDP/guide/docbook/Intro-Linux/chap5.xml index e77837ba..bbb384cd 100644 --- a/LDP/guide/docbook/Intro-Linux/chap5.xml +++ b/LDP/guide/docbook/Intro-Linux/chap5.xml @@ -41,6 +41,11 @@ some other words some words some other words + +Don't overwrite! +Be careful not to overwrite existing (important) files when redirecting output. Many shells, including Bash, have a built-in feature to protect you from that risk: noclobber. See the Info pages for more information. In Bash, you would want to add the set noclobber command to your .bashrc configuration file in order to prevent accidental overwriting of files. + + Redirecting nothing to an existing file is equal to emptying the file: nancy:~> ls -l list @@ -82,10 +87,7 @@ ls: newlist: No such file or directory Combining redirections The following example combines input and output redirection. The file text.txt is first checked for spelling mistakes, and the output is redirected to an error log file: -aspell < text.txt > error.log -It might be that you have to use the following syntax to spell a file (check with the man pages): -aspell list < file.txt | sort -This also uses input and output redirection. +spell < text.txt > error.log The following command lists all commands that you can issue to examine another file when using less: mike:~> less --help | grep -i examine @@ -106,9 +108,7 @@ ls: newlist: No such file or directory :x * Examine the first (or N-th) file from the command line. Output of one command can be piped into another command virtually as many times as you want, just as long as these commands would normally read input from standard input and write output to the standard output. Sometimes they don't, but then there may be special options that instruct these commands to behave according to the standard definitions; so read the documentation (man and info pages) of the commands you use if you should encounter errors. - -Don't overwrite! -Be careful not to overwrite existing (important) files when redirecting output. Many shells, including Bash, have a built-in feature to protect you from that risk: noclobber. See the Info pages for more information. In Bash, you would want to add the set noclobber command to your .bashrc configuration file in order to prevent accidental overwriting of files. +Again, make sure you don't use names of existing files that you still need. Redirecting output to existing files will replace the content of those files. @@ -117,9 +117,13 @@ ls: newlist: No such file or directory Instead of overwriting file data, you can also append text to an existing file using two subsequent greater-than signs: Example: -mike:~> date >> wishlist +mike:~> cat wishlist +more money +less work -mike:~> cat wishlist +mike:~> date >> wishlist + +mike:~> cat wishlist more money less work Thu Feb 28 20:23:07 CET 2002 @@ -150,7 +154,7 @@ Thu Feb 28 20:23:07 CET 2002 Analyzing errors If your process generates a lot of errors, this is a way to thoroughly examine them: command 2>&1 | less -This is often used when creating new software using the make, such as in: +This is often used when creating new software using the make command, such as in: andy:~/newsoft> make all 2>&1 | less --output ommitted-- @@ -166,7 +170,7 @@ Thu Feb 28 20:23:07 CET 2002 Writing to output and files simultaneously You can use the tee command to copy input to standard output and one or more output files in one move. Using the option to tee results in appending input to the file(s). This command is useful if you want to both see and save output. The > and >> operators do not allow to perform both actions simultaneously. -This tool is usally called on through a pipe (|), as demonstrated in the example below: +This tool is usually called on through a pipe (|), as demonstrated in the example below: mireille ~/test> date | tee file1 file2 Thu Jun 10 11:10:34 CEST 2004 @@ -201,7 +205,7 @@ Thu Jun 10 11:10:34 CEST 2004 The grep command, like most commands, is case sensitive. Use the option to make no difference between upper and lower case. A lot of GNU extensions are available as well, such as , which is helpful to highlight searchterms in long lines, and , which prints the number of lines after the last matching line. You can issue a recursive grep that searches all subdirectories of encountered directories using the option. As usual, options can be combined. Regular expressions can be used to further detail the exact character matches you want to select out of all the input lines. The best way to start with regular expressions is indeed to read the grep documentation. An excellent chapter is included in the info grep page. Since it would lead us too far discussing the ins and outs of regular expressions, it is strongly advised to start here if you want to know more about them. -Play around a bit with grep, it will be worth the trouble putting some time in this most basic but very powerful filtering command. The exercises at the end of this chapter will help you started, see . +Play around a bit with grep, it will be worth the trouble putting some time in this most basic but very powerful filtering command. The exercises at the end of this chapter will help you to get started, see . Filtering output @@ -236,7 +240,17 @@ My boss Use the cut command on the output of a long directory listing in order to display only the file permissions. Then pipe this output to sort and uniq to filter out any double lines. Then use the wc to count the different permission types in this directory. Put the output of date in a file. Append the output of ls to this file. Send this file to your local mailbox (don't specify anything @domain, just the user name will do). When using Bash, you will see a new mail notice upon success. List the devices in /dev which are currently used by your UID. Pipe through less to view them properly. -Use the command bash to start up the HTTP daemon with the script in /etc/rc.d/init.d. Send standard error to a file. Do the same but now send standard output to the file. Note the difference. +Issue the following commands as a non-privileged user. Determine standard input, output and error for each command. + +cat nonexistentfile +file /sbin/ifconfig +grep root /etc/passwd /etc/nofiles > grepresults +/etc/init.d/sshd start > /var/tmp/output +/etc/init.d/crond start > /var/tmp/output 2>&1 +Now check your results by issuing the commands again, now redirecting standardoutput to the file /var/tmp/output and standard error to the file /var/tmp/error. + + + How many processes are you currently running? How many invisible files are in your home directory? Use locate to find documentation about the kernel. @@ -251,6 +265,7 @@ system: root See what happens upon issuing this command: > time; date >> time; cat < time +What command would you use to check which script in /etc/init.d starts a given process? diff --git a/LDP/guide/docbook/Intro-Linux/chap6.xml b/LDP/guide/docbook/Intro-Linux/chap6.xml index b314837a..21d3a88e 100644 --- a/LDP/guide/docbook/Intro-Linux/chap6.xml +++ b/LDP/guide/docbook/Intro-Linux/chap6.xml @@ -39,7 +39,7 @@ Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so many improvements that a name change was appropriate. Vim is a text editor which includes almost all the commands from the UNIX program vi and a lot of new ones. Commands in the vi editor are entered using only the keyboard, which has the advantage that you can keep your fingers on the keyboard and your eyes on the screen, rather than moving your arm repeatedly to the mouse. For those who want it, mouse support and a GUI version with scrollbars and menus can be activated. We will refer to vi or vim throughout this book for editing files, while you are of course free to use the editor of your choice. However, we recommend to at least get the vi basics in the fingers, because it is the standard text editor on almost all UNIX systems, while emacs can be an optional package. There may be small differences between different computers and terminals, but the main point is that if you can work with vi, you can survive on any UNIX system. -Apart from the vim command, the vIm package also provides gvim, the Gnome version of vim. Beginning users might find this easier to use, because the menus offer help when you forgot or don't know how to perform a particular editing task using the standard vim commands. +Apart from the vim command, the vIm packages may also provide gvim, the Gnome version of vim. Beginning users might find this easier to use, because the menus offer help when you forgot or don't know how to perform a particular editing task using the standard vim commands. @@ -130,7 +130,7 @@ Commands that switch the editor to insert mode The default file format specification would made the program add several lines of code, defining the format of the file and the fonts used. These lines won't be interpreted in the correct way by the programs depending on them, resulting in errors or a crash of the program reading the file. In some cases, you can save the file as plain text, but you'll run into trouble when making this a habit. But I want a graphical text editor! -If you really insist, try gedit or xedit; these programs only do text files, which is what we will be needing. If you plan on doing anything serious, though, stick to a real text mode editor such as vim or emacs. +If you really insist, try gedit, kedit, kwrite or xedit; these programs only do text files, which is what we will be needing. If you plan on doing anything serious, though, stick to a real text mode editor such as vim or emacs. An acceptable alternative is gvim, the Gnome version of vim. You still need to use vi commands, but if you are stuck, you can look them up in the menus. diff --git a/LDP/guide/docbook/Intro-Linux/chap7.xml b/LDP/guide/docbook/Intro-Linux/chap7.xml index e307db5c..6c4efe0d 100644 --- a/LDP/guide/docbook/Intro-Linux/chap7.xml +++ b/LDP/guide/docbook/Intro-Linux/chap7.xml @@ -78,7 +78,7 @@ mike@pandora.be Save space with a link When several users need access to the same file or program, when the original file name is too long or too difficult to remember, use a symbolic link instead of a separate copy for each user or purpose. -Multiple symbolic links may have different names, e.g. a link may be called monficher in one user's directory, and mylink in another's. Multiple links (different names) to the same file may also occur in the same directory. This is often done in the /lib directory: when issuing the command +Multiple symbolic links may have different names, e.g. a link may be called monfichier in one user's directory, and mylink in another's. Multiple links (different names) to the same file may also occur in the same directory. This is often done in the /lib directory: when issuing the command ls /lib you will see that this directory is plenty of links pointing to the same files. These are created so that programs searching for one name would not get stuck, so they are pointed to the correct/current name of the libraries they need. @@ -102,7 +102,7 @@ virtual memory (kbytes) unlimited Compressed files Compressed files are useful because they take less space on your hard disk. Another advantage is that it takes less bandwidth to send a compressed file over your network. A lot of files, such as the man pages, are stored in a compressed format on your system. Yet unpacking these to get a little bit of information and then having to compress them again is rather time-consuming. You don't want to unpack a man page, for instance, read about an option to a command and then compress the man page again. Most people will probably forget to clean up after they found the information they needed. -So we have tools that work on compressed files, by uncompressing them only in memory. The actual compressed file stays on your disk as it is. Most systems support egrep, zgrep, zcat, zmore and such to prevent unnecessary decompressing/compressing actions. See your system's binary directory and the Info pages. +So we have tools that work on compressed files, by uncompressing them only in memory. The actual compressed file stays on your disk as it is. Most systems support zgrep, zcat, bzless and such to prevent unnecessary decompressing/compressing actions. See your system's binary directory and the Info pages. See for more on the actual compressing of files and examples on making archives. @@ -407,18 +407,18 @@ echo "Hello $USER" #!/bin/bash who | cut -d " " -f 1 | sort -u -Here is a script consisting of some more lines, that I use to convert wav-files to mp3-format using the lame command. The script first makes a list of all wav-files in the current directory and puts it in the variable LIST. Then it sets the new name for each file, and converts the file format. After that, it cleans up the wav-files which are replaced by their mp3 counterparts: +Here is a script consisting of some more lines, that I use to make backup copies of all files in a directory. +The script first makes a list of all the files in the current directory and puts it in the variable LIST. Then it sets the name of the copy for each file, and then it copies the file. For each file, a message is printed: -tille:~> cat /usr/local/bin/wav2mp3 +tille:~> cat bin/makebackupfiles.sh #!/bin/bash -# convert *.wav into *.mp3 -LIST=$(ls *.wav) +# make copies of all files in a directory +LIST=`ls` for i in $LIST; do ORIG=$i - DEST=$(ls $i | cut -d "." -f 1).mp3 - lame -h $ORIG $DEST - echo "done converting $i, removing.." - rm $i + DEST=$i.old + cp $ORIG $DEST + echo "copied $i" done The cut command is used in this example to separate the actual file name from the file name suffix. Just entering a line like mv *.wav *.mp3 won't work. An echo command was added in order to display some activity. echo's are generally useful when a script won't work: insert one after each doubted step and you will find the error in no time. @@ -524,23 +524,10 @@ This script is a fine example of using functions, which make the script easier t X server configuration -The X distribution that comes with Linux, XFree86, uses the configuration file XF86Config for its initial setup. This file configures your video card and is searched for in a number of locations, although it is usually in /etc/X11. This file is composed of a number of sections which may be present in any order: - -Files: File pathnames -ServerFlags: Server options -Module: Dynamic module loading -InputDevice: Input device description -Device: Graphics device description -VideoAdapter: Video adapter description -Monitor: Monitor description -Modes: Video modes (modlines) description -Screen: Screen configuration -ServerLayout: Overall layout -DRI: DRI-specific configuration (3D settings) -Vendor: Vendor-specific configuration - -A full description can be found in the Info or man pages about XF86Config. As a user, you needn't worry too much about what is in this file, since everything is normally determined at the time the system is installed. -Should you need to change graphical server settings, however, you can run the configuration tools or edit the configuration files that set up the infrastructure to use the XFree86 server. See the man pages for more information; your distribution might have its own tools. Since misconfiguration may result in unreadable garbage in graphical mode, you may want to make a backup copy of the XF86Config file before attempting to change it, just to be on the safe side. +The X distribution that used to come with Linux, XFree86, uses the configuration file XF86Config for its initial setup. This file configures your video card and is searched for in a number of locations, although it is usually in /etc/X11. +If you see that the file /etc/X11/XF86Config is present on your system, a full description can be found in the Info or man pages about XF86Config. +Because of licensing issues with XFree86, newer systems usually come with the X.Org distribution of the X server and tools. The main configuration file here is xorg.conf, usually also in /etc/X11. The file consists of a number of sections that may occur in any order. The sections contain information about your monitor, your video adaptor, the screen configuration, your keyboard etcetera. As a user, you needn't worry too much about what is in this file, since everything is normally determined at the time the system is installed. +Should you need to change graphical server settings, however, you can run the configuration tools or edit the configuration files that set up the infrastructure to use the XFree86 server. See the man pages for more information; your distribution might have its own tools. Since misconfiguration may result in unreadable garbage in graphical mode, you may want to make a backup copy of the configuration file before attempting to change it, just to be on the safe side. @@ -564,65 +551,49 @@ If your soundcard is not supported by default, you will need to apply other tech Playing music files mp3 files -The popular .mp3 format is widely supported on Linux machines. Most distributions include multiple programs that can play these files; xmms, which is presented in the screenshot below, is probably the most wide-spread. +The popular .mp3 format is widely supported on Linux machines. Most distributions include multiple programs that can play these files. Among many other applications, XMMS, which is presented in the screenshot below, is one of the most wide-spread, partially because it has the same look and feel as the Windows tool. -
Xmms mp3 player +
XMMS mp3 player -Xmms looks very familiar to MS Windows users, showing a hi-fi installation frontpanel. +XMMS looks very familiar to MS Windows users, showing a hi-fi installation frontpanel.
-Some distributions don't allow you to play MP3's without modifying your configuration, this is due to license restrictions on the MP3 tools. With the xmms player, you now need the xmms-mp3 plugin. If error messages indicate that licensing is the trouble, the following procedure describes the path of least resistance: - -Download and install apt-get, for instance from : -rpm /var/tmp/xmms-mp3-1.2.7-21.p.fr1 - -Run the following commands to prepare your system for use with the apt package manager: -apt-get update -apt-get upgrade - -Install the xmms-mp3 plugin: -apt-get install xmms-mp3 - -(Don't forget to log out of the root account because you've finished modifying your system now) - Play your favorite music: -xmms /my/music/dot.mp3 - - +Also very popular for playing music are AmaroK, a KDE application that is steadily gaining popularity, and MPlayer, which can also play movies. -See for more on the commands for managing packages. - -Start xmms from a menu, or from the command line like this: - -debby:~/mp3> xmms music.mp3 - -Alternatively, enter the command xmms *.mp3 for playing all .mp3 files in a directory. -Both Gnome and KDE incorporate other graphical mp3 players, look in your menus. +Restrictions +Some distributions don't allow you to play MP3's without modifying your configuration, this is due to license restrictions on the MP3 tools. You might need to install extra software to be able to play your music. + Other formats -An overview of other common sound playing and manipulating software: +An (incomplete) overview of other common sound playing and manipulating software: Ogg Vorbis: Free audio format: see the GNU audio directory for tools - they might be included in your distribution as well. Real audio and video: realplay from RealNetworks. SoX or Sound eXchange: actually a sound converter, comes with the play program. Plays .wav, .ogg and various other formats, including raw binary formats. Playmidi: a MIDI player, see the GNU directory. AlsaPlayer: from the Advanced Linux Sound Architecture project, see the AlsaPlayer web site. -KMediaPlayer: base for the KDE multimedia tools. mplayer: plays just about anything, including mp3 files. More info on the MPlayerHQ website. +hxplay: supports RealAudio and RealVideo, mp3, mp4 audio, Flash, wav and more, see HelixDNA. +rhythmbox: based on the GStremaer framework, can play everything supported in GStreamner, which claims to be able to play everything, see the RhythmBox and GStreamer sites. -Check your system documentation for particular tools! +Check your system documentation for particular tools. +I don't have these applications on my system! +A lot of the tools and applications discussed in the above sections are optional software. It is possible that such applications are not installed on your system by default, but that you can find them in your distribution as additional packages. It might also very well be that the application that you are looking for is not in your distribution at all. In that case, you need to download it from the application's web site. + Volume control -aumix and alsamixer are two common text tools for adjusting audio controls. The alsamixer has a graphical interface when started from the menu or as gnome-alsamixer from the command line. The kmix tool does the same in KDE. +aumix and alsamixer are two common text tools for adjusting audio controls. The alsamixer has a graphical interface when started from the Gnome menu or as gnome-alsamixer from the command line. The kmix tool does the same in KDE. Regardless of how you choose to listen to music or other sounds, remember that there may be other people who may not be interested in hearing you or your computer. Try to be courteous, especially in office environments. And use a quality head-set. Video playing, streams and television watching @@ -630,11 +601,12 @@ If your soundcard is not supported by default, you will need to apply other tech xine: a free video player ogle: DVD player +okle: KDE version of ogle mplayer: Movie Player for Linux -gstreamer: upcoming project developing the GStreamer library and accompanying tools for audio and video recording, editing and playing, to be included in Gnome. See http://www.gstreamer.net for more. +gstreamer: upcoming multimedia framework project developing the GStreamer library and accompanying tools for audio and video recording, editing and playing, to be included in Gnome. See http://www.gstreamer.net for more. totem: plays both audio and video files, audio CDs, VCD and DVD. realplay: from RealNetworks. -helixplay: a Real alternative, see HelixDNA. +hxplay: a Real alternative, see HelixDNA. Most likely, you will find one of these in your graphical menus. TLDP released a new document recently that is very appropriate for this section. It is entitled DVD Playback HOWTO and describes the different tools available for viewing movies on a system that has a DVD drive. It is a fine addition to the DVD HOWTO that explains installation of the drive. @@ -655,8 +627,8 @@ If your soundcard is not supported by default, you will need to apply other tech XkbLayout "us" -This is the default. Change it to your local settings by replacing the quoted value with any of the names listed in the subdirectories of /lib/kbd/keymaps/, leaving out the .map.gz extention. If you can't find the keymaps, try displaying their location on your system issuing the command -locate .map.gz +This is the default. Change it to your local settings by replacing the quoted value with any of the names listed in the subdirectories of your keymaps directory. If you can't find the keymaps, try displaying their location on your system issuing the command +locate keymaps It is possible to combine layout settings, like in this example: Xkblayout "us,ru" @@ -673,13 +645,14 @@ export INPUTRC="/etc/inputrc" to the /etc/bashrc file. -Time zone +Date and time zone Setting time information is usually done at installation time. After that, it can be kept up to date using an NTP (Network Time Protocol) client. Most Linux systems run ntpd by default: debby:~> ps -ef | grep ntpd ntp 24678 1 0 2002 ? 00:00:33 ntpd -U ntp See your system manual and the documentation that comes with the NTP package. Most desktop managers include tools to set the system time, providing that you have access to the system administrator's account. +For setting the time zone correct, you can use tzconfig or timezone commands. Timezone information is usually set during the installation of your machine. Many systems have distribution-specific tools to configure it, see your system documentation. Language If you'd rather get your messages from the system in Dutch or French, you may want to set the LANG and LANGUAGE environment variables, thus enabling locale support for the desired language and eventually the fonts related to character conventions in that language. @@ -720,7 +693,7 @@ LANG=en_US.UTF-8 RPM packages RPM, the RedHat Package Manager, is a powerful package manager that you can use to install, update and remove packages. It allows you to search for packages and keeps track of the files that come with each package. A system is built-in so that you can verify the authenticity of packages downloaded from the Internet. Advanced users can build their own packages with RPM. An RPM package consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages. -Many other distributions support RPM packages, among the popular ones Mandrake and SuSE Linux. Apart from the advice for your distribution, you will want to read man rpm. +Many other distributions support RPM packages, among the popular ones RedHat Enterprise Linux, Mandriva (former Mandrake), Fedora Core and SuSE Linux. Apart from the advice for your distribution, you will want to read man rpm. Most packages are simply installed with the upgrade option, , whether the package is already installed or not. The RPM package contains a complete version of the program, which overwrites existing versions or installs as a new package. The typical usage is as follows: rpm /path/to/rpm-package(s) The option generates more verbose output, and makes rpm print a progress bar: @@ -764,7 +737,7 @@ coreutils-4.5.3-19 The Debian web site contains all information you need, including a dselect Documentation for Beginners. Source packages -The largest part of Linux programs is Free/Open Source, so source packages are available for these programs. Source files are needed for compiling your own program version. Sources are provided when you install development packages or can be downloaded from the particular web site for a program, in the raw (program-version.tar.gz or similar) or packaged in an RPM or Debian package. +The largest part of Linux programs is Free/Open Source, so source packages are available for these programs. Source files are needed for compiling your own program version. Sources for a program can be downloaded from its web site, often as a compressed tarball (program-version.tar.gz or similar). For RPM-based distributions, the source is often provided in the program-version.src.rpm. Debian, and most distributions based on it, provide themselves the adapted source which can be obtained using apt-get source. Specific requirements, dependencies and installation instructions are provided in the README file. You will probably need a C compiler, gcc. This GNU C compiler is included in most Linux systems and is ported to many other platforms. @@ -773,7 +746,7 @@ coreutils-4.5.3-19 The first thing you do after installing a new system is applying updates; this applies to all operating systems and Linux is not different. The updates for most Linux systems can usually be found on a nearby site mirroring your distribution. Lists of sites offering this service can be found at your distribution's web site, see . -Updates should be applied regularly, daily if possible - but every couple of weeks would be a reasonable start. You really should try to have the most recent versions of all packages, since Linux changes constantly. As we said before, new features, improvements and bug fixes are supplied at a steady rhythm, and sometimes important security problems are addressed. All this not because Linux is a sloppy system, but rather because the Linux user is not easily satisfied. We want our software to be the best, but getting there and staying there demands some flexibility. +Updates should be applied regularly, daily if possible - but every couple of weeks would be a reasonable start. You really should try to have the most recent version of your distribution, since Linux changes constantly. As we said before, new features, improvements and bug fixes are supplied at a steady rhythm, and sometimes important security problems are addressed. The good news is that most Linux distributions provide tools so that you don't have to upgrade tens of packages daily by hand. The following sections give an overview of package manager managers. There is much more to this subject, even regular updates of source packages is manageable automatically; we only list the most commonly known systems. Always refer to the documentation for your specific distribution for advised procedures. APT @@ -804,13 +777,12 @@ Preparing... ########################################### [100%] If there are any dependencies on other packages, apt-get will download and install these supporting packages. More information can be found in the APT HOWTO. -Systems supporting RPM packages -Update Agent, which originally only supported RedHat RPM packages, is now ported to a wider set of software, including non-RedHat repositories. This tool provides a complete system for updating the RPM packages on a RedHat or Fedora Linux system. On the command line, type up2date to update your system. On the desktop, by default a small icon is activated, telleng you whether or not there are updates available for your system. +Systems using RPM packages +Update Agent, which originally only supported RedHat RPM packages, is now ported to a wider set of software, including non-RedHat repositories. This tool provides a complete system for updating the RPM packages on a RedHat or Fedora Core system. On the command line, type up2date to update your system. On the desktop, by default a small icon is activated, telleng you whether or not there are updates available for your system. Yellowdog's Updater Modified (yum) is another tool that recently became more popular. It is an interactive but automated update program for installing, updating or removing RPM packages on a system. It is the tool of choice on Fedora systems. On SuSE Linux, everything is done with YaST, Yet another Setup Tool, which supports a wide variety of system administration tasks, among which updating RPM packages. Starting from SuSE Linux 7.1 you can also upgrade using a web interface and YOU, Yast Online Update. -Mandrake Linux provides so-called URPMI tools, a set of wrapper programs that make installing new software easier for the user. These tools combine with RPMDrake and MandrakeUpdate to provide everything needed for smooth install and uninstall of software packages. MandrakeOnline offers an extended range of services and can automatically notify administrators when updates are available for your particular Mandrake system. Also the KDE and Gnome desktop suites have their own (graphical) versions of package managers, such as GnoRPM and KPackage. -Ximian, a Linux desktop software vendor, has developed RedCarpet, a graphical tool that you can use to subscribe to different upgrade channels. Different channels are available for upgrading a series of Linux distributions and versions, and for upgrading individual Ximian products, such as the Ximian desktop, the E-mail client Evolution, the upgrade tool itself and much more. -Ximian currently supports RedHat, Debian, Mandrake, Solaris, SuSE and YellowDog systems. +Mandrake Linux and Mandriva provide so-called URPMI tools, a set of wrapper programs that make installing new software easier for the user. These tools combine with RPMDrake and MandrakeUpdate to provide everything needed for smooth install and uninstall of software packages. MandrakeOnline offers an extended range of services and can automatically notify administrators when updates are available for your particular Mandrake system. See man urpmi, among others, for more info. +Also the KDE and Gnome desktop suites have their own (graphical) versions of package managers. @@ -853,7 +825,7 @@ title old-kernel [david@jupiter ~] grep cdrom /etc/fstab /dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0 -This indicates that the system will understand the command mount /mnt/cdrom. The means that on this system, CDs are not mounted automatically. +This indicates that the system will understand the command mount /mnt/cdrom. The option means that on this system, CDs are not mounted at boot time. You may even try to right click on the CD icon on your desktop to mount the CD if your file manager doesn't do it for you. You can check whether it worked issuing the mount command with no arguments: [david@jupiter ~] mount | grep cdrom @@ -861,7 +833,7 @@ title old-kernel Using the CD -After mounting the CD, you can change directories, usually to the mount point /mnt/cdrom, where you can access the content of the CD-ROM. Use rpm just like described in the above section to install additional packages. +After mounting the CD, you can change directories, usually to the mount point /mnt/cdrom, where you can access the content of the CD-ROM. Use the same commands for dealing with files and directories as you would use for files on the hard disk. Ejecting the CD In order to get the CD out of the drive after you've finished using it, the file system on the CD should be unused. Even being in one of the subdirectories of the mount point, /mnt/cdrom in our example, will be considered as using the file system, so you should get out of there. Do this for instance by typing cd with no arguments, which will put you back in your home directory. After that, you can either use the command @@ -896,6 +868,7 @@ title old-kernel Make an alias lll which actually executes ls . Why does the command tail testfile > testfile not work? Mount a data CD, such as your Linux installation CD, and have a look around. Don't forget to unmount when you don't need it anymore. +The script from is not perfect. It generates errors for files that are directories. Adapt the script so that it only selects plain files for copying. Use find to make the selection. Do not forget to make the script executable before you try to run it. Graphical environment