![]() If it’s important to you to still see the file when you’re done, you might want to use it. There’s actually a more command too, based on an older UNIX command. Again, you can use the q key to quit back to the shell. You can use your arrow keys as well as PgUp/PgDn to move around the file. In that case, try the less command: $ less myfile Often a file is too long to fit on a screen, and you may want to be able to go through it like a document. To learn more, run the command man cat, and when done just hit q to exit back to the shell. There are additional options that will show special characters and other features. For instance, you can number lines: $ cat -n myfile The cat file also lets you ornament the file in different ways, in case that’s helpful. (Note that Fedora takes no blame for this debatable humor!) $ tac myfile Nothing too surprising there, right? But here’s an interesting twist. So if you cat that file, you’ll see this output: $ cat myfile To make this clear, the file will contain the word equivalent for a number on each line, like this: one Imagine you have a file with one word per line, called myfile. Really what’s happening under the hood is the file is read one line at a time, then each line is written to the screen. When you cat a file, you’re simply displaying the whole file to the screen. The cat command is well known to terminal users. If you open a Terminal to do some work on your system, chances are good that you’ll need to read a file or two. In this installment you’ll learn how to read files in different ways. ![]() This article is one in a series that will show you some common command line utilities. To try it out in a shell, just open the Terminal application in your Fedora system. But you’ve probably seen there is a powerful command line under the hood. You can point and click your way through just about any task easily. ![]() Fedora is delightful to use as a graphical operating system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |