You are browsing the archive for Linux.

[Linux] Clearing the file content without deleting it

October 11, 2012 in Linux

In some situations, you may need to clear the file content without deleting the file. In order to do this in Linux environment, you can simply run the following command:

cat /dev/null > "Your file path"

syntax error near unexpected token `(‘

August 4, 2012 in Database, Linux

You may face this issue when you try to execute a command on the Linux shell. I faced this issue when trying to execute the following DB2 command on the server Linux server using the putty shell:

db2text create index someindex for text on someTable(someField) CONNECT TO someDB;

In order to fix this issue, I have to set \ before every ( as shown below:

db2text create index someindex for text on someTable\(someField\) CONNECT TO someDB;

Another solution is to add double quotes on the command as follows:

db2text "create index someindex for text on someTable(someField) CONNECT TO someDB";

Getting the Linux version and distribution that you are using

June 20, 2012 in Linux

Sometimes, you may not have the information of the Linux server that you are deploying your applications on. In order to get the Linux version and distribution, all what you need to do is to use the cat command as follows:

cat /etc/*-release

The distribution and version information are stored in the /etc directory with the pattern *-release.

Skip to toolbar