Tag Info

New answers tagged

1

According to the Docker development discussion this is the number 1 known issue in the Docker docs. Here is the current release note reference. Unexpected File Permissions in Containers An idiosyncrasy in AUFS prevents permissions from propagating predictably between upper and lower layers. This can cause issues with accessing private keys, database ...


2

You don't need to recursively enumerate directories to delete them with rm -rf; you can simply list the top-level directories you want to delete. To determine whether a directory entry is a directory rather than a file, you can use find's -type d test; using . isn't a good indicator. The following should work for you: find * -maxdepth 0 ! -name encoded ...


0

You are close. Step-by-step, here's how to delete the file by inode number. First, find the inode number of the file you want, using ls -li. The inode number will be in the first column of output. For example: $ls -li 311010 -rw-rw-r-- 1 me me 3995 Apr 6 16:27 -???\# ;-) In this case, the inode number is 311010 Use find to look for the file by inode ...


0

There are 2 methods i know Use "--" to make rm stop parsing command line options, like this: rm -- --help or you can use / before any symbol you don't want to treat as command like rm /-help though these are repeated.. still wanted to help


1

It's the same. You just have to provide the parent directory rather than the prefix of files. In your example, it would be: find /path/to -type f -mtime +5 -exec rm {} \; This will delete all the files older than 5 days which are under /path/to and its sub-directories. To delete empty sub-directories, refer to @Costas comment above.


1

Assuming .DS_Store represent files and not directories, the most portable still fast way to do it would be: sudo find / -name .DS_Store -exec rm {} + The only risk is for sudo not to be available but it is quite low nowadays. -delete demand GNU find which is not always present. The command termination + instead of \; highly optimizes the exec clause by ...


0

For a machine such as your macbook you won't find much difference in performance between the two commands. However, if you look at the -exec version you can see a subtle difference: sudo find / -iname ".file-to-delete" -exec rm {} \; This means that you will find all those files with name ".file-to-delete". However this search might return some unwanted ...


6

The rm command refuses to delete the directory by the '.' name. If you instead use the full path name it should delete the directory recursively. It is also possible to delete the directory if it is the current directory. [testuser@testhost] /tmp$ mkdir ff [testuser@testhost] /tmp$ cd ff [testuser@testhost] /tmp/ff$ touch a b c [testuser@testhost] ...


0

You cannot remove the current directory because then the current directory would become invalid. First, change out of the directory you want to remove (e.g. cd ..) and then remove the desired directory using its full or relative pathname from outside.



Top 50 recent answers are included