Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [move]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
288 views

I know I can create folders from a list.txt, but can I move files to those folders based on a mapping?

If right now, I only had a bunch of files dumped into a single directory, is there a way that I could move the files into a folder based on a mapping file. For example: A B 1 File Name Folder Name ...
Nicole's user avatar
  • 19
4 votes
2 answers
423 views

Issue expanding variable with multiple wildcards in bash shell script with mv / rename

I wrote a bash shell script for Linux to move files in a static folder according to parameters specified in a data file. I've reduced that script to a minimal reproducible example to demonstrate an ...
End Antisemitic Hate's user avatar
1 vote
2 answers
48 views

Batch ogg vorbis transcode

What I'm trying to do is simply make this command find . -name "*flac" -exec oggenc -q 7 {} \; spit the oggs out into whatever folder that I choose. I've tried just putting ~/vorbis at the ...
h8uthemost's user avatar
0 votes
1 answer
116 views

How to move all files whose contents begin with 0?

Here's a command to move all files whose name begin with 0 into a folder called zero : mv [0]* zero Question: What is a command for moving all files whose contents begin with 0 into a folder called ...
Sebastien Palcoux's user avatar
-2 votes
1 answer
172 views

How to move all mkv files from the root of media folder to own subfolder for each mkv file

How to move all mkv files from the root of the media folder to own subfolder for each mkv file, with the same name as mkv filename beside .mkv extension on the end. Example home/incoming/media/ is the ...
Loop1's user avatar
  • 21
0 votes
5 answers
91 views

How can I move all directories below a certain size?

I want to move all directories in the current directory that are below a certain size Here, I've managed to do a selection: for dir in * do if [[ $(du -s "$dir" | awk '{print $1}') -le ...
Jason Hunter's user avatar
1 vote
1 answer
209 views

Can't move opened e-mails in Thunderbird

I recently upgraded Thunderbird to version 115.0.1 and since then, the MOVE TO dropdown doesn't work when I am reading an e-mail. I am referring to this option: When I browse my e-mails (without ...
user's user avatar
  • 1,005
1 vote
0 answers
39 views

eCheck if it's safe to move a directory and replace it with a symlink

Say the directory you want to move has absolute path DIR. A case where it is NOT safe: that directory has either absolute path symlinks to within DIR itself. For instance DIR/link -> /PATH/TO/DIR/...
extremeaxe5's user avatar
  • 1,183
1 vote
0 answers
51 views

Files and directory missing after mv with bash extglob inverse match

Attempted to move all files and directories not ending with .srt to the parent directory by using these commands: shopt -s extglob mv !(*.srt) .. Checked dir contents with ls and everything looked ...
analog's user avatar
  • 11
3 votes
1 answer
174 views

How would the mouse behave in a mirrored environment?

Sorry if it sounds confusing, but this is not a biology inquiry. I'm planning to switch to Linux, but I have a few questions need answered. If a single monitor is mirrored like described in this link, ...
longtry's user avatar
  • 43
0 votes
0 answers
360 views

Copying all files and folders of a directory using tar

I am trying to copy my files from ssd to external hdd using linux live boot. The command I'm writing is: root@ubuntu:/media/ubuntu/4bd92f4b-6b48-4f4a-83ad-9d82d3be488b/home/pegasus# tar cf - Downloads ...
Zeshan Ahmed Nobin's user avatar
1 vote
2 answers
38 views

How to move every three day file based on the filename to respective folders in bash

I have several files like these: 2020.001.00.01.pcc1_TBTZ_TBTZ_1.0-3.0.sac 2020.001.03.04.pcc1_TBTZ_TBTZ_1.0-3.0.sac 2020.002.00.01.pcc1_TBTZ_TBTZ_1.0-3.0.sac 2020.003.00.01.pcc1_TBTZ_TBTZ_1.0-3.0.sac ...
Joana Carvalho's user avatar
0 votes
2 answers
164 views

Command to gather all specified text files, rename them, and copy them to a folder

I have thousands of text files called file.txt. Because they all share the same name I cannot move them to the same folder without them overwriting. I need a command that will locate all of the file....
linuxuser24569's user avatar
4 votes
2 answers
122 views

Moving directories based on their size overall, and then based on the quantity of files within them

I’m trying to clean up all of my music folders (and there are a lot) - but rather than delete, I want to move the ones that are empty, or have only a few Mb, or have just a few files in them. I’ve ...
nodecentral's user avatar
2 votes
2 answers
48 views

Move SPECIFIC 25k FOLDERS to another location

