From b76270bf9e6dd375e495fec92140a79a79415d27 Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Wed, 19 May 2010 08:58:23 +0000 Subject: Slackware 13.1 Wed May 19 08:58:23 UTC 2010 Slackware 13.1 x86_64 stable is released! Lots of thanks are due -- see the RELEASE_NOTES and the rest of the ChangeLog for credits. The ISOs are on their way to replication, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We are taking pre-orders now at store.slackware.com, and offering a discount if you sign up for a subscription. Consider picking up a copy to help support the project. Thanks again to the Slackware community for testing, contributing, and generally holding us to a high level of quality. :-) Enjoy! --- slackbook/html/file-commands-output.html | 147 ------------------------------- 1 file changed, 147 deletions(-) delete mode 100644 slackbook/html/file-commands-output.html (limited to 'slackbook/html/file-commands-output.html') diff --git a/slackbook/html/file-commands-output.html b/slackbook/html/file-commands-output.html deleted file mode 100644 index e2419b276..000000000 --- a/slackbook/html/file-commands-output.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - -Simple Output: cat and echo - - - - - - - - - - - -
-

10.3 Simple -Output: cat and echo

- -
-

10.3.1 cat

- -

cat(1) is short for “concatenate”. It was -originally designed to merge text files into one, but can be used for many other -purposes.

- -

To merge two or more files into one, you simply list the files after the cat command and then redirect the new output to a file. cat works with standard input and standard output, so you have to -use the shell redirection characters. For example:

- - - - - -
-
-% cat file1 file2 file3 > bigfile
-
-
- -

This command takes the contents of file1, file2, and file3 and merges it all -together. The new output is sent to standard out.

- -

One can also use cat to display files. Many people cat text files through the more or less commands, like this:

- - - - - -
-
-% cat file1 | more
-
-
- -

That will display the file1 file and pipe it through the more command so that you only get one screen at a time.

- -

Another common use for cat is copying files. You can copy any -file around with cat, like this:

- - - - - -
-
-% cat /bin/bash > ~/mybash
-
-
- -

The /bin/bash program is copied to your home directory and -named mybash.

- -

cat has many uses and the ones discussed here are just a few. -Since cat makes extensive use of standard input and standard -output, it is ideal for use in shell scripts or part of other complex commands.

-
- -
-

10.3.2 echo

- -

The echo(1) command displays the specified text on the -screen. You specify the string to display after the echo -command. By default echo will display the string and print a -newline character after it. You can pass the -n option to -suppress the printing of the newline. The -e option will cause -echo to search for escape characters in the string and execute -them.

-
-
- - - - - -- cgit v1.2.3