Command Line Interface

Removing Control Characters From a Text File in Linux

A few weeks ago, I had a text file generated in widows, and it had the “^M” control character at the end of each line. I had to compare it with a similar file generated on my Linux machine (using diff), and because of these control characters it failed diff.

The first step was to check why diff failed. Normally, you cannot see these control characters, and one might be surprised that the comparison fails thought the files are exactly the same. In order to see these characters, one should use “-A” flag with the cat command:

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , ,

Wednesday, January 28th, 2009 Linux 9 Comments

Playing With Youtube Videos in Linux

In this short post I’ll introduce a csh script I wrote recently. I wrote it for a certain purpose and it’s definitely not “general purpose”. I’m posting it here so you/I can use it as a reference.

The script uses these programs:

1. youtube-dl    (In ubuntu, you can get it by typing : sudo apt-get install youtube-dl).

2. ffmpeg   (Again: sudo apt-get install ffmpeg)

3. avimerge (part of the transcode package: sudo apt-get install transcode)

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , ,

Monday, January 26th, 2009 Shell Scripts 2 Comments

Query Google Finance From the Command Line

This is a one line bash script I wrote to query a stock’s price from Google Finance. It uses wget to get the HTML page from Google Finance and then grep and cut to extract the stock’s price. The script is based on the current HTML format of the Google Finance pages and might not work if Google decide to change this format (It’s easy to modify, though).

To have the script:

Open your favorite text editor (mine is vim), and type/paste this:

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , ,

Friday, December 26th, 2008 Command Line No Comments

Command Line Tools I Like

Though my love with Linux started because its GUI, especially compiz fusion, I discovered through time that Linux’s power is in its command line, almost every thing can be done from there, easily, clean and fast.

Here is a list of the command line tools I use most of the time:

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: ,

Monday, December 1st, 2008 Command Line 2 Comments

Twitter from the Command Line

This simple but not perfect script will let you twit easily from the command line.

Open a new file with your favorite text editor, and add this:

1
2
3
#!/bin/bash
curl --basic --user USERNAME:PASSWORD \
--data status="$*" http://twitter.com/statuses/update.xml -o /dev/null;

Save the file as twit (or any other name you choose).

Of course, we don’t like our password inside an accessible plain text file. So this is what I did:

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: ,

Saturday, November 22nd, 2008 Command Line 1 Comment

Take Screenshots in Linux with “scrot”

I have found this tool recently, and I have no idea how I was able to manage without it before.

This tool allows you to capture any region of your screen, by selecting it with your mouse, clicking on the title-bar of a window and other methods. It’s very flexible and contains many options.

To download the program in Ubuntu:

sudo apt-get install scrot

Now, open a new text file and type this

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , ,

Friday, November 14th, 2008 Linux 10 Comments

Todo.txt – A simple yet powerful todo manager for Linux

Recently, I discrovered todo.txt, a great todo list manager for people who feel comfortable with Linux’s command line.

The greatness of this tool is in its simplicity: the whole todo list is saved as plain text, and operations like adding/removing/prioritarizing/modifying/listing items are done through a very simple command line interface supplied in a bash script.

› Continue reading

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Tags: , , ,

Saturday, October 18th, 2008 Linux 2 Comments
my email
my photo
Hi,
My name is Amir Watad. I have a BSc. in biomedical engineering from The Biomedical Engineering school , Technion , Israel, and a BSc. in electrical engineering from The Electrical Engineering school , Technion , Israel.
I'm a Verification Engineer in Mellanox Technologies Ltd.
I love Linux, the Command Line and the OpenSource Community.
I used to write Poems (Arabic) when I was able to find time for this.
June 2012
S M T W T F S
« Sep    
 12
3456789
10111213141516
17181920212223
24252627282930
SEO Powered by Platinum SEO from Techblissonline

Twitter links powered by Tweet This v1.7.4, a WordPress plugin for Twitter.