Questions tagged [rename]

For anything regarding renaming. Could be applicable to a wide range of subjects. Should be replaced by a more domain-specific tag if applicable.

Questions regarding renaming one or many files, directories, projects, variables, users, data cells, and version control conflicts arising from renaming should be tagged with rename.

To rename a file means to give an existing file a new name without changing any of its content. In UNIX systems, this is done with the mv command.

Renaming a variable will usually require a find-and-replace edit in existing code.

5438 questions
22
votes
2 answers

Change filenames to lowercase in Ubuntu in all subdirectories

I know it's been asked but what I've found has not worked out so far. The closet I came is this : rename -n 'y[A-Z]/[a-z]/' * which works for the current directory. I'm not too good at Linux terminal so what should I add to this command to apply it…
Naterade
  • 2,635
  • 8
  • 34
  • 54
22
votes
3 answers

How to safely change github account name?

I would like to change my github account name, I found an option in GitHub account settings. However, I am concerned about consequences and would like to know what is the best strategy of name change, considering that I have some projects of my own…
mikhail-t
  • 4,103
  • 7
  • 36
  • 56
21
votes
4 answers

command line find first file in a directory

My directory structure is as follows Directory1\file1.jpg \file2.jpg \file3.jpg Directory2\anotherfile1.jpg \anotherfile2.jpg \anotherfile3.jpg Directory3\yetanotherfile1.jpg \yetanotherfile2.jpg …
user2008746
  • 211
  • 1
  • 2
  • 5
20
votes
2 answers

VS Code - Rename symbol too slow for Python

I'm having this refactoring issue where I try to rename a function through the option "Rename symbol", but it will take a long time. There's a "progress bar" moving endlessly below the document tab. It is taking around 5 min to do the renaming (also…
Rafael Boy
  • 287
  • 2
  • 8
20
votes
4 answers

How to change name of factor levels?

training set trainSample <- cbind(data[1:980,1], data[1:980,2]) cl <- factor(c(data[1:980,3])) test set testSample <- data(data[981:1485,1], data[981:1485,2]) cl.test <- clknn prediction k <- knn(trainSample, testSample, cl, k = 5) output < k …
Beginner questions
  • 343
  • 1
  • 4
  • 15
20
votes
3 answers

Move a file/directory but still merge changes easily?

I've read in various FAQs that git doesn't explicitly track renames/moves, preferring to look for identical (or in some situations similar?) files. That's great, but will it cope with this situation: a friend's remote repository has a new feature…
Chris Boyle
  • 11,423
  • 7
  • 48
  • 63
20
votes
3 answers

How to set unique row and column names of a matrix when its dimension is unknown?

I have matrix like : [,1][,2][,3][,4] [1,] 12 32 43 55 [2,] 54 54 7 8 [3,] 2 56 76 88 [4,] 58 99 93 34 I do not know in advance how many rows and columns I will have in matrix. Thus, I need to create row and column names…
SacHin DhiMan
  • 201
  • 1
  • 2
  • 4
20
votes
4 answers

How do I rename relationships in Neo4j?

I realized only after importing a ton of nodes that I had created relationships called START, which is a reserved keyword. Querying the DB through the Cypher console hence always complains about the reserved keywords: SyntaxException: reserved…
ulkas
  • 5,748
  • 5
  • 33
  • 47
20
votes
2 answers

Using rsync to rename files during copying with --files-from?

Using rsync, how can I rename files when copying with the --files-from argument? I have about 190,000 files, each of which need to be renamed when copying from source to destination. I plan to have the list of files in a text file to pass to the…
Mark Richman
  • 28,948
  • 25
  • 99
  • 159
19
votes
2 answers

dplyr rename - Error: `new_name` = old_name must be a symbol or a string, not formula

I am trying to rename a column with dplyr::rename() and R is returning this error that I am unable to find anywhere online. Error: `new_name` = old_name must be a symbol or a string, not formula Reproducible example with a 2 column data…
19
votes
3 answers

SQL Server : rename primary key

I have a table doc.MyTable which I want to deprecate by renaming to doc._MyTable. I then want to create a new doc.MyTable with the same primary key that the old doc.MyTable had. The problem is that SQL Server says that primary key already exists. So…
user3685285
  • 6,066
  • 13
  • 54
  • 95
19
votes
5 answers

How do I create batch file to rename large number of files in a folder?

I'd like to rename a large number of files within a folder on a WinXP system, preferably using a batch file. The files are currently named like this: Vacation2010 001.jpg Vacation2010 002.jpg Vacation2010 003.jpg And I'd like to change them…
user459962
  • 191
  • 1
  • 1
  • 5
19
votes
4 answers

How to durably rename a file in POSIX?

What's the correct way to durably rename a file in a POSIX file system? Specifically wondering about fsyncs on the directories. (If this depends on the OS/FS, I'm asking about Linux and ext3/ext4). Note: there are other questions on StackOverflow…
Yang
  • 16,037
  • 15
  • 100
  • 142
19
votes
5 answers

Python program to rename file names while overwriting if there already is that file

As the title says, I wanted a python program that changes the file name, but I wanted to overwrite if there already is a file with that destination name. import os, sys original = sys.argv[1] output = sys.argv[2] os.rename(original, output) But…
user42459
  • 883
  • 3
  • 12
  • 29
19
votes
6 answers

How can I change case of database name in MySQL?

My Database name is SPM and I want to change it to spm (small letters). I tried using RENAME DATABASE SPM TO spm; , but I am getting the following error message: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that…
Rachel
  • 100,387
  • 116
  • 269
  • 365