Subj : Re: Old computer To : bex From : boraxman Date : Sun Aug 07 2022 13:07:54 be> In the end, all of the shells can do most of the same things, it's just a be> matter of how easy it is to do those things. zsh makes things like be> working with history and searching easy-peasy. And oh-my-zsh plugins be> make adding environment variables and variables a piece of cake. be> be> Bo> I add an "archived" extended attribute to any files I've put on my be> Bo> archive drive, but still want to keep around, and I can list those fil be> Bo> with ls *(+archived) or delete them with be> be> That is friggin BRILLIANT! I am going to implement that on my test be> system! be> be> be> Have a place for everything and keep the thing somewhere else; this is be> not advice, it is merely custom. be> - Mark Twain The magic happens with this ZSH function. Note that you need to add zmodload zsh/attr to your .zshrc as well to add support for extended attributes. function archived() { # just a check whether the archived attribute exists, regardless of value. local val zgetattr $REPLY user.archived val 2>/dev/null } All you need to do to set a file as "archived" is created an extended attribute with that name on the file ie # setfattr -n user.archived mysticBBS_Release3.RAR then you can refer to files with this 'tag' using the following glob *(.+archived) as in # rm *(.+archived) Which removes all files with the tag ....or recursively # rm **/*(.+archived) The following glob is the negation *(.^+archived) So # cp *(.^archived) /mnt/external copies all files which have NOT got the tag which you can then tag as archived with # setfattr -n user.archived *(.^+archived) I have folders I download things in, which I then save on an external drive, but may want to keep locally for a moment longer. Of course, you can duplicate that function with other tags. --- Mystic BBS v1.12 A47 2021/12/24 (Linux/64) * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101) .