Tag Info

Hot answers tagged

3

file1 -> dir1/sub file2 -> dir2/sub file3 -> dir3/sub file4 -> dir4/sub . . The names of files and directories are with numbers as above? for i in {1..300}; do cp file$i dir$i/sub; done


3

To search folder C:\users\ for .exe files dir C:\users\*.exe /s /b | find ^"temp^" /v /i | findstr /e .exe > UserExecutablePaths.txt dir /s Lists the files in the folder and also the ones in the subfolders recursively. dir /b Lists the subfolders/files names in bare format. find /v exclude "temp" string find /i not case sensitive findstr /e : ...


2

Your file system may have some corruption on it. Try running fsck -f over it (when it is unmounted), see if it finds any problems.


1

Curious why you didn't just delete the whole directory and then recreate it: rm -rf foo_dir mkdir foo_dir Or delete the files without using find: cd [path]/foo_dir rm -rf * Perhaps deleting and recreating the directory would still help you.


1

I have found the answer by sharing this question on Google Plus. The answer by Axel Engeland: That really depends on the file system used. Directories are supposed to store inode tables. If inode tables grow too large, another one is created and the tables are linked. So even if you removed all the files, there may still be a big amout of ...


1

I'm going to answer my own question just for the sake of completeness. As I could not delete the source files as they were being compressed, I just made a wee script to scrap them manually. Not fancy, but living in cron, works wonders: my vol occupancy went from 60% to 10%. here the script #!/bin/bash find /var/log/remote -mtime +1 -iname "*.log" > ...


1

find /home/ -ipath "*/temp/some.file" -type f -execdir cp {} another.file \; You just have to change exec to execdir from the other answer (sorry I cannot post it as a comment yet). The execdir option states, according to find's man page: -execdir command {} + Like -exec, but the specified command is run from the subdirectory containing ...


1

I wrote a script called findnh which I believe handles certain edge cases better than the answers to this question that I've been able to find on the web. #!/bin/bash declare -a paths while [ $# -ne 0 ]; do case "$1" in -*) break ;; esac paths+=("$1") shift done find "${paths[@]}" \( -name . -o -name .. -o \! \( -name '.*' -prune \) \) "$@" For ...


1

With bash extended globbing patterns: $ shopt -s extglob $ echo outline/!(*-*) outline/crescent.png outline/oval.png outline/trigon.png



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