Questions tagged [move]
The move tag has no usage guidance.
153 questions
2
votes
1
answer
110
views
removing hidden control characters in filenames
I have a huge number of files spread across a large directory structure that have hidden control characters in their names. ls lists them as, e.g.:
'614.7-4-F1-00-090-007-RozvadØ'$'\302\237'' RP1-...
1
vote
3
answers
305
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
...
5
votes
2
answers
460
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 ...
1
vote
2
answers
68
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 ...
0
votes
1
answer
133
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 ...
-2
votes
1
answer
217
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 ...
0
votes
5
answers
118
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 ...
1
vote
1
answer
282
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 ...
1
vote
0
answers
42
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/...
1
vote
0
answers
64
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 ...
3
votes
1
answer
208
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, ...
0
votes
0
answers
665
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 ...
1
vote
2
answers
40
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
...
0
votes
2
answers
181
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....
4
votes
2
answers
136
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 ...
2
votes
2
answers
49
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/{...
0
votes
1
answer
119
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. ...
0
votes
0
answers
196
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....
-1
votes
1
answer
753
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?...
1
vote
2
answers
318
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 ...
0
votes
0
answers
148
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 ...
0
votes
1
answer
65
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 ...
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
|
...
1
vote
1
answer
324
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 ...
2
votes
3
answers
19k
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 '/...
1
vote
1
answer
77
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 ...
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 /...
0
votes
0
answers
40
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 ...
-1
votes
2
answers
251
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 ...
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.
...
0
votes
1
answer
243
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 ...
0
votes
1
answer
77
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 ...
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 ...
0
votes
1
answer
274
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 ...
0
votes
5
answers
685
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 ...
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 ...
1
vote
2
answers
3k
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/...
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 ...
0
votes
1
answer
301
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 ...
0
votes
2
answers
481
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.
...
-2
votes
1
answer
277
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 ...
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 ...
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 ...
0
votes
2
answers
286
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. ...
-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
1
vote
1
answer
382
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 ...
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/...
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 ...
0
votes
0
answers
78
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 ...
1
vote
1
answer
29
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?