Category Archives: Linux

pwd with file name

I often am working with a file and need to copy it’s full absolute path. In the past, I always used pwd to grab the path, then typed a slash then ls’d the file name and copied that. I just stumbled across the realpath command which allows you to do this all in one step for quick copying/pasting of the absolute path.

readlink -f somefile.txt

which outputs:

/full/path/to/that/file/somefile.txt

It’s the little things!

How to Install PHP APC on Fedora & CentOS

APC (or Alternate PHP Cache) is a popular PHP PECL extension that can be used for PHP op-code caching. It is very stable and can significantly reduce page rendering times. It works by caching the PHP binaries, so that PHP doesn’t have to compile them on every request.

Installation is simple:

1. Use yum to install necessary packages.

# yum install php-pear php-devel httpd-devel pcre-devel

Continue reading

How to insert a tab character into Putty for Linux

If you’re like me, you’ve noticed that if you’re trying to grep for a tab character, the following won’t work:

grep "\t" file.txt

The solution is to use a literal tab character, but it’s not quite so simple. You can’t insert a tab character just by hitting the tab button or by pasting one in. You need to hit Ctrl+V first:

So to type a tab in the putty console: