Category: Linux

Get the First Line of Command Output in Shell

Get just the first line of the output of a command… <command>|head -n1 ls -1|head -n1

Remove File Extension using sed

Get just the file title without the extension in a variable. file_name=1 file_title=`echo1|sed ‘s/\..\{3\}$//’`

Replace \n with another String

The command to convert all \n in a file to another string – very useful for list code generation. perl…

Remove Extension in Shell Scripting

This command will list all the files a folder without their extensions. Comes handy when doing shell scripting perl -e…

Extracting DAA Image Files

I once got a DAA file from a P2P network. Initally I was at a lose about how to extract…

Searching text in a directory using find and grep

Use find and grep to search for a specific text in a directory. In this example, we search for files…

Caching Debain installation DVD/CD

Cache all your Debain installation DVD/CDs Put the first DVD in the drive and run this command apt-cdrom add Do…

Using Awk

Simple uses for awk Get the second column from the output ps aux | awk ‘{print $2}’ Use a different…

Install Win32Codecs in Linux

Win32Codecs is a collection of important codes to play videos in linux Download http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2 Extract into /usr/lib/codecs/

Mount ISO Images

Mounting ISO Images in Linux mount -t iso9660 -o loop <Image_File> <Mount_Point> How to Mount ISO/MDF Images in Linux