May 2008

Determine the File Count in Unix Directory

May 21, 2008

To determine the number of files in the Unix directory, use the following command. ls -l | grep -c “^-.*”

Read the full article →

Merging Files in Unix

May 9, 2008

You have multiple files in containing data in similar format and wanted to consolidate in a single file. This is usually the case if you have a daily log that you want to place an archive copy in a single file in weekly or in monthly, yearly. The basic syntax of merging file is cat [...]

Read the full article →

Writing Files in Unix

May 9, 2008

To write files in Unix, the syntax is echo > Example echo “This is my message.” > myfile.txt To add another line in the myfile.txt, use the following syntax. echo “This is my second message.” >> myfile.txt You may notice that double greater than sign (>>) is used instead of single greater than sign. This [...]

Read the full article →