32.6k views
2 votes
G implement a program to display a file's contents. it should be similar to the unix cat command when given a single file. name your command show.

User RickL
by
6.2k points

1 Answer

3 votes
cat file.txt = Read the contents of file.txt and display them on the screen.
cat file1.txt file2.txt = Reads the contents of file1.txt and file2.txt, and displays them in order on the terminal screen.
cat file.txt > newfile.txt = Read the contents of file.txt and write them to newfile.txt, overwriting anything newfile.txt previously contained. If newfile.txt does not exist, it will be created. etc.
User Benyi
by
7.4k points