#1 expand/unexpand utilities
expand < input.txt > output.txt
#2 Sed
sed 's/\t/ /g' < input.txt > output.txt
#3 Awk
awk '{ gsub(/\t/, " "); print }' < input.txt > output.txt
#4 Perl
perl -pe 's/\t/ /g' < input.txt > output.txt
#5 Ruby
ruby -pe '$_.gsub!(/\t/, " ")' < input.txt > output.txt
#6a Vim editor
:set expandtab
:%retab!
#6b Vim editor
:%s/\t/ /g
#7 Emacs editor
Set 'indent-tabs-mode' to nil to have tabs automatically converted to spaces.
To convert a region, "M-x untabify" will change tabs to spaces and "M-x tabify" will do the inverse.
#8 cut
cut -f1- --output-delimiter=' ' < input.txt > output.txt
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
Sunday, July 26, 2009
Eight Ways to Convert Tabs to Spaces
A collection of various ways to convert tabs to spaces in Unix/Linux/OS X with standard programs and utilities.
Sunday, June 28, 2009
Access Linux From Windows with FreeNX
FreeNX is a cross-platform remote desktop application. It's similar to VNC but is faster and leverages SSH for security. Installation on Ubuntu is simple (I'm using Jaunty).
- Edit /etc/apt/sources.list and add the FreeNX repository:
# Ubuntu FreeNX Repository for Jaunty
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2a8e3034d018a4ce
deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu jaunty main - Update your packages list:
sudo apt-get update - Install the FreeNX server:
sudo apt-get install freenx-server - Install the appropriate FreeNX client software for Windows or Mac, and try logging into your Linux machine remotely.
Thursday, April 26, 2007
Favorite Ubuntu Linux Tips
- Inline/embed PDFs in Firefox
To view PDFs, Firefox normally runs Acroread as an external helper application. Use this to display them directly in the browser window instead.
Lifehacker - Top Ten Ubuntu Apps and Tweaks
Subscribe to:
Posts (Atom)