Questions tagged [file-management]
The file-management tag has no usage guidance.
89
questions
1
vote
1
answer
24
views
How to sync two folders with the same file names but different extensions
Is there a means of using rsync to sync two folders?
I would like to shoot photos in JPG and RAW. Since viewing JPGs is much quicker than opening up RAWs, I'd like to do culling in the JPG folder and ...
2
votes
3
answers
404
views
Script to remove specific strings in file name
I am trying to come up with a bash script to remove parts of a file name on CentOS. My file names are:
119903_Relinked_new_3075_FileNote_07_02_2009_JHughes_loaMeetingAndSupport_FN_205.doc
...
-1
votes
1
answer
49
views
arranging files in a folder according to another folder
I've 2 folders. Folder 1 has some files arranged in some sub folders. Folder 2 has same-filenamed-files (but different size) but not arranged in any sub folder. I want to arrange folder 2 files like ...
1
vote
0
answers
66
views
MEGAsync with mega-cmd: How can I initiate syncing from command line?
I'm using MEGAsync from mega.nz.
Recently, I've encountered a bunch of problems with the syncing software. One of those problems, was that it seems to have trouble syncing (or scanning?) files that ...
3
votes
2
answers
101
views
Rename file with the rename tool - moving around square brackets
Rookie question. Following this answer Move last part of filename to front, I'm trying to do the same, except all files in my case contains square brackets.
What I want is to move the title to the ...
2
votes
5
answers
496
views
Renaming files using regex
I have a number of files in a folder on a Linux machine with the following names:
11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35
I would like to use regex in order to rename with the .inp ...
0
votes
0
answers
15
views
General purpose file filtering tool
Lots of different applications have standards for generating sets of files, with files to be included or excluded specified in a separate text file. Git has .gitignore, Rsync has .rsync-filter, Plex ...
1
vote
1
answer
178
views
Error: "failed to preserve ownership" when trying to move files to a FAT32 partition on OpenBSD
I'm following a tutorial on how to install firmware on OpenBSD. The tutorial has me creating a new msdos file system on the usb with: newfs_msdos -F 32 /dev/rsd2c then to take usb to a system with an ...
0
votes
1
answer
41
views
Why existing file is not found with find with `pwd` but is found with find dot?
This is weird:
$ ls -l 'Lana Del Rey - Blue Jeans (Remastered 2011).mp3'
-rw-rw-r-- 1 gigi gigi 4.0M Dec 11 23:06 'Lana Del Rey - Blue Jeans (Remastered 2011).mp3'
$ find . -name 'Lana Del Rey - Blue ...
1
vote
1
answer
37
views
Find a file by pattern but ignore others with similar patterns
I have a directory that has subdirectories in it and I need to get the names of some of these subdirectories but there is one with a similar pattern as them that I want to ignore.
For example, if the ...
0
votes
0
answers
19
views
Caja: How to paste into the current directory?
It seems that when a sub-directory has been selected, and if I execute pasting, the entities are copied into that sub-directory. The directory I had the problem had no files but sub-directories, and ...
1
vote
1
answer
169
views
Git - how to add/link subfolders into one git-repository directory
Assuming I have a file structure like this:
├── Project-1/
│ ├── files/
│ └── special-files/
├── Project-2/
│ ├── files/
│ └── special-files/
└── Project-3/
├── files/
└── special-...
0
votes
2
answers
92
views
How to remove unknown characters from a folder name?
I have a Debian 10 machine which is used as a Share server (Samba Server).
I go on my Mac, I create a folder Document.1 in the shared folder.
When I go to my Linux Debian machine, I find myself with ...
0
votes
0
answers
74
views
remove all files and folders not listed in file
I am looking into a way of deleting all files and folders recursively in the current working directory that are not listed in files2keep.txt. I am using Linux.
The text file can be quite large, up to ...
2
votes
1
answer
39
views
How can I move files to different directories depending on their contents?
I have many files which contain a string like this:
/databis/defontis/Dossier_fasta_chrm_avec_piler/SRR6237661_chrm.fasta: N putative CRISPR arrays found
Where the N is a number that can be either 0 ...
2
votes
2
answers
422
views
Shell-/Bash-Script to delete old backup files by name and specific pattern
every our backup files of a database are created. The files are named like this:
prod20210528_1200.sql.gz
pattern: prod`date +\%Y%m%d_%H%M`
The pattern could be adjusted if needed.
I would like to ...
5
votes
3
answers
619
views
Concatenate files using a specific order based on another file
I would like to concatenate multiple files following a specific order from an other file.
I have multiple files called freq_<something> that I want to concatenate.
The "something" are ...
1
vote
1
answer
127
views
Use For loop to extract certain columns from a series of files to write new tab-delimited files
I have a series of files located in a series of folder, for example:
~/BR2_1-3/bin.1.permissive.tsv
~/BR2_1-3/bin.2.permissive.tsv
~/BR2_1-3/bin.3.orig.tsv
~/BR2_2-4/bin.1.strict.tsv
~/BR2_2-4/bin.2....
0
votes
1
answer
64
views
How can retrieve a list of the 10 least recently accessed files on a Unix system?
Is there a command on Unix systems which checks the "last accessed" date of every file on the system (or, better yet, recursively from the directory the command is run from) and then prints ...
0
votes
2
answers
62
views
How do I split and name the text file (based on the no. of lines of content) for bigdata?
I had a 1000's of text files on a Linux machine, and each text file's name has a prefix (OG00*) and contains 9 unique IDs. I want to create one text file for each of these IDs with text file names - ...
0
votes
1
answer
40
views
moving files into different directories based on their names matching with another file
I have a folder with ~6000 files (some of the are .txt and some .pdf files) and I am trying to organize them in different folders. folder looks like this:
$ ls ./res-defaults
ML3020T1--...
0
votes
1
answer
72
views
How to change the extension of all files from a directory?
I am using Linux and I want to write a shell script that takes two directories and moves the second directory in the first one (so the second directory becomes a subdirectory of the first one) and all ...
0
votes
1
answer
49
views
Can multiple operating systems share profiles and programs?
I'm new to Linux and trying multiple variants of Ubuntu (standard, Mint, Pop, etc.). Unfortunately, every OS is isolated on different partitions, with separate settings, user groups, etc. and programs ...
0
votes
0
answers
23
views
How to solve the add/delete problem when rsyncing?
I work on two different computers and want to keep certain directories synced between the computers. For example, I have a ~/scripts folder that has a lot of commonly used scripts in it. If I make a ...
2
votes
3
answers
145
views
Removing multiple files with same prefix (argument list too long)
I've tried using answers given on here, and it doesn't seem to be working. Below are the commands I tried to remove all files with the index.php prefix in this directory on my CentOS system. The first ...
21
votes
4
answers
3k
views
Where should small utility programs store their preferences?
I have several utility programs that do not have their own directory and are just a single executable. Typically I put the binary in /usr/local/bin. A problem I have is how to manage preference ...
1
vote
0
answers
36
views
RAM based file system that overflows to physical disk and maintains maximum I/O performance
I have an issue that seems to hit all the restrictions I have read about regarding tmpfs. I would be very happy to hear anyone's comments on a possible solution.
I have an application that generates a ...
0
votes
1
answer
191
views
"cut" and "paste" functionality when using multiple terminals instead of "mv"
If I have two terminals in different working directories, and I want to move a file from the PWD of one terminal to PWD of the other without using mv (because mv requires me to type out at least one ...
1
vote
1
answer
58
views
move one file from /a/b/c/d.txt to /x/a/b/c/d.txt , Create full tree if not exist [duplicate]
I am traversing through directories and moving old files to a different location.
For eg. a file located in path /a/b/c/d.txt I want to move to /x/a/b/c/d.txt without errors.
Is it possible in a ...
0
votes
2
answers
324
views
How to rename files with the name of their parent directory?
I'd like to rename the recon.text file with its directory name. I have 1000 directories. Some help, please?
7_S4_R1_001_tri10_sha/recon.text
8_S1_R1_001_tri15_sha/recon.text
9_S8_R1_001_tri20_sha/...
1
vote
1
answer
28
views
Accessing certain locations on a home server, hangs/times out. How can I find the cause and fix it? [closed]
Accessing these locations from Windows times out or. in worse case, hangs until restarting smbd. Accessing them via SSH hangs until the connection is closed. I forcefully checked the RAID5 array where ...
1
vote
0
answers
27
views
How can I batch rename subdirectories and files in order to replace whitespaces with underscores?
I am using Ubuntu and Arch-based OSs and I have tons of files that I have to rename. I have used this so far.
allfiles=$(find ./ -type f -name "*:*")
echo $allfiles
find ./ -depth -name "* *" -...
2
votes
1
answer
238
views
Using wget to download files to specific folders based on file extension
I want to download .jpg/.png/.tiff files into my ~/Pictures/ folder, .mkv/.avi/.mp4 in my ~/Videos folder etc.
Is there anyway to do this?
the only solution I could come up with was using different ...
2
votes
3
answers
49
views
Messed up Folder structure. Is there a way to delete the empty subfolders except one?
After trying to reorganize my movie folder on my Debian machine, I ended up with a structure like this:
├── Universal.Love(2017)(1080p)
│ └── Universal.Love(2017)(1080p)
│ └── Universal.Love(...
1
vote
3
answers
214
views
Delete set of folders contain more than one '-' in different places as a part of their name
How can I delete many folders that have more than one - in their names?
For example:
e97bf913-5759-4fff-bdaf-2f931b53a432/
39f953c5-dab0-420e-a650-a50a30f48097/
0
votes
1
answer
24
views
Can I launch "window/icon" manager in specific directory in xfce
I use xfce an I am organizing my playlist folder and I would like to have some nice interface to do it. I was thinking about some 2D file manager or launching "window/icon" manager in some specific ...
-1
votes
2
answers
253
views
Use substrings of filename as parameters in for loop that builds aws command
I'm trying to upload all files in a directory to s3 using dates in the filenames as parameters to create the s3 locations. Here's what I have so far.
for file in /home/ec2-user/clickparts/t*; do
...
0
votes
2
answers
57
views
Removing a single character from the beginning of file names
File names :
_10_-_Overriding_or_customizing_the_rest_end_point-rkkfgI502f0.mp4
_11_-_Expose_ids_in_json_response-CrDXtLfiZos.mp4
_12_-_Create_angular_8_project_using_Angular_CLI-kSXkW1hF0KU.mp4
_13_-...
-2
votes
1
answer
2k
views
How can I figure out which is my file manager system? [duplicate]
Is there any command I can use to understand which is the file manager installed in a machine?
For instance, I'm using Linux Mint and I can use the command nemo. Now I'm connected to another machine ...
1
vote
1
answer
19
views
Mass renaming files that have patern sql_^d^_migration.sql
I have the following list of files on an Ubuntu system:
sql_1_migration.sql
sql_2_migration.sql
sql_3_migration.sql
...
sql_100_migration.sql
sql_1000_migration.sql
...
And I need to rename it ...
6
votes
1
answer
3k
views
Git - handle symlink as if it was a file
Is there a way to make git handle a symlink as if it was a file. If I just normally add a symlink like git add symlink, git just stores/controlls the path to the file, not the linked file.
Is it ...
0
votes
1
answer
485
views
copying a symlink to a target file using cp -t
I have a symlink to a file on my Ubuntu system, and I need to copy the original file to a different directory and have a new name there. I am able to copy it to a different directory using
readlink -...
3
votes
2
answers
2k
views
How to rename files with same name as parent folder
I have a folder called movies on my Ubuntu, which contains many subfolders.
Each subfolder contains 1 mp4 file and may contain other files (jpg, srt).
Each subfolder has the same title format:
My ...
1
vote
0
answers
90
views
Git - extract subfolders of repository into new repositories
I have a folder structure like this, with all folders and files within one git repository:
├── folder-01
│ └── script.sh
├── folder-02
│ └── script.sh
├── folder-03
│ └── script.sh
├── folder-...
7
votes
2
answers
4k
views
how to speed up tar, just build a package without compression
I have a large folder, 2TB, with 1000000 files on a Linux machine. I want to build a package with tar. I do not care about the size of the tar file, so I do not need to compress the data. How can I ...
1
vote
2
answers
80
views
Want to rename a files in folder with folder_1.txt folder_2.txt folder_n.txt name
I have 3 directories on my Ubuntu machine, named abc, xyz and pst. In each directory, I have approximately 7 files with different names. I want to rename each file like abc_1.txt, abc_2.txt, abc_3.txt,...
0
votes
2
answers
64
views
same files from different directories
How to list and compare the similar files from different directories using single command on Linux?
Let's suppose there are three files a, b and c in directory /home/test and a, d, c files in another ...
1
vote
1
answer
416
views
How to rename files with sequential names to an another sequence using Terminal?
I have a directory that has files in it that are named 'o1.ray' to 'o293.ray'. I want to move them to an another directory while renaming them 'o132.ray' to 'o424.ray'.
How can I do this in the ...
0
votes
1
answer
30
views
File popups freeze in specific directory and show nothing - how to fix?
I had this issue for months. Whenever I moved to my home directory within a file popup (from both qt and gtk), the window freezed and I could neither close it nor move to another directory. I just had ...
2
votes
1
answer
395
views
Move command to transfer all files in a subfolder to parent directory and rename if there are files with same name
So I have a directory that has 77 subfolders in it on my Ubuntu machine, each with various amounts of torrent files in them. Total of 427 torrents are contained in the subfolders. I want to move all ...