Start using (the programme) “less” to display files
You don’t have to open files or documents to display them.
You can use the programme called “less”.
Less is a pager. A pager is a program that displays text files1.
In the terminal run:
$ less file
To quit less press
Navigating a file with
To navigate the file viewed use keys:
jto scroll down
kto scroll up
for space bar to scroll down one window size
bto scroll up one window size
The idea of using keys rather than the arrow-key pad (to the bottom right of your keyboard) is that it is faster since your right-hand fingers are already positioned on keys
k. Once one gets use to scroll up and down with
k it becomes inconvenient to use the arrow keys.
To return to the top of the page press
To jump to the bottom of the page press
Searching for keywords
You can search for keywords by typing
/some_keyword. Once the keyword is highlighted, press
enter). Now you can move to the next occurrence by pressing the key
n (small cap), and the previous occurrence by pressing the key
N (large cap).
If you already scrolled down and think that the keyword you are looking for is towards the top of the page, use the “inverse” of
/, that is:
?. For example
?some_keyword to search backwards.
Switch to a text editor to edit a file
If you want to edit the file you are previewing press
Display multiple files with less
You can preview multiple files running:
$ less file1 file2 file3
To navigate between files press:
:nto examine the next file
:pto examine the previous file
Use less to display the output of other commands
You can use less to display the output of other commands instead of having the output of a command printing in the shell (i.e., the terminal).
For example, to list all pdf files of a directory and pipe the output of
ls to less run:
$ ls .*pdf | less
That way you can navigate the (supposedly long) list using the keys
k or search for keywords using
| pipes the output of the command preceding
| as input to the next.
* acts as wild card (a substitute) for one or many characters (“a string”, esoterically speaking). In that example above, that is all files ending in .pdf.
The history of less
Less was written by Mark Nudelman in 1983-85, released in 1984 and currently maintained by him2. Less is released under GNU GENERAL PUBLIC LICENSE Version 3.
To learn more about less, run
$ man less to view less’s manual (in less).
I do self-funded research and I'm writing a book.
> What's the book about?
About technologies and epistemology.
Meaning, technologies can foster agency. No doubt. But I am also asking:
Can technologies make us blind?
I posted a summary of the prologue on the homepage: https://yctct.com/