Simple one liner to remove empty files older than 7 days
# find . -type f -mtime +7 -ls | awk '$7 == 0 { print $NF }' | xargs rm
Cheers,
Kevin
|
Simple one liner to remove empty files older than 7 days Cheers, If you try to view LDOM configuration information as a non-privileged user, you’ll probably be greeted with this: When grabbing files with wget, it is useful to sometimes not traverse parent directories. For example, say I want to download everything under http://www.example.com/my/home recursively, but not traverse upwards into parent directories. You can add the –no-parent option for this. I wanted to remove a large number of files from a directory. However, I did not want to descend into subdirectories, nor did I want to remove any .pdf or .chm files. Some of the files had non-standard characters (such as quotes and spaces) in them. The solution? A simple one liner using find and xargs
Cheers, Analysis some issues with multicast on a pair of Solaris boxes, I wanted to filter out some unwanted multicast addresses when viewing my snoop traces. However, by default, snoop will resolve IPs, and ALL multicast IPs in the 228.x.x.x range (which I’m using) resolve to “reserved-multicast-range-not-delegated.example.com” I could then pipe this through grep -v and see only the information I cared about. This is for an old version (4.5) of Veritas NetBackup. # pwd /usr/openv/volmgr/bin # ./vmcheckxxx -rt tld -rn 0 Robot Contents Volume Configuration Slot Tape Barcode Media ID Barcode Mismatch Detected ==== ==== ============= ======== ============= ================= 1 Yes -none- A00000 -none- 2 Yes -none- A00001 -none- 3 Yes -none- A00002 -none- 4 Yes -none- A00003 -none- 5 Yes -none- A00004 -none- 6 No 7 No 8 No # ./vmupdate -rt tld -rn 0 Generating list of recommended changes ... Proposed Change(s) to Update the Volume Configuration ===================================================== Volume configuration is up-to-date with robot contents. Obviously, your robot type (-rt) may be different. Here, we see that the volume configuration is already up to date, thus no changes are made. Cheers, Got this from The Simpsons Movie Website - you can create your own Simpson-esque avatar. This kinda looks like me…
If you don’t have the md5sum utility installed, just use the digest tool supplied with Solaris 10 When you build Perl modules under Solaris, they are optimised for Sun Studio, which of course, we all use :/ So, if you build with gcc, the build will likely fail. You can use the following magical one-liner to fix this brain damage, and your modules will build correctly.
Cheers, Another OpenSSL related tip. If you’ve ever wanted to generate a hashed password suitable for inclusion in the /etc/shadow file (for example, during post-install procedures such as sysidcfg), you can use the openssl passwd command |