Skip to content

Commit 0c88a1c

Browse files
Update 003-the-cat-tac-command.md (bobbyiliev#222)
Changed command focused from only txt file to any kind of file.
1 parent 7e20586 commit 0c88a1c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ebook/en/content/003-the-cat-tac-command.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ cat file1 file2 ...
2424
3. To create a file with the cat command:
2525

2626
```
27-
cat > filename
27+
cat > file_name
2828
```
2929

3030
4. To display all files in current directory with the same filetype:
3131

3232
```
33-
cat *.txt
33+
cat *.<filetype>
3434
```
3535

3636
5. To display the content of all the files in current directory:
@@ -42,7 +42,7 @@ cat *
4242
6. To put the output of a given file into another file:
4343

4444
```
45-
cat oldfile > newfile
45+
cat old_file_name > new_file_name
4646
```
4747
7. Use cat command with `more` and `less` options:
4848

@@ -51,22 +51,22 @@ cat filename | more
5151
cat filename | less
5252
```
5353

54-
8. Append the contents of file1.txt to file2.txt:
54+
8. Append the contents of file1 to file2:
5555

5656
```
57-
cat file1.txt >> file2.txt
57+
cat file1 >> file2
5858
```
5959

6060
9. To concatenate two files together in a new file:
6161

6262
```
63-
cat file1.txt file2.txt merge.txt
63+
cat file1_name file2_name merge_file_name
6464
```
6565

6666
10. Some implementations of cat, with option -n, it's possible to show line numbers:
6767

6868
```
69-
cat -n file1.txt file2.txt > newnumberedfile.txt
69+
cat -n file1_name file2_name > new_numbered_file_name
7070
```
7171

7272

@@ -114,15 +114,15 @@ tac <specified_file_name>
114114
2. This option attaches the separator before instead of after.
115115

116116
```
117-
tac -b concat.txt tacexample.txt
117+
tac -b concat_file_name tac_example_file_name
118118
```
119119
3. This option will interpret the separator as a regular expression.
120120
```
121-
tac -r concat.txt tacexample.txt
121+
tac -r concat_file_name tac_example_file_name
122122
```
123123
4. This option uses STRING as the separator instead of newline.
124124
```
125-
tac -s concat.txt tacexample.txt
125+
tac -s concat_file_name tac_example_file_name
126126
```
127127

128128
5. This option will display the help text and exit.

0 commit comments

Comments
 (0)