Chris Schammert
Github Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

đŸ’ģ Find


Does not create databases accessible to other users (e.g. locate command)

  • cd $targetdir && find . -maxdepth 1 -mindepth 1 -type d -printf "%f"

Scripting example

~/.scripts/sudof

#!/bin/bash

# Skips Arch Linux package cache, home directory, etc.
dirs_exclude="-path /mnt -o -path /run -o -path /tmp -o -path /dev -o -path /proc -o -path \
$HOME -o -path /sys -o -path /var/cache/pacman -o -path /var/lib/pacman"

sudo find / -type d \( $dirs_exclude \) -prune -o -print | grep $1
  • echo -en "alias sudof='~/.scripts/sudof'" >> ~/.bashrc

  • sudof blah

Resources