Skip to content

Tag: linux

Difference between printf and echo in Bash

Why printf prints 5 and echo prints 6 characters? Answer First sentence of entry for echo in the bash man page (emphasis mine): Output the args, separated by spaces, followed by a newline. First sentence of the man page entry for printf: Write the formatted arguments to the standard output under the control o…

write(2)/read(2) atomicity between processes in linux

I have a case where there are two processes which act on the same file – one as a writer and one as a reader. The file is a one line text file and the writer re-writes the line in a loop. reader reads the line. The pseudo code looks like this: Writer Process Reader Process After a while of

How to run linux without any DesktopEnvironment?

I have Manjaro installed on my system and for the Desktop Environment I have XFCE4 and for login manager LXDM everything works fine but when I try to change some of the lxdm-config option I can’t login to my user, the problem came from that I disable that option to shown the select session panel and aft…

using tr to strip characters but keep line breaks

I am trying to format some text that was converted from UTF-16 to ASCII, the output looks like this: The only text I want out of that is: So there is a line break “n” at the end of each line and when I use It is stripping the new line as well so all the text ends up in

CentOS Unix Cron order of execution when all set to same time

I have a series of cron jobs running at the command line calling the php interpreter all by the same user configured to run once a day Do these all execute at once or do the execute in the order of entry in some cron table, complete and move on to the next cron job? Answer And to answer your