Skip to content
Advertisement

Tag: find

Find filenames with variable number of characters

Using Ubuntu. I have a directory, with some sub directories, which may have some files with names formatted like this: So, they all start with ‘core’. then a process name, then the PID number, which is usually 4 or 5 digits. My Python based tool uses two ‘find’ commands to find them, like this: So, this is essentially calling the

Linux/shell – Remove all (sub)subfolders from a directory except one

I’ve inherited a structure like the below, a result of years of spaghetti code… In reality, this folder is thousands of subfolders large. I only need to keep ./gallery/{number}/full/* (i.e. the full folder and all files within, from each numbered directory within gallery), with everything else no longer required and needs to be deleted. Is it possible to construct a

Change file names by Perl [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 years ago. Improve this question How to change file names from notation like this: SomeCodeFile.extension to C/C++ notation:

bash script – executing find command gives no output

I’m a total noob at bash so this is most likely a syntax error, but I could not find anything that worked for my syntax in my searches. From terminal, running find . -name “*g*” results in However, running this bash script called grepdir.sh from terminal as grepdir.sh . “*g*” results in: meaning that cmd must be empty. But from

How to find newest files with a certain name?

Suppose I have a directory with many files of the same name in subdirectories (for example, comes up when keeping BibTeX files for multiple academic papers). What’s the best way to find the newest version of a file with a given name? I’ve come up with the following command which lists all the files named someFile along with their dates,

crontab not working under arch linux

I tried to set up a schedule to remove the old file and folder after several days. I put the following code in a script file and tried to use crontab to run it every day. The find command worked fine. but the crontab seems not execute the script file. I also use crontab for other tasks, i.e. rsync, they

Advertisement