Mini-Howtos

Want to support HowtoForge? Become a subscriber!
 

I get the feeling that my hard disk is very slow. Is there a way I can verify and tune it?

You can use hdparm to tune your hard disk. On Debian, you would run

apt-get install hdparm

to install it.

hdparm --help

shows a list of all available options. To get more information about your hard disk, run

hdparm -i /dev/hda

This will look like:

/dev/hda:

Model=MAXTOR 6L060J3, FwRev=A93.0500, SerialNo=663214759549
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=32256, SectSize=21298, ECCbytes=4
BuffType=DualPortCache, BuffSize=1819kB, MaxMultSect=16, MultSect=16
CurCHS=4047/16/255, CurSects=16511760, LBA=yes, LBAsects=117266688
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes:  pio0 pio1 pio2 pio3 pio4
DMA modes:  mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2
AdvancedPM=no WriteCache=enabled
Drive conforms to: ATA/ATAPI-5 T13 1321D revision 1:

* signifies the current active mode

To see how fast your hard disk currently is execute

How can I observe a logfile continuously?

With the command:

tail -f /path/to/logfile

you will see all lines added to the logfile. To stop this, press [CTRL] + c

How to save a command in the shell history without executing it

Enter the command line and hit the keys:

[CTRL] + [#]

This will put a # in front of the command and execute it. The shell will take it as comment.

How can I clear the shell window?

Use the commad:

clear

or the keyboard shortcut:

[CTRL] + [L]

Creating image borders with ImageMagick convert

The command is:

convert -border 2x2 old.jpg new.jpg

This creates a new image (new.jpg) with a 2 pixel border from the image old.jpg.

To set the bordercolor to red, use this command:

convert -border 2x2 -bordercolor "#FF0000" old.jpg new.jpg

Get a list of the installed services

To get a list of the installed services on the shell, you may use this command (on Fedora, RedHat, CentOS, SuSE, and Mandriva):

chkconfig --list

Show all processes for a specific user

To view only the processes owned by a specific user, use the following command:

top -U [USERNAME]

and replace [USERNAME] with the name of the user.

first page
previous page
...
13
next page
last page