When working with git it may often be convenient to get a (pure) list of files to give to some other command (e.g. astyle). This may be implemented as a trigger on the server but that has its pros and cons. Listing the modified files and processing them locally is the safest way as this […]
Shell and environment
Tips on how to customize your environment and how to configure and use the shell (bash) in the most efficient way
How to change my terminal prompt (PS1)
On newer distributions you can easily change your terminal prompt, (which is controlled by the PS1 environment variable, btw) by adding a file with the prompt format string to the /etc/profile.d directory. You may name the file whatever you like, e.g. set-prompt.sh, but make sure that inside it there is a line that sets PS1 […]
Checking ‘dynamic’ conditions in Makefile’s
How can you test ‘dynamic’ conditions in a gnu Makefile? The net is full of GNU-Makefile advise explaining how to define variables and then later use them at compile time to run different commands or different targets. This is all very useful but often time you want to run a command and test it’s result […]
INIT: cannot execute “/etc/init.d/rcS” (or rc)
PROBLEM: The Linux init process gets an error that looks like this (in the stderr output): INIT: cannot execute “/etc/init.d/rc” Several things may cause this error but in my case it was happening because the rc script had #! /bin/sh on the first line, and /bin/sh was missing. SOLUTION: In /bin provide a link called […]
How to make ‘man’ or ‘less’ paged text not disappear from screen after exit?
Problem: Depending on your Linux distribution, the text displayed by the ‘man’ command (or any other text piped into ‘less’ for that matter) may stay on your screen upon exit from man/less or be cleared from your screen upon exit. Many people find it useful to have the man page text stay on the screen, […]