Searching for files or patterns in files occurs quite frequently when dealing with CLI daily. Search for files in Linux is one of the essential skills to have while administrating servers. Here are few useful commands for fast implementation of such tasks.
Continue readingCategory: Tips and tricks
Linux tips and tricks with focus on shell scripting and monitoring. Here you will find short texts about solving real world problems with code examples.
run cron jobs more frequently than once per minute
Sometimes you might encounter situations when you need to run cron jobs more frequently than least possible option provided by crontab (1 minute). Although you should consider converting such tasks into daemons, in some cases it might really be enough to just solve it “quick and dirty” way. Here is how.
Continue readingskip non-printable characters with “strings”
Have you ever seen something like this, when you needed to skip non printable characters in order to see file contents?
[root@linux ~]# less test
"test" may be a binary file. See it anyway?
[root@linux ~]#
Continue reading shorthand if – else in bash
For some simple if-else conditions you may want to avoid having whole if; then; else; fi type of code. Instead, you can do it all in one bash if shorthand line. Here is how.
Continue reading