Friday, 10 March 2017

How to append string/data to a file in Linux



This article will show you how to append a string (or any data) to the end of a file under Linux/Unix. Appending is done very simply by using the append redirect operator >>. Simply use the operator in the format data_to_append >> filename and you’re done. Below are several examples:

Examples to Append Data to a File
  1. To append the string “hello” to file greetings.txt
    echo "hello" >> greetings.txt
  2. To append the contents of the file temp.txt to file data.txt
    cat temp.txt >> data.txt
  3. To append the current date/time timestamp to the file dates.txt
    date >> dates.txt


Free Linux utility to convert PDF to Text file

Are you looking for a fast, easy, and free way to convert a PDF document to a plain-text .txt format? Luckily, there is a built-in program in most Linux distributions that can do this called pdftotext. To convert, simply do:
pdftotext -layout filename.pdf filename.txt

No comments: