Tag Info

Hot answers tagged

3

To exclude specific paths, on Linux: find / -path /sys -prune -o -path /proc -prune -o -type d Another approach is to tell find not to recurse under different filesystems. find / -xdev -type d You could also use locate to query a database of file names (usually updated nightly) instead of the live system. locate '*' | shuf -n 1


2

rm's stdin (where it reads the prompt answer from) is /dev/null (set by GNU xargs, some other xargs implementations would keep it as the pipe from ls). Your sh is getting many arguments at once, but you're only processing one ($1). Also note that the newline character is as valid as any in a file name which is why you generally can't process the output of ...



Only top voted, non community-wiki answers of a minimum length are eligible