As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [move]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
35 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
96 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
  • 93
0 votes
0 answers
24 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
35 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
81 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
82 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
45 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
83 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
92 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
344 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
155 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
48 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
39 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
0 votes
1 answer
814 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
196 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
0 votes
3 answers
9k 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
  • 218
1 vote
1 answer
60 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
2 votes
1 answer
1k 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
  • 203
-1 votes
2 answers
122 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
790 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
171 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
  • 121
0 votes
1 answer
55 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
745 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
171 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
533 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
45 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
0 votes
2 answers
890 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
  • 19
0 votes
1 answer
3k 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
227 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
217 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
223 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
3 votes
1 answer
644 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
  • 41
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
221 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
237 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
  • 377
0 votes
1 answer
3k 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
  • 377
1 vote
2 answers
1k 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
  • 151
0 votes
0 answers
37 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
22 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
208 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
1 vote
2 answers
92 views

How to verify that files in A folder are also in B folder

I use my synology DS1515+ and DSM 6.2.2. First of all, please refer to the picture as below; First, I download some video files. Examples of filenames are as above. And second step is that copying ...
FBMan's user avatar
  • 53
0 votes
2 answers
1k views

Copy a file containing date in the file name to a folder for that date

I looked for similar questions, but it was hard to get a clear answer in my case. I use my synology DS1515+ and DSM 6.2.2. First of all, I have been made daily folder containing a date using script ...
FBMan's user avatar
  • 53
2 votes
3 answers
328 views

Copy a file containing a date in the file name to a folder for that date

I'm newbie in stack overflow. I need your help. Thank you for your reply in advance. I looked for similar questions, but it was hard to get a clear answer in my case. I use my synology DS1515+ and ...
FBMan's user avatar
  • 53
1 vote
2 answers
122 views

Organize directory b and its subdirectories files equal as directory a without copying or moving from directory a

I'm looking for some way to organize the files contained in directory b to make its structure equal to that of directory a (which contains the same files as b, just arranged in a different way), ...
Ronald71's user avatar
  • 302
2 votes
4 answers
1k views

How to move all files with names starting with a string from a list?

I have a file strings.txt with a list of strings: GCA_001677475.1 GCA_003410275.1 GCA_002310615.1 GCA_000007405.1 GCA_000219515.3 And I have many files in a directory with names like: GCA_000005845....
Some student's user avatar
0 votes
1 answer
193 views

Sort files based on similarity of file names

I have a directory structure which contains many files. I want to find similar files recursively and sort them based on their names. The easy part: find all files named f*.ext and move them to a ...
richard's user avatar
0 votes
1 answer
66 views

Ask what to do when dragging & dropping a file in file managers other than Dolphin

Dolphin file manager is showing a list of options when dragging & dropping a file (copy/move/create link). Can the same options be made available in other file managers?
cipricus's user avatar
  • 1,276
0 votes
1 answer
1k views

Flattening directory and renaming files incrementally (MacOS)

Looking to flatten the directory (with duplicate child file names) while renaming all files, keeping duplicates OR appending all file names with an incrementing number (incrementing # + name would be ...
jah6719's user avatar
  • 43