I am a beginner in linux. I am trying to move specific 25k folders from directory containing 90k folders to another location. I have the folder names and tried the following command: cp -r /path/{...
passa's user avatar
  • 21
0 votes
1 answer
111 views

How to move files based on name correspondence with a folder?

I have this parent directory X and these two subdirectories A and B (see Photo 1): Folder A contains files for specific subjects that I want to move to further corresponding folders within Folder B. ...
lotus's user avatar
  • 5
0 votes
0 answers
163 views

in linux, system is slowed very much and CPU 100% when I copy from (non-system-based) usb HDD to another usbHDD. Why?

in linux, system is slowed very much and CPU 100% when I copy from (non-system-based) usb HDD to another usbHDD. Why? My CPU is 100%. I was told that CPU can be 100% without system be slowed down....
Estatistics's user avatar
-1 votes
1 answer
570 views

How can I move terminal cursor by word?

CentOS zsh terminal, the path just typed or copied is very deep, need to change a word in the middle. Ctrl-f or Ctrl-b can move cursor by one character. Is there a way to move cursor by word, like vim?...
Fisher's user avatar
  • 163
1 vote
2 answers
284 views

Moving files based on filename

I have folder with .tif files that I want to move based on their filename to a folder with same name. Example file 123456789_002.tif --> dir 113456789 . How do I get the first part of the file ...
user1555314's user avatar
0 votes
0 answers
121 views

Is there a fast command like tar --remove-files that leaves file chunks in place?

I create hundreds of thousands of files, each several megabytes, resulting in directories (and subdirectories) containing a TB or more. To move the data to another drive, 'cp' tends to slow down over ...
Jerramy's user avatar
0 votes
1 answer
62 views

Remove/move files in a directory with filename timestamp pattern

So I have files that need to remove/move/filter. All files have this pattern like this in a directory, let's say directory frames contain this pattern filename timestamp_in_nanosecond.jpg. And this is ...
Muhammad Ikhwan Perwira's user avatar
1 vote
1 answer
2k views

GIT move files from folder to subfolder

I have the following folder structure. Service | -- App1 | --- bin | --- file1 | --- file2 | --App2 | --- bin | --- file1 | --- file2 | --- file3 | --App3 | --- bin | ...
Confounder's user avatar
1 vote
1 answer
268 views

Move files in subfolders based on the specific rules from a file

I have 1 x big folder that has lots of .txt files I am trying to group these .txt files in separate subfolders based on specific rules from a rules.csv file (on what subfolder they belong to): LARGE ...
Lernisios's user avatar
2 votes
3 answers
16k views

mv: cannot move "File exists"

When trying to move some folder I am getting error: "cannot move File exists" export BACKUP_DIR=/backup mv -f $BACKUP_DIR/scripts $BACKUP_DIR/scripts_old Getting error: mv: cannot move '/...
AndreyS's user avatar
  • 258
1 vote
1 answer
72 views

Organizing files by dates contained within them

I am currently trying to write a script that organizes a list of files into subdirectories by their dates. The dates are contained on the first line of every file in the format YYYY-MM-DD. I have ...
callsign223's user avatar
3 votes
1 answer
2k views

Moving /var onto different disk/partition

I moved the /var directory to a new disk/partition, this part worked well, but I forgot to delete/move the old /var path and it is still using space on / (root) partition. How could I delete the old /...
Leonardo L. Southier's user avatar
0 votes
0 answers
35 views

Lost files while moving. Best strategy for recovery. (yes, I was unwary)

I had moved some files (each between 20 and 200 MiB in sum approx 1 GiB) from an internal HD (ext3) to an external HD (ext3). Usually I do a copy-compare-delete scheme for moving files, but this time ...
Ariser's user avatar
  • 213
-1 votes
2 answers
213 views

How can I move a file to another folder, but only if it hasn't been modified since 10 minutes?

Replace the "10 minutes" with whatever value. Basically I only want to move the file if it's not growing any more. How can I do this on the command-line or a bash script? A solution that is ...
Klangen's user avatar
  • 131
4 votes
2 answers
1k views

Parent child directory same name , move files to parent directory

I need a way to search directories for child directories with the same name and then move all files in the child directory to the parent. Thus from /recup-dir1/recup-dir1/files to /recup-dir1/files. ...
TomDerks's user avatar
0 votes
1 answer
220 views

FreeBSD move folders from a list

I have a .txt file that has a list of folders I would like to move from one directory to another. I have seen many posts on this, but none have worked. Mostly because those are using GNU versions of ...
laxer's user avatar
  • 131
0 votes
1 answer
63 views

Restructure a folder hierarchy

Excuse me if this question has been asked/answered before, but my search has not provided the answer I needed. I have my teaching materials structured as follows: Year/semester/Course/.... Instead of ...
Ufuk YILDIRIM's user avatar
1 vote
1 answer
1k views

Deleted files with WinSCP

I selected some files and wanted to move them to another folder. All I did was this, using WinSCP: Right click, Move to... and all files were deleted. So the last folder had additional *. * in it. I ...
Shibby's user avatar
  • 21
0 votes
1 answer
234 views

Scanning subfolders with BASH Script ${ROOTPATH}/${subdir}

Doing my best to make this work but have little knowledge of scripting. This script should be scanning my specified directory and all subdirs scanning video assets moving any corrupted/errored files ...
Jason Paul Michaels's user avatar
0 votes
5 answers
666 views

Move multiple files to subdirectories in linux

I have a directory structure like this; dir ├── dirA │ └── file1 │ └── subdir └── dirB └── file2 └── subdir I need to move file1 to dirA/subdir and file2 to dirB/subdir. How can I do it ...
083N's user avatar
  • 3
0 votes
1 answer
46 views

How to search subdirectories that has only 1 file inside and move the file up one step to the parent directory

So I have multiple subdirectories in which many of them have only 1 file and the name of the filename is the same as the subdirectory name. DIR A --DIR B ----B.zip --DIR C ----C2.zip ----C3.zip --DIR ...
Griffon's user avatar
1 vote
2 answers
2k views

Move files up one directory

How can I move the entire folder up one level in the directory structure ? Using rsync or mv does not quite work. rsync /var/www/html/wordpress/ /var/www/html/ skipping directory . mv /var/www/html/...
Dakado's user avatar
  • 29
0 votes
1 answer
4k views

Move Files From Root Directory to another users Home Directory

I have downloaded files from another server to root directory called public_html, Now I am looking for move all files and folders from public_html to /home/userb/public_html so I am trying to move it ...
user449001's user avatar
0 votes
1 answer
284 views

Move specific file types in subfolder to destination folder but without loosing subfolder structure

first of all I have very limited knowledge in Linux but I am always trying my best. I also have already automated a lot of things in my Unraid Server and RPi by using Cronjobs and scripts, but now I ...
Daniel's user avatar
  • 1
0 votes
2 answers
415 views

Rename files in any deep subfolder like the parent folder and move after to a central folder

I have a problem where I need to rename just certain files after the parent folder and afterwards move these to a central folder. Is there a way to do this? I would like to run this on a Synology NAS. ...
Lorand G's user avatar
-2 votes
1 answer
267 views

Move every 500 files in new directory [closed]

I have a directory that contains 10,665 jpeg files. I want to move 500 files to a new directory, and 500 to the next directory, etc. The largest files must be moved first: 500-1 contains the 500 ...
Fakhamatia's user avatar
4 votes
1 answer
1k views

Efficiently turn a directory tree into a new filesystem on zfs

I "inherited" management of a system, whose "/opt" (and some other large directory trees) are stored in the root file system. My wish now is to create a new filesystem in the rpool ...
avl42's user avatar
  • 61
0 votes
0 answers
20 views

Move a specific number of files from a folder to another one (by oldest) [duplicate]

I am currently using this shell to move 25 files to another folder automatically. But It moves files by alphabetical order, that's my main concern. I would like the oldest files to be moved first ...
Arno's user avatar
  • 1
0 votes
2 answers
273 views

Move files from one folder to another but only if filename and size are exact match

I would like to move files from one folder to another but only if the destination file already exists and the sizes match. If it's not an exact filename and size match, I want to skip the move. ...
Clayton Tavernier's user avatar
-8 votes
1 answer
1k views

UNIX - Move the file dog from MAMMALS to SHAPE specify using relative path

As I am new to unix, can somebody tell me how to move a file please. I got an error message as missing destination file operand. mv dog/mammals/shape
gracesam's user avatar
1 vote
1 answer
333 views

Moving files with " and * caused error

I'm having trouble with moving files in a bash script. I've been trying different solutions that I've found here, on the same problem, but can't find anything that works.. my last attempt was adding ...
JoBe's user avatar
  • 397
0 votes
1 answer
5k views

Move files with wildcard?

Ohhhh, I've read a few pages and questions, but I just can't comprehend/fully understand it... jdir0="$@" # /home/tor/subbackup/teest2/jjj mv "$jdir0/subs/*.srt" /home/tor/...
JoBe's user avatar
  • 397
1 vote
2 answers
2k views

Why ubuntu uses "move to trash" instead of delete?

Does anyone know why in the GUI of Ubuntu(and perhaps the other Linux distributions as well) use the term "move to trash" instead of delete? I want to know what was the historic event that leads to ...
Bat's user avatar
  • 161
0 votes
0 answers
70 views

How does my shell know when the current working directory has been moved?

If I am in a directory /foo, and I move (from a different session) /foo to /bar. If I then go back to the session in /foo and run ls, the files are still there, and I can see new files if they are ...
retnikt's user avatar
  • 319
1 vote
1 answer
23 views

file disappears while moving because I typed the wrong directory

While moving a file, I typed $ mv aaa.txt directory instead of $ mv aaa.txt ../directory and now I don't know where aaa.txt has gone. How can I find it?
Valentina Ferri's user avatar
0 votes
1 answer
285 views

Move daily backup directories (made by rsync) to another directory in the same partition

I have a daily rsync script backing up my data on an external hard drive at /mnt/X (root of hard drive). I am using --link-dest to use hard links and avoid duplicating data. I need to move all my ...
mohi's user avatar
  • 103