home.social

#term_tips — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #term_tips, aggregated by home.social.

fetched live
  1. @nixCraft find + mv + shell parameter expansion + test:
    find -mindepth 1 -maxdepth 1 -type f -exec bash -c 'file="{}"; [ "${file}" != "${file//needle/replacement}" ] && mv "${file}" "${file//needle/replacement}"' \;

    man find
    man mv
    man test
    gnu.org/software/bash/manual/h

    #term_tips

  2. Quand tu t'es enfermé dehors pendant N minutes en faisant trois fois un mauvais mot de passe sur ton compte utilisateur linux mais que tu arrives à te connecter en root, pour vider les logs de tentatives de connexion ratées :

    faillock --user utilisateur --reset

    #term_tips #linux #faillock #lockedOut

  3. I just discovered some #bash / #zsh #shell syntax:
    ${variable:-default_if_empty}
    ${variable:+default_if_not_empty}
    ${variable:=value_assigned_if_not_empty}

    #term_tips

  4. @climagic Boosted, fav'd and bookmarked, so there is a tiny little chance I can find it again when I need it in the future. 😆
    #term_tips #tmux