Oct 122013
 

Sometimes a program or software don’t start for a syntax error, and if you check the files there is nothing wrong..apparently.
There are a lot of characters that usually are not printed if you use a normal text editor, but you can easily check if they are present with your terminal and the command cat.

As first thing let’s create a simple text file with these special characters, open a terminal and run the command:

printf 'testing\012\011\011testing\014\010\012more testing\012\011\000\013\000even more testing\012\011\011\011\012' > /tmp/testing.txt

Now if you open the file with an editor you’ll have different results.
A simple cat will show:

$ cat /tmp/testing.txt 
testing
		testing
 
more testing
 
        even more testing

Continue reading »

flattr this!

Nov 012011
 

After many years of administration of Unix/Linux systems and using bash for many tasks i’ve discovered the command tac, the contrary of cat,
What this command do it’s to concatenate and print files in reverse order, it writes each file to standard output, last line first.

bash$ cat file1.txt
This is the line 1.
This is the line 2.
 
bash$ tac file1.txt
This is the line 2.
This is the line 1.

Continue reading »

flattr this!