Wednesday, May 15, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 43790  / 1 Year ago, sat, march 4, 2023, 3:36:59

I would like to add the .zip extension to all files. I tried this, however it does not work:



ls | awk '{print $1 " " $1".zip"}' | xargs mv -f

More From » command-line

 Answers
7

Searching - few links:




  1. Recursively add file extension to all files - Stack Overflow

  2. Add file extension to files with bash - Stack Overflow



man rename:



NAME
rename - renames multiple files

SYNOPSIS
rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]

DESCRIPTION
"rename" renames the filenames supplied according to the rule specified as
the first argument. The perlexpr argument is a Perl expression which is
expected to modify the $_ string in Perl for at least some of the filenames
specified. If a given filename is not modified by the expression, it will not
be renamed. If no filenames are given on the command line, filenames will be
read via standard input...


man wiki: http://en.wikipedia.org/wiki/Man_page


[#42417] Monday, March 6, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainlyyor

Total Points: 210
Total Questions: 129
Total Answers: 116

Location: Barbados
Member since Sun, Nov 27, 2022
1 Year ago
ainlyyor questions
Sun, Jun 19, 22, 23:36, 2 Years ago
Sun, Jan 29, 23, 10:33, 1 Year ago
Sat, Feb 4, 23, 18:19, 1 Year ago
Sat, May 29, 21, 19:45, 3 Years ago
;