소스 검색

add the regex for whitespace replace

Ubuntu's rename (included in perl 5.14.2) does not include -c or --nows
Blake Bourque 9 년 전
부모
커밋
2ab1bbefcd
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      pages/common/rename.md

+ 7 - 2
pages/common/rename.md

@@ -2,7 +2,7 @@
 
 > renames multiple files
 
-- Change foo to bar in matching files
+- Change foo to bar in matching filenames
 
 `rename {{'s/foo/bar/'}} {{*.txt}}`
 
@@ -12,4 +12,9 @@
 
 - Replace whitespace with underscores
 
-`rename --nows {{*.txt}}`
+`rename --nows {{*.txt}}`    
+`rename 's/\s+/_/g' {{*.txt}}`
+
+- No action, just show what renames would occur
+
+`rename -n {{'s/foo/bar/'}} {{*.txt}}`