search

Loading

Friday, May 31, 2013

How to join all lines in a file using comma as delimiter?

Sometimes we want to combine the lines in a file as single line. How to achieve this in linux using command line?

We can use the command 'paste' for this purpose.

From its man page,

paste - merge lines of files


Saturday, March 2, 2013

How to run checkdisk on windows in external hard disk

Let's assume that the external hard disk is drive H, then open windows command line 'cmd' as Administrator and run the following command

chkdsk h: /f

Here /f is used to run it in forced mode.

Friday, February 8, 2013

Finding the first day and last day of the last month using date command in linux

First day of Last Month = echo $(date --date "-1 month" +%Y-%m-01)
Last day of Last Month = echo $(date --date "-`date +%d` days -0 month" +%Y-%m-%d)

First day of Current Month = echo $(date --date "-0 month" +%Y-%m-01)
Last day of Current Month = echo $(date --date "-`date +%d` days +1 month" +%Y-%m-%d)

First day of Next Month = echo $(date --date "+1 month" +%Y-%m-01)
Last day of Next Month = echo $(date --date "-`date +%d` days +2 month" +%Y-%m-%d)

Wednesday, December 19, 2012

Install "Foto" image and album Manager app in elementary os luna

"Foto" is a new elementary style image and album viewer app. It is very light weight when compared to  shotwell - the default image and album viewer app of elementary. As you know, I'm using a daily build of elementary os and I had upgraded it. But before completing the upgrade, I computer got switched off and the update failed. Then I found that one of the dependency of shotwell is causing the issue and I'm not able to run the update or install any other packages.

Tuesday, December 4, 2012

How to fix "Cannot establish any listening sockets - Make sure an X server isn't already running" error in linux

Today I had a problem. I have allocated around 30 GB of hard disk for my elementary os installation. It was almost full and only around 110 MB free space was there. But I had run the software update and shut down the computer. But after some time, when I restarted the computer, I was not able to access the Graphical User Interface. I am stuck.

Then I tried accessing the another terminal (not GUI, but tty) using key shortcut Ctrl+Alt+F1 I was able to access the terminal. I gave my username and password and I was able to login to the terminal. Then only thing not working is GUI (Hint :- issue with X windows system). I ran the command df -h and found that / is full (there is no free space).