If you are new to the Linux operating system and you are limited to a terminal, you may think about how to view a document in the command-line. Perusing a document in the Linux terminal isn’t equivalent to opening the file in Notepad. Since you are in the command-line mode, you should utilize commands to read data in Linux.
It’s not that complicated to display a document in Linux. It’s effortless as well as essential that you learn how to read files in the CLI. Here are a few commands that let you view the content of a file in the Linux terminal.
Ex: (kali@kali:~/Downloads$ cat HelloWorld)
Ex: (kali@kali:~/Downloads$ tac HelloWorld)
Ex: (kali@kali:~/Downloads$ nl HelloWorld)
This option views the file one page at a time. The best thing is that when you exit the “less” command (by pressing “q”), there are no lines displayed on the screen. Your terminal remains clean and pristine.
Ex: (kali@kali:~/Downloads$ ls /bin | less)
Ex: (kali@kali:~/Downloads$ ls /bin | sort)
Ex: (kali@kali:~/Downloads$ ls /bin | uniq)
Ex: (kali@kali:~/Downloads$ head /etc/passwd)
Ex: (kali@kali:~/Downloads$ tail /etc/passwd)
Ex: (kali@kali:~/Downloads$ ls /bin | more)
Ex: (kali@kali:~/Downloads$ stings /usr/bin/cp)
Ex: (kali@kali:~/Downloads$ wc HelloWorld)
Ex: (kali@kali:~/Downloads$ ls /bin | grep zip)
Ex: (kali@kali:~/Downloads$ fmt HelloWorld)