BASED ON Cat
Cat is part of Gnu Coreutils, made to Concatenate and write files.
Here is the content of file.txt:
This is a file
this is a tab
this is some lines
There is 2 main way to feed inputs in cat:
cat file.txt
-will show the file
echo "This is test" | cat
we know (;
Will take data from standard input. (CTRL-D to quit)
cat > file2.txt
cat file2.txt
this will show the whole new file
cat >> file2.txt
cat file2.txt
New file gets updated
cat file.txt file2.txt > file3.txt
cat file3.txt
we see the 2 content in 1 file
The "-" is standard input, which will allow you to add the data you want. (CTRL-D to quit)
cat file.txt - file2.txt > file3.txt
cat file3.txt
we see the 2 content + added data in 1 file
cat in reverse, will reed line from bottom up
tac file.txt
cat -n file.txt
cat -b file.txt
Will squeeze repeated blank line into one.
cat -s file.txt
cat -E file.txt
cat -T file.txt