Skip to main content

All Questions

Tagged with
1 vote
1 answer
37 views

(standart input) shown instead file name with grep -iHn "ERROR" and a second grep -vH "filter" shows (standard input) and no longer the file name

What I try to do: Find all log files from this day Then grep "ERROR" in the files Then grep -v "Not this line containing the filter" as Filter in result of the first grep command ...
falcon68's user avatar
0 votes
1 answer
31 views

Bash command substitution issues

I'm writing a Python script to parse various logs across different hosts. I can successfully run bash scripts via Python's subprocess module, however, I want to minimize the number of ssh calls, so I'...
OM222O's user avatar
  • 980
-1 votes
3 answers
76 views

Search for all directories that are smaller than 4MB

I want to display all directories that are smaller than 4MB using find command. Already tried find / type d -size -4000000c(same with a dot instead of/`) but both combinations display files too. What ...
Paprotti's user avatar
0 votes
1 answer
50 views

Recursive search and replace a string with dot in text files on Mac

Team, I see there are multiple similar questions but I did try some answers and still not able to get what I want. I want to replace a text as "product-ui-test-creds.json" to "vaulted-...
AhmFM's user avatar
  • 1,744
0 votes
2 answers
137 views

Tar: Cannot stat: No such file or directory

I am trying to make a create a backup bash script from multiple source dir to a different destination dir. So I used find to search for source dir folder name, save it into variable and use it for tar ...
RayAP's user avatar
  • 1
-1 votes
1 answer
81 views

Fix the following command so that it does search the home directory for files names README.md

I am confused on these two answers I got. Question: Fix the following command so that it does search the home directory for files named README.md: find README.md ~ find ~ -type f -name README.md (...
Moses O's user avatar
0 votes
4 answers
119 views

How to get bash find exec to directly execute commands instead of using a temp file? [duplicate]

I've written this BASH script: find ./build/html -name '*.html' \( -exec echo ../emojize_pngorsvg.py \"{}\" \> \"{}.emojized\" \&\& rm \"{}\" \&\& mv \&...
Danny Beckett's user avatar
0 votes
1 answer
40 views

Sort a huge collection of text files

I'm trying to sort a huge collection of text files. They are in various folders. All the files and folders doesn't have spaces in their names. The text files names look like: hsXOAXOMQovq.txt (12 ...
nyctalope's user avatar
0 votes
4 answers
128 views

Find command doesn't work properly for a hidden folder

I have the following directory tree: Inside the "all" folder there are a lot of subfolder, let's call one of them "mainfolder". What I want to do is: to delete all files in the ...
sangul's user avatar
  • 39
0 votes
3 answers
177 views

Bash command to list names of specific directories and subdirectories on Linux

I need a bash command that searches the directory "rawdata" for all subdirectories with names starting with "AB", searches all these for the subdirectory "demo" and ...
Sally's user avatar
  • 91
0 votes
0 answers
44 views

bash: excluding found files located in the subdirs

My script looks for the files of trr extension and then copy it to the target dit, (all_trr) dir=$(pwd) traj_ext='trr' # save the data into: all_trr=${dir}/PCA # refresh PCA folder if [ -d "${...
James Starlight's user avatar
1 vote
3 answers
56 views

Search 32 character long directories only with find

Let say I have a directory with a lot of subdirectories: 04762b39018e3cf4b1a2c6a304919b75 06e0caf156de30dd962cf6b9300aba66 1f1d0cb1b810336299cda5426d0f12f5 2fe7a428eb303da6846800fa20ab7ed4 ...
Darwick's user avatar
  • 428
1 vote
3 answers
234 views

With BASH, 'find' matching files, delete them all, then if one or more was found, do ONE more thing

I want to periodically search for the existence of all files on my system matching a specific name, delete them, and then afterwards if any were found at all, run an additional command. test=1 find /...
Claud's user avatar
  • 999
1 vote
0 answers
29 views

bash: find truncates some paths [duplicate]

I'm using MacOS 13.0.1 and try to find + loop over .mov files to convert them to MP4 using FFMPEG. Many of my path contain spaces and special characters. I found a way of putting things together ...
fweber's user avatar
  • 375
1 vote
1 answer
64 views

Sed replace single text with content of file

I have a question regarding using sed. I have a JSON file and I want to get it inserted in another file. What I'm trying is to get all the contents of the .json file which contains 4500 lines, and ...
Vancho's user avatar
  • 27

15 30 50 per page
1
2 3 4 5
129