Pārlūkot izejas kodu

Added find bash script for file extensions

script finds and replaces file extensions and also replaces link extensions in files with a particular extension
pull/393/head
James Ononiwu pirms 1 gada
committed by GitHub
vecāks
revīzija
b7e6974497
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  1. +12
    -0
      README.md

+ 12
- 0
README.md Parādīt failu

@@ -2148,6 +2148,18 @@ find . -depth -name '*test*' -execdir bash -c 'mv -v "$1" "${1//foo/bar}"' _ {}
find / \( -perm -4000 -o -perm -2000 \) -type f -exec ls -la {} \;
```

###### Recursively find/replace files extension ext1 with ext2

```bash
find . -name "*.ext1" | while read i; do mv "$i" "${i%.ext1}.ext2"; done
```

###### Recursively find/replace link extension ext1 with ext2 in files of extension ext

```bash
find . -name '*.ext' -exec sed -i 's/\.ext1/\.ext2/g' "{}" \;
```

___

##### Tool: [top](https://en.wikipedia.org/wiki/Top_(software))


Notiek ielāde…
Atcelt
Saglabāt