December 1999
Beginner
528 pages
11h 10m
English
Cut allows you to cut columns or fields of text from text files or from standard input. When you have cut some text, you can then paste it to a text file. We’ll look at paste in the next section. The general format of cut is:
cut [options] file1 file2
Let’s look at some of the available options.
| -c list | Use this to specify how many characters to cut. |
| -f fields | Use this to specify how many fields to cut. |
| -d | Use this to specify a different field separator, than a space or tab. |
Using ‘ -c ’ you can specify ranges or parts thereof.
| -c1,5-7 | Means cut characters one and then five to seven. |
| -c1-50 | Means cut the first fifty characters. |
Using the ‘ -f ’ option is the same format:
| -f 1,5 | Means cut the fields one and five. |
| -f1 10-12 ... |
Read now
Unlock full access