Sponsored Content
Full Discussion: Ls -l and rm
Top Forums UNIX for Beginners Questions & Answers Ls -l and rm Post 303038553 by MadeInGermany on Thursday 5th of September 2019 03:50:34 PM
Old 09-05-2019
It is also doable with
Code:
ls -l | while read a b c d e f g h fn; do if [ "$f" = "Aug" ] && [ "$g" = "1" ]; then echo rm "$fn"; fi; done

If you are happy then remove the echo before the rm.
Caution: this will match all "Aug 1" files, regardless of the year.

BTW the same technique works with find ... -exec echo rm {} \;
 
COLORS(3)						   libbash colors Library Manual						 COLORS(3)

NAME
colors -- libbash library for setting tty colors. SYNOPSIS
colorSet <color> colorReset colorPrint [<indent>] <color> <text> colorPrintN [<indent>] <color> <text> DESCRIPTION
General colors is a collection of functions that make it very easy to put colored text on tty. The function list: colorSet Sets the color of the prints to the tty to COLOR colorReset Resets current tty color back to normal colorPrint Prints TEXT in the color COLOR indented by INDENT (without adding a newline) colorPrintN The same as colorPrint, but trailing newline is added Detailed interface description follows. Available colors: Green Red Yellow White The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the same as Red). FUNCTIONS DESCRIPTIONS
colorSet <color> Sets the current printing color to color. colorReset Resets current tty color back to normal. colorPrint [<indent>] <color> Prints text using the color color indented by indent (without adding a newline). Parameters: <indent> The column to move to before start printing. This parameter is optional. If ommitted - start output from current cursor position. <color> The color to use. <color> The text to print. colorPrintN [<indent>] <color> The same as colorPrint, except a trailing newline is added. EXAMPLES
Printing a green 'Hello World' with a newline: Using colorSet: $ colorSet green $ echo 'Hello World' $ colorReset Using colorPrint: $ colorPrint 'Hello World'; echo Using colorPrintN: $ colorPrintN 'Hello World' AUTHORS
Hai Zaar <haizaar@haizaar.com> Gil Ran <gil@ran4.net> SEE ALSO
ldbash(1), libbash(1) Linux Epoch Linux
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy