View the Most Wanted LQ Wiki articles.    
LinuxQuestions.org > Linux Wiki > Ubuntu tips & tricks

From LQWiki

Jump to: navigation, search

Ubuntu is a Debian-based distribution. A number of Ubuntu flavors are available in addition to the gnome-based default. These include: kubuntu (kde-based), xubuntu (XFCE4-based), edubuntu (aimed at classroom use), and a number of others.

Contents

The unofficial Ubuntu Guide

http://ubuntuguide.org

There is a wealth of information here for the use, administration, and maintenance of Ubuntu.

Installing software

To install software, use the Gui Synaptic or the cli apt-get. Example:

apt-get install firefox

Fun with Eject Command

Lock the hardware eject button of the cdrom

$ eject -i 1

This command will lock the hardware eject button of your cdrom drive. Some uses are:

  1. If you have a toddler that has discovered the cdrom button
  2. If you are carrying a laptop in a bag or case and don’t want it to eject if the button is inadvertently pressed.

To unlock the button use:

$ eject -i 0

For more info see the eject's man page.

Forget the 'cd' command !

Using the autocd setting you can change into any directory without the use of cd command. To set it, type

$ shopt -s autocd

Here is how changing directories works now:

thasu@tha-admin-da ~ $ /var/log/cups/

To reside the above option as a permanent one, edit the .bashrc file and add this line "shopt -s autocd" into it.

Enjoy


lshw-The Hardware Lister

lshw (Hardware Lister) is a small tool to provide detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc.

In Ubuntu 10.10, It works without extra package.

$ sudo lshw

If you use Yum (Red Hat, Fedora, CentOS, etc), run the following command in terminal:

$ yum install lshw
$ lshw

Shorter Output:

If you just quickly want to quickly find the chipset version of a piece of hardware is, you can run the following to provide a very short output that should give you what you need:

$ sudo lshw -short


Linux Terminal Short Cuts

Get lightning fast and clever at the command line

You can use keyboard shortcuts and other command line tricks to make entering commands easier and faster. You might already know about the ‘tab’ key which completes partial commands and even file and directory names.

Here are some other keyboard shortcuts you can use within terminal:

 Ctrl-a    Move to the start of the line.
 Ctrl-e    Move to the end of the line.
 Alt-] x   Moves the cursor forward to the next occurrence of x.
 Alt-Ctrl-] x     Moves the cursor backwards to the previous occurrence of x.
 Ctrl-u    Delete from the cursor to the beginning of the line.
 Ctrl-k    Delete from the cursor to the end of the line.
 Ctrl-y    Pastes text from the clipboard.
 Ctrl-l    Clear the screen leaving the current line at the top of the screen.
 Ctrl-x Ctrl-u    Undo the last changes. Ctrl-_
 Alt-r     Undo all changes to the line.
 Alt-      Ctrl-eExpand command line.
 Ctrl-r    Incremental reverse search of history.
 Alt-p    Non-incremental reverse search of history.
 !!         Execute last command in history
 !abc     Execute last command in history beginning with abc
 !n        Execute nth command in history
 ^abc^xyz         Replace first occurrence of abc with xyz in last command and execute it
 Ctrl-t which swaps the last 2 characters before the cursor.
 Alt-d  delete a word forward from cursor
 Ctrl-w   delete a word backword from cursor
 Cheers. :)


Difference between “cal” and “calendar” command

Many of us know abt “cal” command. It displays the current month calendar.

But ‘calendar’ displays the history of events for current day and next day. ;)

Ex for “cal” :

 $ cal
January 2011
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Ex for “calendar ” :

 $ calendar
Jan 13     Horatio Alger born, 1834
Jan 13     Sophie Tucker born, 1884
Jan 13     Wilhelm Wien born, 1864, Nobel prize for blackbody radiation laws
Jan 13     National Liberation Day in Togo
.
.
. 
Jan 14 Albert Schweitzer born, 1875
Jan 14 Julian Calendar New Year’s Day
.
.


Personal tools
Sponsored Links