How do you convert from 1 measurement unit to another unit? Say from kilometers to miles. I can always look it up on that fridge magnet. This one local realtor likes to send me freebies like the fridge magnet with the common conversion factors. If you don't have a handy fridge magnet, you can try the units command-line utility program. To install it on a Debian system, enter: # apt-get install units# units 60km miles * 37.282272 / 0.0268224
My objective is to insert the complete contents of a text file at a specific row and column of another text file.If we are merely concerned with inserting after a specific line, it can be readily achieved with a number of Linux tools. For example, to insert file1.txt after the second line of file2.txt, any of the following commands will do:
We all know that the date command tells you the current time. Occasionally, you use the same command to set the time. That however becomes rarer these days with the advent of the ntp service that automatically synchronizes your computer's time with a super accurate public time server of your choice.
In the olden days, an entire office department shared one printer. At home, an entire household shared one printer. Nowadays, I have 2 printers at home (1 HP LaserJet and 1 Samsung Monochrome Laser printer).
As an avid emacs user for a decade plus, I am a little embarrassed to confess that I did not know for the longest time how to search for or replace line feed (newline) characters. If you are only searching for run-of-the-mill ASCII strings such as abc, you just type C-s (control-S), and then the characters, and hit return. Unfortunately, if your search string includes a line feed character, e.g., abc followed by a newline, I have some good news and some bad news for you.
If you are happily running a desktop search tool such as Tracker or Beagle, read no further. You already have the search tool you need to search OpenOffice files and more. These desktop search tools build indexes to improve search performance, and are in general quite scalable. Yet, a desktop search tool may be an overkill if you are just searching for certain text string in a directory containing OpenOffice files.
Recently, I had to install a PHP-based web application on my Apache web server.My first question was: "Is PHP enabled on the web server?"You can always ask the systems guy. But if you happen to be the systems guy, and you don't quite remember if you have installed PHP, here is how to find out.
Sometimes, in the Linux command-line world, a seemingly trivial technique can turn out to be tremendously useful. Before I discover the Alt-dot(.) shortcut, I type !$ to insert the last argument of the previous command.peter@tiger:~$ ls -l Windows_20081110102654.log-rw-r--r-- 1 peter peter 808 2008-11-10 10:26 Windows_20081110102654.logpeter@tiger:~$ cat !$cat Windows_20081110102654.log..........peter@tiger:~$
I previously blogged on using the shortcut Alt + dot to insert the last argument from the previous command.Suppose you don't want the last argument. Instead, you want to insert the first, second, or third argument of a previous command.No problem!
Windows users are familiar with the concept of file association. When you double click a file (say, cisco.doc), Windows examines the file name extension (doc), and opens the file using the default program associated with that extension(Office).Linux users can open files in a similar way in their X Window graphical user interface. But, if you want to open the file from the command-line, you need to type out at least the program name, oowriter, or do you?$ oowriter cisco.doc