Skip to content
Advertisement

Tag: command-line

Using find to rename files recursively with random chars

I have an IP camera that takes snapshots and nests those snapshots into multiple directories. The sub directories look something like this. There is a ton of sub directories because of the way it stores files since it places those snapshots within a Minute directory of the Date/Hour directories. At any rate, there are other types of files mixed in,

linux find command: exclude path from result

I used the find command to find all python files in a folder, and exlude some folder. find . -type d ( -path ./venv -o -path ./virtualenv -o -path ./lib ) -prune -o -iname ‘*.py’ It’s give the following output: How can I tweak the find command to exclude ./venv in the resultset? Answer If you don’t specify any actions,

I want to extract any text between two symbol

I need to execute the file (a.out) and at the same time, I just need specific parts of the output, not everything. which is either located between these two string [[….]] or ((…..)). and I don’t have any idea where the other text is located (there is no specific pattern) and how the output looks like? for example: if I

Bash script, find command, using wildcards or regex

I am writing a bash script that goes over all files in certain directory and: Picks the files with names that match a specified pattern Sorts them by data and time (date and time are part of the filename) Takes X oldest files Performs certain operations on them The pattern used to match the files is passed to the script

Interleave lines sorted by a column

(Similar to How to interleave lines from two text files but for a single input. Also similar to Sort lines by group and column but interleaving or randomizing versus sorting.) I have a set of systems and tasks in two columns, SYSTEM,TASK: I want to distribute the tasks to each system in a balanced way. The ideal case where each

Advertisement