Linux Tips

Tech Tips for Linux
As an avid Linux user/administrator for several years, I must say it is the BEST operating system available today. The availability of free, powerful tools, and the inherently excellent design of the UNIX operating system provide the most stable, fastest computing platform available today. The ability of Linux to be installed on relatively cheap i386 hardware further increases it’s value.

Since I am no programmer, this site is my contribution to the open source movement. Under the Linux menu selection on the left are pages containing tech tips for Linux. I hope you find them useful.

Shortcut Keys
These shortcut keys will help you navigate and get more done.

Ctrl+Alt+Backspace: Kills the current X session and returns you to the login screen.
Ctrl+Alt+Delete: Shutdown and reboot.
Ctrl+Alt+Fn key: Switches to a new terminal. The GUI desktop is normally at Ctrl+_Alt+F7, leaving F1-F6 as text screens.
Ctrl+Tab: Switch tasks. This will pop a window from which you can cycle through the current running tasks. To choose a task, cycle through until it’s noted in the window, then release the key combination.
Ctrl+a: Move the cursor to the beginning of a line.
Ctrl+d: Log out of the current terminal.
Ctrl+e: Move the cursor to the end of a line.
Ctrl+l: Clear the terminal window. Provides the same functionality as typing “clear” at the command line.
Ctrl+u: Clears the current command line
Middle Mouse Button: Paste text. Use the left mouse button to copy the text and the middle button to paste it.
Tab: Autocomplete a command in the terminal window. This shortcut will finish the command if it’s completely unique, or all similar possibilities if not.
Up/Down arrows: The up arrow in the terminal will the most recent command, scrolling backward each time the key is depressed. To select a command, press enter. The down arrow will move forward in the command history.

What is the difference between /dev/st0 and /dev/nst0

Both st0 and nst0 are used to access tape devices under linux. The difference is an automatic rewind:

st0 streaming/scsi tape #zero

nst0 “non-autorewinding at close”

When you remember that most commands are sent to the device 1 at a time,
open device, write advance tape command, close. open device, write data to tape, close.

Having the tape auto rewind would be a real pain, unless you are only
dumping a single tape session to the device.
open device, write to tape, close (magic rewind in background)

How do I convert my ext2 partition to ext3?

Before you can mount a partition as ext3 you have to create a journal on it. The easiest way to do it is to type:

tune2fs -j /dev/hdaX

This can be done on an unmounted or on a mounted filesystem. If you create the journal on a mounted filesystem you will see a .journal file. Don’t try to delete this and don’t back this up or restore it from backup! If you run tune2fs -j on an unmounted partition an unvisible journal file will be created.

Now you can mount the filesystem as ext3 using:

mount -t ext3 /dev/hdaX /mnt/somewhere

With mke2fs -j /dev/hdaX you can format a partition as ext3 (as always it will be also usable as ext2 partion).

watch

found new command I didn’t know existed. watch will run a command at a
specified interval and print the first screen of the output to stdout. For
example,

watch -d “ls -l”

Will run “ls -l” every two seconds. Handy if copying/downloading files to
a directory.

Copy/Paste KDE – Using Klipper

Klipper is the KDE clipboard utility. It stores clipboard history, and allows you to link clipboard contents to application actions.

Klipper is a great app that offers something that is hard to find in MS Windows. It stores and easily accessible history of your clipboard. Every time you copy and paste an item it is added to Klipper and you can go back to a previous ‘copy’ easily.

The strange thing I’ve noticed about Klipper and KDE cut and paste in general is it’s a little inconsistent. Cut and paste acts one way in a Konsole window and differently in an application.

Today, found the Klipper manual and learned a couple things. First, ctl-alt-v will open Klipper without having to move the mouse down to the tray area. Second, there is a mode setting for Unix or Windows type behavior. If the “Synchronize contents of the clipboard and the selection” check box is checked the clipboard functions in the UNIX® mode; if not, the Windows®/Mac® mode is used. The default for Slackware 9.1 appears to be “Separate Clipboard and Selection” with the “ignore selection” box unchecked. Changed mode to “Synchronize” perhaps I will get more consistent results.

Convert html table to CSV file
Had a situation today where I needed to convert data in an HTML table to a CSV file.

Found a nice way to accomplish this. Using Gnumeric version 1.2.12 I was able to import the html file into the spreadsheet and then export it out to a CSV file. Worked like a champ.

Leave a Reply

Your email address will not be published. Required fields are marked *