Tag Info

Hot answers tagged


Do a cat -v LIST to see if there are any special characters that you don't see with a simple echo. I suspect DOS line endings, i.e. extraneous carriage returns before the newline. EDIT: to convert the LIST file: dos2unix < LIST > LIST.new && mv LIST.new LIST Or if you don't have dos2unix, but do have vim: vim LIST, then :set notx, then :wq


This one worked for me: find "$@" ! -type d -exec kill -9 $$ \; -quit && rm -R "$@" If find exits normally (nothing is found) rm -R "$@" will be executed. If find finds something the current shell/script is killed ($$ stores the pid). The rm-part will never be executed in this case.


The simplest approach (but which fails if your files contain spaces or newlines or other weird characters) is ls -ltr '*2014-09-20*' | tail -n 1 The safer way is find . -printf "%T@\t%p\n" | sort | awk -F"\t" '{print $NF}'


Here is great command that you can edit for your own use: find -perm -o+r -exec stat --printf='%A %a %n --- %F\n' {} \; Example of result: -rw-r--r-- 644 dir1//file4 --- regular file lrwxrwxrwx 777 dir1/file5 --- symbolic link Finds files with permission for others to read. Then print the permissions in symbolic and octal form, file path and file type. ...

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