Is it possible to use any sort of diff utility to diff based on filename only, excluding the file extensions? I have multiple dirs that have various versions of a file, ie media.mov, media.mp4, media.jpg, etc. I want to make sure all versions were made for each file (1000s). So /dir1/media_99.mov and /dir2/media_99.mp4 would yield a TRUE condition. Man diff
Tag: directory
Find and copy specific files by date
I’ve been trying to get a script working to backup some files from one machine to another but have been running into an issue. Basically what I want to do is copy two files, one .log and one (or more) .dmp. Their format is always as follows: something_2022_01_24.log something_2022_01_24.dmp I want to do three things with these files: find the
Looping over the last subdirectory to zip in linux terminal
given the following structure: How do I find & zip the last subdirectory in specific directories? The directory starts with ‘b’ (ex) ‘b1’, ‘b2’ Find the last subdirectory and zip it (ex) ‘b14’, ‘b22’ I want something like: The output has to be: Answer Pipe to tail -1 to get the last line.
Permission denied – Even tho in group with ownership [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
Copy a file from one directory to another in C++
I am writing a C++ program to copy one file from one directory to another. I don’t want to use C++ 17 features. I have already implemented this in the following code. I am on Linux and I want to use the OS cp command to do this. I have written this code. The error is: cp: source: No such
Is there any way in Linux to check if directory tree has changed?
I’m creating a QEMU startup script in which I compile a rootfs to cpio.gz each time I launch the env. This is fine for the moment, but when the rootfs gets bigger in size, it is going to be a problem. Is there any way to check if a given directory structure and a compiled xxx.cpio.gz are different? I mean,
Linux how to remove files in one folder where prefixes don’t match another folder?
I want to remove extra files in one folder where the prefix file names don’t match those in the other. A simple example will show: From folderA I want to remove frame0002.jpg and frame0006.jpg because those frameXXXX prefixes don’t exist in folderB. How can I do this automatically in 1 command line statement? Assume that the frameXXXX format will be
How to find what folder process can’t open
I have an application that is not functioning, because it can’t find or open the folder. But it does not print the folder path. How i can find out what folders it tries to open or locate? Probably folder does not exist, or has wrong permission. But to fix this i need to know what folder application is opening… Answer
Find subdirectory and remove files not containing a specific string LINUX
Given a main path ./class and within class are subdirectories student1,student2,student3…student100. within these subdirectories are other sub-directories history,geography,Math. Each of these subdirectories have hundreds of files in them. I want to KEEP all files that have a string pass in Math ONLY without affecting files in other subjects. So far I can cd to Math and do this: find .
How to skip multiple directories when doing a find
I’ve written a find function that searches for a string in each file in a given path, while skipping a list of directory names that I don’t want searched. I’ve placed this script in my .bashrc file to be called like so: The find portion works great, and it colorizes the search text so that it visually stands out!, but