Wednesday, November 5, 2008

Some cool tricks for Linux

Ctrl+Alt+'+': Using this command switches you to a higher resolution
than your GUI started up in.

Ctrl+Alt+'-': Using this command switched the screen resolution lower.

Ctrl+Alt+Backspace': It kills the X server. Use it if your normal
logout option does not work.

Shift+PageUp: Scrolls up through the terminal output. Use this and the
one below to move through screenfuls of information.

Shift+PageDown: Scrolls down through the terminal output.

Ctrl+Alt+F1: Linux gives you the capability of working on more than
one virtual terminal at a time. You can have any number of virtual
terminals but most Linux system are setup for six that are accessible
through 'ctrl + alt + f1' to 'ctrl + alt + f6'. So, basically f1-fn
tells your system to switch to the virtual terminal corresponding to
the function key number. You will be using this most often to jump
from one terminal to another.

Ctrl+Alt+F7: While working in the Unix command line interface, if you
want to get back into the GUI mode, all you have to do is issue this
command.

Ctrl+C: This command halts a running process. Use this to quickly exit
from any program that you are running.

Ctrl+D: This command is used to log you out of a particular terminal.
It also issues an EOF (End Of File) to the program that you are
working in.

Ctrl+Z: Sends a current process into the background. Also if your
terminal is messed up because you 'cat' a binary file 'ctrl + z' will
clear up the screen for you and give you a clean prompt.

Ctrl+S: Scroll lock. Your screen will not be updated.

Ctrl+Q: Remove the scroll lock set above. You will now be able to
interact properly with your terminal.

Tab: One of the most used keys. Pressing the 'tab' key while typing
the path to any directory or a filename is very helpful. Write the
first few characters of the file or directory and press the tab key to
complete the name or give you a list of possibilities. When pressed
during an incomplete command, the 'tab' key completes the command for
you.

Ctrl+Alt+Del: When used at the console it reboots the machine.
Remember it causes a soft boot and not a cold boot. The system will
shutdown all services before rebooting.

UP Arrow: In the terminal, it cycles through the list of commands that
you have executed.

GPM: Let's look at copying data from one virtual terminal to another.
This requires your mouse to be setup for GPM. Use mouseconfig under
Red Hat and Yast under SuSE to set up your mouse correctly. Also make
sure the package GPM is installed beforehand.

MiddleMouseButton: Just select the text you would want to copy using
your mouse. Do as you would under Windows. Press and hold the right
mouse button and then drag to select the text. Then switch to the
terminal you want to copy to and click the middle mouse button. This
will paste the text at the current cursor location.

~: This represents your home directory. Use this in a command and the
`~` will get replaced by your home directory. cd ~/freeos . This
command gets you to the 'freeos' directory, which is a sub-directory
under your home directory.

Setting the speed of your mouse in X: Do a "man xset" and look at the
option 'm'.

'Very Fast' xset m 7 10
'Normal(Fast)" xset m 3 10
"System Default" xset m default
"Glacial" xset m 0 10

The xset -m option takes two parameters: the first is the speed and
the second is the threshold value. But these values will be reset as
soon as you log out. To make this setting permanent, just add it to
the ".xsession" file in your home directory.

Ctrl+Right-Mouse-button: Setting your Font Size in xterm. To set your
font size in an Xterm you can make use of the command 'setfont' or
simply just do the following. If you are in an xterm use 'ctrl + right
mouse button. This will popup a menu where you can choose some
(standard) font-sizes.

How to kill Netscape but have it save your bookmarks and history:

'kill -12" (USR2) is more gracious, when used to terminate Netscape.
Netscape will save the bookmarks and history files of the current
session.

Disable Blanking in Text consoles:

setterm -blank 0. To make this setting permanent, just add it to
your .xsession file in your home directory.

To disable X-Server screen blanking:

xset s off

To make this setting permanent, just add it to your .xsession file in
your home directory.

Turning off PING reply:

PING ( Packet Internet Groper ) is a service used most commonly to
figure out the network status of your machine. Many a time the useful
service provided by it could be used for a D.O.S. (Denial Of Service)
attack against you.

A simple 'echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all' will do
the trick. To turn it back on, simply 'echo 0 > /proc/sys/net/ipv4/
icmp_echo_ignore_all' to turn off the service.

Killing a Virtual Console without rebooting:

Log in as root, type 'lsof /dev/ttyx' where the 'x' in /dev/ttyx is
the terminal number of the hung virtual console. This will show you
the process that occupies this tty. Kill it and the getty process for
that virtual console should respawn.

No comments:

Post a Comment