There is a post from devilkin that solved my problem, here is the solution:
It requires the ACPI VIDEO module loaded.
Create the file /etc/acpi/lidswitch.sh
with these lines (don't forget to chmod +x on it):
#!/bin/sh
# /etc/acpi/lidswitch.sh
# Re-activates the screen when the lid is opened again
LID_STATE="/proc/acpi/button/lid/LID/state"
LCD_STATE="/proc/acpi/video/VID1/LCD/state"
grep -q open $LID_STATE
if [ $? -eq 0 ]; then
echo 0x80000001 > $LCD_STATE
fi
Then put these lines in /etc/acpi/events/lidswitch
(lidswitch not being a folder, but a file without a file extension):
# /etc/acpi/events/lidswitch
# This is called when the lid is closed or opened and calls
# /etc/acpi/lidswitch.sh for further processing.
event=button[ /]lid
action=/etc/acpi/lidswitch.sh
Extra help:
(1) Use gedit to create these files. So open up Terminal, then type in 'sudo gedit' (without quotes) and copy and paste the lines above.
(2) Use nautilus to apply the "chmod +x" property to the file. To do this, open up Terminal, then type in 'sudo nautilus' (without quotes) and the navigate to etc, acpi, then right-click on lidswitch.sh, navigate to Properties, then Permissions, then Allow executing file as program, then click Close.
seq 1 100 | less -X
see: man less
-X or --no-init
Disables sending the termcap initialization and deinitialization strings to the terminal.
This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen.
Best Answer
You can use the -X switch:
Or you could do the following:
For example
cat myfile
to display the entire file orcat myfile | grep searchterm
if you want to search for something specific.You also could use
head -n X
ortail-n X
to display the first/last X lines of a file.