≡ Menu

arithmetic

How to recursively go through all local or remote directories

You can use find command or recursdir command to recurse through local or remote directories to command/find files or create tar files.

recursdir command pass a C script to recursively perform operations on files. recursdir is an excellent tool for automatic stuff. It provides C style programming functions and statements such as:

  • strncmp()
  • exec()
  • system()
  • strstr()
  • strcat()
  • printf()
  • popen()
  • if ( expr ) { take-action }
  • if ( expr ) { take-action } else { do-something-else; }
  • /* comments */
  • Detecting file types and macros
  • All of the logical, arithmetic and bitwise C operators are supported. These are ( ) >= < = > < != == && || ! - + * / % & ^ and have the same meanings and precedences as in C. etc.

[click to continue…]

Sysadmin because even developers need heroes!!!

Linux/UNIX: Find Out If File Exists With Conditional Expressions

With the help of BASH shell and IF command, it is possible to find out if file exists or not on the filesystem. A conditional expressions (also know as “evaluating expressions”) can be used by [[ compound command and the test ([) builtin commands to test file attributes and perform string and arithmetic comparisons.
[click to continue…]