It’s a myth to say that Ubuntu (or any Linux) needs a swap partition.
This is certainly the preferred way of working, and is most efficient,
but Linux can also use a single swap file located in the root partition,
just like Windows or Mac OS X. There are times when this is advan-
tageous, such as if you’re only able to create one partition for Ubuntu
(for example, Apple’s BootCamp software only allows the creation of a
single non-Mac partition when dual-booting).
To create a swap file, you need to first create a dummy file of sufficient
size, then format it as a swap file, and finally ensure that Ubuntu uses
it at boot-up. The following steps do just that (be extremely careful
entering these commands):
1. Open a terminal window and create an empty file in the root of the
file system using the dd command, as follows (this creates a 1GB
file—you should ideally adjust the count= figure to at least match
the size of your memory, bearing in mind that there is 1,024MB in
a 1GB):
$ sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
2. Now we need to format it as a swap file:
$ sudo mkswap /swapfile
3. The final step is to make Ubuntu mount it at boot, which is done
by editing /etc/fstab:
$ gksu gedit /etc/fstab
Then make a new line at the bottom of the file and add the follow-
ing:
/swapfile none swap sw 0 0
You can align the entries on the line under the column headings
in fstab, like the other entries in the file, but it doesn’t matter so
long as there is at least one space between each entry on the line.
Once done, save the file and reboot your computer.
Once the computer has rebooted, you can test to see if the swapfile is
being utilized by typing cat /proc/meminfo|grep Swap.
The steps above can also be used to add more swap space to a system
that has an existing swap partition. You might want to do this if you’re
editing extremely high-resolution photographs, for example, or working
with large video files.
Kamis, 02 September 2010
Add RAR file compression support to Ubuntu
While Zip is the main compression file format used on most desktop
computers, some people prefer to use the RAR format. To install sup-
port for extracting files from a RAR archive, use Synaptic to search for
and install unrar. Following this, File Roller—Ubuntu’s default archive
manager—will be able to extract files from RAR archives. You can also
use the command from the prompt by simply typing unrar e filename.rar,
replacing filename.rar with that which you downloaded. Note that unrar
doesn’t require a dash before the e command option.
Taken From ubuntu Kungfu
computers, some people prefer to use the RAR format. To install sup-
port for extracting files from a RAR archive, use Synaptic to search for
and install unrar. Following this, File Roller—Ubuntu’s default archive
manager—will be able to extract files from RAR archives. You can also
use the command from the prompt by simply typing unrar e filename.rar,
replacing filename.rar with that which you downloaded. Note that unrar
doesn’t require a dash before the e command option.
Taken From ubuntu Kungfu
Rabu, 01 September 2010
Take photos or record videos with your webcam
Use Synaptic to search for and install cheese and you’ll be able to
turn your computer into a virtual photobooth and/or camcorder! Once
installed you’ll find the program on the Applications → Graphics menu.
Using it is simple and self-explanatory, especially if you’ve ever used
Mac OS X’s Photobooth software, which it is clearly modeled upon.
Once you’ve taken a snap, right-click it and select Save As to write it
to the hard disk.
turn your computer into a virtual photobooth and/or camcorder! Once
installed you’ll find the program on the Applications → Graphics menu.
Using it is simple and self-explanatory, especially if you’ve ever used
Mac OS X’s Photobooth software, which it is clearly modeled upon.
Once you’ve taken a snap, right-click it and select Save As to write it
to the hard disk.
Instantly search for files in Nautilus
What this tip describes is very obvious yet almost nobody knows it’s
possible. To quickly search through a list of files in a Nautilus window,
simply ensure the window is top-most and start typing the search term.
A small search text field will appear near the bottom-right of the window
and files/folders will be matched as you type.
possible. To quickly search through a list of files in a Nautilus window,
simply ensure the window is top-most and start typing the search term.
A small search text field will appear near the bottom-right of the window
and files/folders will be matched as you type.
Have Ubuntu speak to you
Ubuntu includes a built-in speech synthesizer called espeak. It’s there
to work in partnership with the Orca screen reader, which provides
support for those who are partially-sighted,2 but it can also be called
from the command-line, as follows:
$ espeak "Ubuntu Kung Fu"
As you’ll be able to tell it’s not the most sophisticated speech synthe-
sizer in the world (it has a feel of Speak & Spell about it), but it can be
fun to play around with.
By simply typing espeak, and then hitting Enter , whatever you type
after this will be spoken. To quit, type Ctrl + d .
To switch voices, use the -v command option, but first you’ll need to
find-out the available voices, which can be done by typing espeak --
voices=en. For example, to have the phrase “How about a nice game of
chess?” spoken in a Jamaican voice, you could type:
$ espeak -s 140 -v en-westindies "How about a nice game ←֓
of chess?"
In the above example I also added the -s command option, by which
you can specify the speech speed in words per minute. The default
value of 170 tends to be a little fast, especially when it comes to longer
sentences.
Taken From Ubuntu Kungfu
to work in partnership with the Orca screen reader, which provides
support for those who are partially-sighted,2 but it can also be called
from the command-line, as follows:
$ espeak "Ubuntu Kung Fu"
As you’ll be able to tell it’s not the most sophisticated speech synthe-
sizer in the world (it has a feel of Speak & Spell about it), but it can be
fun to play around with.
By simply typing espeak, and then hitting Enter , whatever you type
after this will be spoken. To quit, type Ctrl + d .
To switch voices, use the -v command option, but first you’ll need to
find-out the available voices, which can be done by typing espeak --
voices=en. For example, to have the phrase “How about a nice game of
chess?” spoken in a Jamaican voice, you could type:
$ espeak -s 140 -v en-westindies "How about a nice game ←֓
of chess?"
In the above example I also added the -s command option, by which
you can specify the speech speed in words per minute. The default
value of 170 tends to be a little fast, especially when it comes to longer
sentences.
Taken From Ubuntu Kungfu
View all of a digital photo’s technical information
Most pictures taken by digital cameras are saved in EXIF JPEG format.
This means that they record technical details about the shot along with
the actual image data. The information includes the exposure time, the
aperture used, whether the flash was active, and so on.
In Ubuntu you can view this information by right-clicking any image,
clicking Properties, and then looking at the Image tab. To view even more
information, double-click the image so it opens in Eye of GNOME (the
default Ubuntu image viewer) and then click File → Properties. Then
click the Metadata tab and click the Details fold-down. Remember that
even dialog boxes within Ubuntu can be enlarged by clicking and drag-
ging the corners—this can really help view all the available information.
To view the information at the command-line, use Synaptic to install
the exif package. Then, to view the EXIF information, simply type exif
photo.jpg, replacing photo.jpg with the name of the file.
This means that they record technical details about the shot along with
the actual image data. The information includes the exposure time, the
aperture used, whether the flash was active, and so on.
In Ubuntu you can view this information by right-clicking any image,
clicking Properties, and then looking at the Image tab. To view even more
information, double-click the image so it opens in Eye of GNOME (the
default Ubuntu image viewer) and then click File → Properties. Then
click the Metadata tab and click the Details fold-down. Remember that
even dialog boxes within Ubuntu can be enlarged by clicking and drag-
ging the corners—this can really help view all the available information.
To view the information at the command-line, use Synaptic to install
the exif package. Then, to view the EXIF information, simply type exif
photo.jpg, replacing photo.jpg with the name of the file.
Shrink or enlarge images at the command line
GIMP can do just about anything to an image but it can be time-consuming
to fire it up just to resize an image. For ultra-quick manipulation, con-
sider Imagemagick, a command-line image manipulation program. It
doesn’t come installed by default and you’ll need to install it via Synap-
tic (search for and install imagemagick). Once installed, the convert com-
mand should be used with the addition of the -resize command option.
For example, the following will shrink filename.bmp to half its original
size:
$ convert -resize 50% filename.bmp filename_small.bmp
The following will enlarge filename.bmp to twice its original size (although
there will be an obvious degradation in quality):
$ convert -resize 200% filename.bmp filename_larger.bmp
to fire it up just to resize an image. For ultra-quick manipulation, con-
sider Imagemagick, a command-line image manipulation program. It
doesn’t come installed by default and you’ll need to install it via Synap-
tic (search for and install imagemagick). Once installed, the convert com-
mand should be used with the addition of the -resize command option.
For example, the following will shrink filename.bmp to half its original
size:
$ convert -resize 50% filename.bmp filename_small.bmp
The following will enlarge filename.bmp to twice its original size (although
there will be an obvious degradation in quality):
$ convert -resize 200% filename.bmp filename_larger.bmp
Graph the system bootup performance
If you’ve followed Tip 8, on page 66, which described how to optimize
Ubuntu’s boot-up, you might also be interested in Bootchart. As its
name suggests, this creates charts displaying exactly what starts dur-
ing boot-up, and the time it takes. Once installed by Synaptic (search
for the bootchart package), it runs as a background service and no con-
figuration is necessary. After each boot you’ll find the chart it has gen-
erated in the /var/log/bootchart/ directory—to view it, just precede its
filename at the command-line with eog or browse to it using Nautilus
and double-click it.
The chart shows the total time taken to boot along the vertical axis,
and beneath this shows the time taken by each of the startup services
to complete. See Figure 3.3, on the following page for an example taken
from my test computer.
Remember that programs such as Bootchart that log boot-up speeds
can themselves impact performance. When you’ve finished with it, be
sure to use Synaptic to remove the package.
Taken from Ubuntu Kungfu
Ubuntu’s boot-up, you might also be interested in Bootchart. As its
name suggests, this creates charts displaying exactly what starts dur-
ing boot-up, and the time it takes. Once installed by Synaptic (search
for the bootchart package), it runs as a background service and no con-
figuration is necessary. After each boot you’ll find the chart it has gen-
erated in the /var/log/bootchart/ directory—to view it, just precede its
filename at the command-line with eog or browse to it using Nautilus
and double-click it.
The chart shows the total time taken to boot along the vertical axis,
and beneath this shows the time taken by each of the startup services
to complete. See Figure 3.3, on the following page for an example taken
from my test computer.
Remember that programs such as Bootchart that log boot-up speeds
can themselves impact performance. When you’ve finished with it, be
sure to use Synaptic to remove the package.
Taken from Ubuntu Kungfu
Optimize startup for faster boot times
Few operating systems seem to boot quickly enough, and unfortunately
Ubuntu is amongst them. However, there are four things you can do to
reduce delays and generally speed-up startup:
• Reduce or eliminate the boot menu countdown;
• Make boot runtime scripts start in parallel;
• Build a read-ahead profile personalized to your PC;
• Reduce the number of GNOME startup programs.
Reducing the boot menu delay
If you dual-boot Ubuntu and Windows on your computer the boot menu
appears for 10 seconds, during which you can select either Windows or
Ubuntu. If you only have Ubuntu installed, a prompt appears for three
seconds telling you that you can hit a key to see the boot menu.
This delay can feasibly be reduced to one second, providing you have
quick enough reactions—hitting a key during that second will cause
the countdown timer to stop so you can make your choice at leisure.
Alternatively, you can configure the system so the boot menu never
appears. This will deny access to the other boot menu options but if
Ubuntu is the only operating system on your computer then this could
be a good arrangement.
Start by opening the boot menu configuration file in Gedit:
$ gksu gedit /boot/grub/menu.lst
Then search for the line that reads timeout 10 and change the 10 to read
either 1, for a one second countdown, or 0, to disable the boot menu
completely. See Figure 3.1, on the following page for an example from
my test PC.
Save the file and then reboot to test the settings.
Run boot-time scripts in parallel
Whenever Ubuntu boots it runs several scripts that start necessary
background services. By default these are set to run one-by-one but if
you have a processor with more than one core, such as Intel’s CoreDuo
series or AMD’s Athlon X2, you can configure Ubuntu to run the scripts
in parallel. This way all the cores are utilized and quite a bit of time can
be saved at each boot.
To make the change, type the following to open the necessary configu-
ration file in Gedit:
$ gksu gedit /etc/init.d/rc
Look for the line that reads CONCURRENCY=none and change it so it
reads CONCURRENCY=shell. Then save the file and reboot your computer.
Using this method I managed to shave a massive 20 seconds off my
desktop PC’s usual start-up time of just under a minute.
Build a readahead profile personalized to your computer
Ubuntu includes a software called readahead that, according to the
official blurb, “allows the user to specify a set of files to be read into the
page cache to accelerate first time loading of programs”. In other words,
it allows Ubuntu to cache frequently accessed files to avoid searching
around for them at startup. A default readahead profile is included with
Ubuntu but you can create your own, tailored to your system.
Reboot Ubuntu and, at the boot menu, ensure the usual Ubuntu entry
is highlighted. Then hit e . This will let you temporarily edit the boot menu entry. Use the cursor keys to move the highlight down to the
second line that beings kernel and hit e again. Use the right arrow key
to move to the end of the line and, after the words quiet and splash, add
the word profile. See Figure 3.2 for an example taken from my test PC.
Then hit Enter and then b to boot your computer. Note that the first
boot will be slow because the readahead cache will have to be rebuilt.
In subsequent boots, however, you should see speed improvements.
I experienced a couple of seconds improvement by building a new reada-
head profile. This isn’t a dramatic increase but it was certainly worth
doing.
Trimming the GNOME startup programs
Once you’ve logged into the GNOME desktop, you’ll face yet another
delay as all the GNOME background software starts. A few seconds
can be saved by trimming this list and that can be done using the
GNOME Sessions program (System → Preferences → Sessions). Ensure
the Startup Programs tab is selected and then look through the list for
items you might want to prune. For example, if you’re never going to
use Evolution’s alarm function then Evolution Alarm Notifier can be dis-
abled by removing the check alongside it. One word of warning: Volume
Manager isn’t related to audio. Instead it enables the automatic detec-
tion of external storage devices that are attached to your computer.
As such it should always be enabled. Nor should you disable Network
Manager—this is necessary to get Ubuntu online if you’re using wifi. (If
you absolutely have to disable it, follow the instructions in Tip 43, on
page 103, which explains how to configure Ubuntu’s network compo-
nent using the older Network Settings tool.)
Ubuntu is amongst them. However, there are four things you can do to
reduce delays and generally speed-up startup:
• Reduce or eliminate the boot menu countdown;
• Make boot runtime scripts start in parallel;
• Build a read-ahead profile personalized to your PC;
• Reduce the number of GNOME startup programs.
Reducing the boot menu delay
If you dual-boot Ubuntu and Windows on your computer the boot menu
appears for 10 seconds, during which you can select either Windows or
Ubuntu. If you only have Ubuntu installed, a prompt appears for three
seconds telling you that you can hit a key to see the boot menu.
This delay can feasibly be reduced to one second, providing you have
quick enough reactions—hitting a key during that second will cause
the countdown timer to stop so you can make your choice at leisure.
Alternatively, you can configure the system so the boot menu never
appears. This will deny access to the other boot menu options but if
Ubuntu is the only operating system on your computer then this could
be a good arrangement.
Start by opening the boot menu configuration file in Gedit:
$ gksu gedit /boot/grub/menu.lst
Then search for the line that reads timeout 10 and change the 10 to readeither 1, for a one second countdown, or 0, to disable the boot menu
completely. See Figure 3.1, on the following page for an example from
my test PC.
Save the file and then reboot to test the settings.
Run boot-time scripts in parallel
Whenever Ubuntu boots it runs several scripts that start necessary
background services. By default these are set to run one-by-one but if
you have a processor with more than one core, such as Intel’s CoreDuo
series or AMD’s Athlon X2, you can configure Ubuntu to run the scripts
in parallel. This way all the cores are utilized and quite a bit of time can
be saved at each boot.
To make the change, type the following to open the necessary configu-
ration file in Gedit:
$ gksu gedit /etc/init.d/rc
Look for the line that reads CONCURRENCY=none and change it so it
reads CONCURRENCY=shell. Then save the file and reboot your computer.
Using this method I managed to shave a massive 20 seconds off my
desktop PC’s usual start-up time of just under a minute.
Build a readahead profile personalized to your computer
Ubuntu includes a software called readahead that, according to the
official blurb, “allows the user to specify a set of files to be read into the
page cache to accelerate first time loading of programs”. In other words,
it allows Ubuntu to cache frequently accessed files to avoid searching
around for them at startup. A default readahead profile is included with
Ubuntu but you can create your own, tailored to your system.
Reboot Ubuntu and, at the boot menu, ensure the usual Ubuntu entry
is highlighted. Then hit e . This will let you temporarily edit the boot menu entry. Use the cursor keys to move the highlight down to the
second line that beings kernel and hit e again. Use the right arrow key
to move to the end of the line and, after the words quiet and splash, add
the word profile. See Figure 3.2 for an example taken from my test PC.
Then hit Enter and then b to boot your computer. Note that the first
boot will be slow because the readahead cache will have to be rebuilt.
In subsequent boots, however, you should see speed improvements.
I experienced a couple of seconds improvement by building a new reada-
head profile. This isn’t a dramatic increase but it was certainly worth
doing.
Trimming the GNOME startup programs
Once you’ve logged into the GNOME desktop, you’ll face yet another
delay as all the GNOME background software starts. A few seconds
can be saved by trimming this list and that can be done using the
GNOME Sessions program (System → Preferences → Sessions). Ensure
the Startup Programs tab is selected and then look through the list for
items you might want to prune. For example, if you’re never going to
use Evolution’s alarm function then Evolution Alarm Notifier can be dis-
abled by removing the check alongside it. One word of warning: Volume
Manager isn’t related to audio. Instead it enables the automatic detec-
tion of external storage devices that are attached to your computer.
As such it should always be enabled. Nor should you disable Network
Manager—this is necessary to get Ubuntu online if you’re using wifi. (If
you absolutely have to disable it, follow the instructions in Tip 43, on
page 103, which explains how to configure Ubuntu’s network compo-
nent using the older Network Settings tool.)
Scroll without the mouse in Firefox and Evolution mail windows
Both Firefox and Evolution have a hidden caret browsing feature. This
is where a cursor appears in a web page or received email, just like in
a word processing document. Just like in a word processor, its position
can be controlled using the cursor keys. When the cursor reaches the
bottom or top of the screen, the page (or email) scrolls.
Caret browsing was designed as an accessibility feature for those who
find reading difficult but it’s proved popular for every kind of user. This
is because it allows people to navigate web pages or emails without tak-
ing their hands off the keyboard (there’s no need to reach for the mouse
scroll-wheel, for example), and also keep track of where they were last
reading should they walk away from their computer. In addition to navi-
gation, text can be highlighted in the usual way by holding down Shift
and using the cursor keys. It can then be copied in the usual way by
typing Ctrl + c .
To activate caret browsing in either application, just hit F7 while the
program is running. The cursor will appear at the top of the web page
or email preview window, although can be repositioned by clicking the
mouse anywhere.
is where a cursor appears in a web page or received email, just like in
a word processing document. Just like in a word processor, its position
can be controlled using the cursor keys. When the cursor reaches the
bottom or top of the screen, the page (or email) scrolls.
Caret browsing was designed as an accessibility feature for those who
find reading difficult but it’s proved popular for every kind of user. This
is because it allows people to navigate web pages or emails without tak-
ing their hands off the keyboard (there’s no need to reach for the mouse
scroll-wheel, for example), and also keep track of where they were last
reading should they walk away from their computer. In addition to navi-
gation, text can be highlighted in the usual way by holding down Shift
and using the cursor keys. It can then be copied in the usual way by
typing Ctrl + c .
To activate caret browsing in either application, just hit F7 while the
program is running. The cursor will appear at the top of the web page
or email preview window, although can be repositioned by clicking the
mouse anywhere.
Stop the cursor blinking
I’ve nothing against a blinking cursor myself but some find it distract-
ing. To stop Ubuntu’s block blinking, open gconf-editor and navigate
to /desktop/gnome/interface and remove the check from cursor_blink. The
log out and back in again. Note that Evolution appears to ignore this
setting, but most other applications will now have a still cursor.
Alternatively by changing the value in cursor_blink_time, you can simply
make it blink more slowly. A value of 5000 equates to fives seconds–
each unit is 1ms. Be aware that a setting such as 5000 means that the
cursor will be visible for five seconds at a time and then invisible for the
same length of time...
ing. To stop Ubuntu’s block blinking, open gconf-editor and navigate
to /desktop/gnome/interface and remove the check from cursor_blink. The
log out and back in again. Note that Evolution appears to ignore this
setting, but most other applications will now have a still cursor.
Alternatively by changing the value in cursor_blink_time, you can simply
make it blink more slowly. A value of 5000 equates to fives seconds–
each unit is 1ms. Be aware that a setting such as 5000 means that the
cursor will be visible for five seconds at a time and then invisible for the
same length of time...
Closely monitor a laptop computer’s power consumption
Run gnome-power-statistics and you’ll see a graph of the exact power
usage of your computer over the time since it booted up (provided your
computer’s hardware supports it). Try boosting the brightness of your
screen or loading programs and see how much of a drain they can be!
usage of your computer over the time since it booted up (provided your
computer’s hardware supports it). Try boosting the brightness of your
screen or loading programs and see how much of a drain they can be!
Switch monitor resolutions with a single mouse-click
If you have an external monitor or projector that you occasionally attach
to a notebook computer, you might be used to switching resolutions
on a regular basis. Unlike with Windows, this isn’t just a right-click
procedure—you must navigate the System → Preferences menu.
A good solution is to use Synaptic to search for and install resapplet. For
some reason, although it’s officially a GNOME applet, resapplet doesn’t
appear on the standard applet list. Instead, it must be configured to
start at login. To do this, click System → Preferences → Sessions,
ensure the Startup Programs tab is selected, and click the Add button.
In the Name and Command fields of the dialog that appears, type resap-
plet. Leave the Comment field blank. Then close the dialog box and log
out and back in again.
The new icon will then appear besides NetworkMonitor in the notifica-
tion area. Clicking it will reveal a list of possible resolutions that you
can choose-from.
Incidentally, it should be possible to instantly step up and down reso-
lutions by typing Ctrl + Alt and tapping the + / - keys on the numeric
keypad. Unfortunately this doesn’t work on Ubuntu systems because of
the way they graphical subsystem is configured. It may work on other
Linux systems, however.
Taken From Ubuntu Kungfu
to a notebook computer, you might be used to switching resolutions
on a regular basis. Unlike with Windows, this isn’t just a right-click
procedure—you must navigate the System → Preferences menu.
A good solution is to use Synaptic to search for and install resapplet. For
some reason, although it’s officially a GNOME applet, resapplet doesn’t
appear on the standard applet list. Instead, it must be configured to
start at login. To do this, click System → Preferences → Sessions,
ensure the Startup Programs tab is selected, and click the Add button.
In the Name and Command fields of the dialog that appears, type resap-
plet. Leave the Comment field blank. Then close the dialog box and log
out and back in again.
The new icon will then appear besides NetworkMonitor in the notifica-
tion area. Clicking it will reveal a list of possible resolutions that you
can choose-from.
Incidentally, it should be possible to instantly step up and down reso-
lutions by typing Ctrl + Alt and tapping the + / - keys on the numeric
keypad. Unfortunately this doesn’t work on Ubuntu systems because of
the way they graphical subsystem is configured. It may work on other
Linux systems, however.
Taken From Ubuntu Kungfu
Add cool new visualizations to Totem/Rhythmbox
Both Totem and RhythmBox include a funky animation that appears
during music playback. Animations such as this are known as visu-
alizations, but out-of-the-box Ubuntu only includes one, rather than
the hundreds found on the likes of Mac OS or Windows media players.
However, you can add-in more to Ubuntu, for use in both Totem and
RhythmBox, by using Synaptic to search for and install the libvisual-0.4-
plugins package.
Once the package has installed, to change the visualization in Totem
that appears when a music track is playing, click Edit → Preferences,
select the Display tab in the dialog that appears, and make your choice
from the Type of visualization dropdown list. Your choice will take effect
immediately, so drag the preferences dialog out of the way to preview
it.
In RhythmBox, click View → Visualization to start the animation and
then select from the dropdown list beneath the visualization.
Taken from Ubuntu Kungfu.
during music playback. Animations such as this are known as visu-
alizations, but out-of-the-box Ubuntu only includes one, rather than
the hundreds found on the likes of Mac OS or Windows media players.
However, you can add-in more to Ubuntu, for use in both Totem and
RhythmBox, by using Synaptic to search for and install the libvisual-0.4-
plugins package.
Once the package has installed, to change the visualization in Totem
that appears when a music track is playing, click Edit → Preferences,
select the Display tab in the dialog that appears, and make your choice
from the Type of visualization dropdown list. Your choice will take effect
immediately, so drag the preferences dialog out of the way to preview
it.
In RhythmBox, click View → Visualization to start the animation and
then select from the dropdown list beneath the visualization.
Taken from Ubuntu Kungfu.
See (and reuse) the most recently typed commands
The command-line includes a powerful history feature that can make
life much easier. To see the recently typed commands, type history. This
simply dumps to screen a hidden file in your /home directory called
.bash_history where up to 1000 commands are recorded. Because this
list will scroll off the screen when listed it’s a good idea to pipe the
output into a text reader, such as less:
$ history|less
To reuse one of your commands, at the command-prompt type an
exclamation mark (!; known as a bang in bash-speak) and then the
number alongside the entry in the history list. For example, on my
system, I noted when viewing the history list that the command cp
/etc/fstab ~/Desktop was command 591. To use it again, I typed !591 at
the command-prompt. If you ever need to simply repeat a command
you’ve just used, type two exclamation marks—!!.
To actively rifle through your command history, hit Ctrl + r and then
start typing the command you’re interested in. The prompt will “auto-
complete” as you type. To use the command, hit Enter . To edit it before
using it, hit Esc and then make your changes.
Hitting the up and down cursor keys will also let you move through the
most recently commands typed. Just hit Enter when you find the one
you want to reuse.
life much easier. To see the recently typed commands, type history. This
simply dumps to screen a hidden file in your /home directory called
.bash_history where up to 1000 commands are recorded. Because this
list will scroll off the screen when listed it’s a good idea to pipe the
output into a text reader, such as less:
$ history|less
To reuse one of your commands, at the command-prompt type an
exclamation mark (!; known as a bang in bash-speak) and then the
number alongside the entry in the history list. For example, on my
system, I noted when viewing the history list that the command cp
/etc/fstab ~/Desktop was command 591. To use it again, I typed !591 at
the command-prompt. If you ever need to simply repeat a command
you’ve just used, type two exclamation marks—!!.
To actively rifle through your command history, hit Ctrl + r and then
start typing the command you’re interested in. The prompt will “auto-
complete” as you type. To use the command, hit Enter . To edit it before
using it, hit Esc and then make your changes.
Hitting the up and down cursor keys will also let you move through the
most recently commands typed. Just hit Enter when you find the one
you want to reuse.
Set any picture as wallpaper with a single-click
The easiest way of setting your own picture as a desktop wallpaper
is to click and drag the image to the desktop using the middle mouse
button (if the image is already on the desktop then click and drag it a
few inches to the left/right). On most modern mice, the middle mouse
button is the scroll-wheel, which also doubles as a third mouse button.
On the menu that appears when you release the button, click Set as
Background.
If that sounds a little too unorthodox for you (it can be hard to use the
middle mouse button), you can also use Synaptic to install the nautilus-
wallpaper package, which adds a simple Set as Wallpaper option to the
menu that appears when you right-click an image file. After installa-
tion you’ll need to log out and then in again before the option becomes
visible.
is to click and drag the image to the desktop using the middle mouse
button (if the image is already on the desktop then click and drag it a
few inches to the left/right). On most modern mice, the middle mouse
button is the scroll-wheel, which also doubles as a third mouse button.
On the menu that appears when you release the button, click Set as
Background.
If that sounds a little too unorthodox for you (it can be hard to use the
middle mouse button), you can also use Synaptic to install the nautilus-
wallpaper package, which adds a simple Set as Wallpaper option to the
menu that appears when you right-click an image file. After installa-
tion you’ll need to log out and then in again before the option becomes
visible.
Langganan:
Postingan (Atom)