Timeline for Group files and directories based on first letter of their name and move them to directories of that letter
Current License: CC BY-SA 4.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 16, 2021 at 14:29 | history | edited | terdon♦ | CC BY-SA 4.0 |
added 12 characters in body
|
| Apr 16, 2021 at 13:47 | history | edited | ilkkachu | CC BY-SA 4.0 |
mkdir -p is posix, but ${f:0:1} isn't...
|
| Apr 16, 2021 at 13:26 | comment | added | Kamil Maciorowski |
I have tested the basic code of yours. I lost data because all the files overwrote f one by one. Improvement: mv -- "$f" "$firstChar"/.
|
|
| Apr 16, 2021 at 13:25 | comment | added | terdon♦ |
@KamilMaciorowski good point. You won't lose data, but the f would cause errors. See update.
|
|
| Apr 16, 2021 at 13:24 | history | edited | terdon♦ | CC BY-SA 4.0 |
added 60 characters in body
|
| Apr 16, 2021 at 12:58 | history | rollback | terdon♦ |
Rollback to Revision 1
|
|
| Apr 16, 2021 at 12:57 | history | edited | terdon♦ | CC BY-SA 4.0 |
added 955 characters in body
|
| Apr 16, 2021 at 12:53 | vote | accept | Amir Shabani | ||
| Apr 16, 2021 at 12:45 | comment | added | Kamil Maciorowski |
In my case there are regular files f, fu and fuu. Will I lose data?
|
|
| Apr 16, 2021 at 12:41 | history | answered | terdon♦ | CC BY-SA 4.0 |