Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

rename files

import os
#replace 'b4lib with the relative path of the folder
for filename in os.listdir('b4lib'):
    # print(filename)
    #replace 'full_path' with the full path of the directory with your file
    f = os.path.join('full_path',filename)
    print(f)
    # rename the file. The below code removes '-Copy1' from the filename
    os.rename(f, f.replace('-Copy1', ''))
Comment

Rename File with the rename Command

mv someFileName myNewNameFile
Comment

PREVIOUS NEXT
Code Example
Shell :: how to save curl output to a file 
Shell :: open command in linux 
Shell :: git commit exluding one file 
Shell :: how to create a text file list of the contents of a folder and subfolders 
Shell :: copy file to server 
Shell :: vagrant 
Shell :: github new repo 
Shell :: create samba user ubuntu 
Shell :: git create master branch in empty repository 
Shell :: uninstall all pip packages anaconda 
Shell :: mv command in linux 
Shell :: git bash command 
Shell :: how to install specific version of software on mac using brew 
Shell :: git checkout master 
Shell :: how to download fl studio on linux 
Shell :: datadog 
Shell :: add user linux 
Shell :: Installing Dradis 
Shell :: sed two patterns 
Shell :: mac Os dark icons for ubuntu 20.04 
Shell :: popular git command 
Shell :: E: Package ubuntu 
Shell :: Pipe script to a remote server 
Shell :: close app with terminal 
Shell :: rm: cannot remove 
Shell :: vim move terminal down 
Shell :: rpm scriptlets 
Shell :: cat file content after pattern 
Shell :: visual studio code hide git marker 
Shell :: run command from history ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =