Skip to main content

Questions tagged [file-management]

Filter by
Sorted by
Tagged with
1 vote
1 answer
71 views

Find files by extension and replacing characters before and after the search pattern

I need to find a files by extensions and replace the random characters before the search pattern to the specified text (REPLACED), turn the numbers after this pattern into an increasing counter and ...
anc's user avatar
  • 11
1 vote
0 answers
416 views

How to Free Up Space on Full overlay and /dev/vda1 Filesystems in a Linux Environment?

I am facing an issue where the overlay and /dev/vda1 filesystems on my server are both completely utilized, showing 100% usage. This scenario has led to operational challenges, and I am seeking advice ...
babel AI's user avatar
0 votes
1 answer
500 views

How can I add custom entries to "Create New" on KDE Plasma?

I'm using KDE Plasma, and frequently need to package file sets into tar.gz or zip. This usually requires opening Ark, creating a new file, and working from there, which is a run-around. It would be ...
Michael Macha's user avatar
0 votes
0 answers
126 views

Shell script to do 'cdo' operation on multiple Netcdf file embedded in multiple folders

I have a directory on my Linux machine, let's name it MYDIR, with a number of folders labeled based on the years (1982, 1983, 1984, ..., 2022). Whithin each sub-folder, there are other folders named ...
Farshid Daryabor's user avatar
0 votes
2 answers
75 views

How can I generate a cumulative plot where I can view the number of files by the last modified date?

I have a large (millions) number of files in a folder, its subfolders and its subsubfolders that were modified over the past 15 years. I'd like to generate a cumulative plot where I can view the ...
Franck Dernoncourt's user avatar
-1 votes
1 answer
364 views

How to rename files in Linux like the ren command in Windows

I need to rename a bunch of files (more than 100) on an Ubuntu system, and want to know how to I do that when the pattern of the files is something like "Filename_01.jpg" to "...
Tornado726's user avatar
4 votes
0 answers
167 views

Cygwin inheritance of Windows's security for cross-account file creation/modificaton?

On a Windows 10 laptop, I have an administrator account Admin, a non-administrator account User.Name, and the default Public account. From either Admin or User.Name accounts, files created in the ~/ ...
user2153235's user avatar
4 votes
3 answers
1k views

Renaming files in Linux using perl scripting

I have a set of files with prefix, say "pre_", on a Linux machine and I just want to rename all of these files by removing that. Here is the perl code I wrote it doesn't throw any errors, ...
Sasi Pavan's user avatar
0 votes
2 answers
200 views

Removing certain numbers from batch of filenames

I have a batch of files that contain the numbers 21 to 29 in the middle of the file name. As I do not want to remove that number for hundreds of files by hand I tried using Terminal: for f in *; do ...
Michael's user avatar
1 vote
1 answer
41 views

Paste files with the same names from directories and subdirectories to another directory

I'm looking for a way to paste files with the same names, contained in directories and subdirectories, to another directory with the same subdirectory structure. For instance : Dir1/a/a/file1 Dir2/a/a/...
Mathias Paicheler's user avatar
1 vote
2 answers
116 views

rename first two periods to hyphens

I have the following command to change periods to hyphens in file names recursively, so long as they have another period both before and after them: find path/to/dir -depth -type f -name '*.*' -exec ...
ItHertz's user avatar
  • 87
1 vote
0 answers
354 views

Whenever I commit and push a file to github, a duplicated ending with ~ appears in my local and remote repository

I am a beginner in Linux and I am still navigating my way aroung the terminal and file manipulation. Whenever I commit and push a file to my github, a duplicate is created alongside it. Can I delete ...
Omari's user avatar
  • 11
0 votes
0 answers
36 views

Is there a useful utility for managing multiple "alternatives" of a given file?

The example I'm going to give here is a simple media file conundrum. In this example, say I have multiple versions of a given audio file: SomeSongLibrary/ awesome-song-compressed.mp3 awesome-...
TheYokai's user avatar
  • 143
1 vote
2 answers
35 views

Number a bunch of files in a serial order with number as prefix

So, I've got 58 files on a Linux machine, with the sort of filenames given below: Theory of Computation (TOC) | Basics of TOC | Lec 1 | GATE Computer Science⧸IT Engineering Exam [7DOPjYGtnTQ].mp4 ...
Ishan Pandey's user avatar
2 votes
1 answer
1k views

Why is `sed '$d' file` not deleting lastlines?

Where to begin to diagnose the problem? I don't even know where to begin to look. I'm practicing string and file wrangling, and I cannot get sed '$d' file.sh to delete the last line of a file; ...
Wolfpack'08's user avatar
0 votes
2 answers
739 views

How can I rename files to have a single quote?

I have multiple files on my Ubuntu system that are spread across web root folder /var/www with broken names: GermanyXXXs-enchanting.... I want to replace XXX with an apostrophe ' to have the ...
isoman's user avatar
  • 101
0 votes
0 answers
17 views

Categorizing Debian Linux VPS

I like to Categorize or Divide one Debian VPS for different Tasks and Testing. For Example two Apache Web Servers with no any connection between both. Something like installing apache2 web server only ...
zakadmin's user avatar
1 vote
1 answer
483 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 ...
Sparatan117's user avatar
2 votes
3 answers
3k 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 ...
mike87's user avatar
  • 71
-1 votes
1 answer
66 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 ...
kan's user avatar
  • 1
1 vote
0 answers
4k 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 ...
polemon's user avatar
  • 11.7k
3 votes
2 answers
951 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 ...
Nicolas Ø's user avatar
2 votes
6 answers
10k 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 ...
Strelok's user avatar
  • 123
2 votes
1 answer
5k 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 ...
Rawley Fowler's user avatar
0 votes
1 answer
398 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 ...
Adrian's user avatar
  • 711
1 vote
1 answer
51 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 ...
kevin41's user avatar
  • 123
1 vote
1 answer
2k 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-...
nath's user avatar
  • 5,924
0 votes
2 answers
677 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 ...
Ekip_DetP's user avatar
0 votes
0 answers
214 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 ...
Stefan's user avatar
  • 17
2 votes
1 answer
123 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 ...
Fraizu's user avatar
  • 55
2 votes
2 answers
2k 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 ...
Phantom's user avatar
  • 143
5 votes
3 answers
2k 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 ...
user236152's user avatar
1 vote
1 answer
463 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....
Shuqi's user avatar
  • 13
1 vote
1 answer
265 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 ...
magmacollaris's user avatar
0 votes
2 answers
468 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 - ...
Sunny's user avatar
  • 25
0 votes
1 answer
279 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--...
Anna1364's user avatar
  • 1,064
0 votes
1 answer
470 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 ...
pleasehelp's user avatar
0 votes
1 answer
176 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 ...
ThatNewGuy's user avatar
0 votes
0 answers
33 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 ...
Tyler Durden's user avatar
  • 5,985
4 votes
4 answers
827 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 ...
John's user avatar
  • 163
22 votes
4 answers
4k 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 ...
Tyler Durden's user avatar
  • 5,985
4 votes
0 answers
255 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 ...
Aidan Walton's user avatar
0 votes
1 answer
375 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 ...
Peeyush Kushwaha's user avatar
1 vote
1 answer
113 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 ...
sjd's user avatar
  • 135
1 vote
2 answers
4k 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/...
sunnykevin's user avatar
1 vote
1 answer
29 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 ...
Weylyn Savan's user avatar
1 vote
0 answers
40 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 "* *" -...
Elysium's user avatar
  • 141
2 votes
1 answer
926 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 ...
arianhf's user avatar
  • 23
2 votes
3 answers
65 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(...
lynxtitan's user avatar
1 vote
3 answers
223 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/
LamaMo's user avatar
  • 223