Skip to main content

All Questions

Tagged with
1 vote
2 answers
49 views

`find` behaves unintuitively when pruning directories

I have few files under the current directory, ./a.txt ./b.txt ./dir1/c.txt ./dir1/d.txt When I execute find . -path './dir1' -prune -o -name "*.txt", as expected, it excludes everything ...
nabik's user avatar
  • 25
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
1 vote
1 answer
54 views

Delete folders and contents that doesn't match a particular string

I am using Radarr which renames my movies directory with the following format: Argo (2012) Arrival (2016) A Scanner Darkly (2006) So every directory ends with ' (????)' but I'm not sure how to create ...
davekrappin's user avatar
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
1 answer
52 views

how to run find command on shell to get a part of the pathfile into variable?

I'm trying to get content of files spread on specific folder. find /tmp -name '*.txt' This give me: /tmp/s3400/10.txt /tmp/s3544/1212.txt I need to store "s3400" value on a variable to run ...
JaTamez's user avatar
  • 11
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
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
0 votes
2 answers
120 views

How do I find (using bash) the top-level file with a particular name within a directory path?

I have a bash script that runs mysql scripts and that takes the mysql database name from a file rather than having me type in it as an option (so that I won't mistakenly type in the wrong one). I set ...
Rich P's user avatar
  • 21
1 vote
1 answer
51 views

Why find command doesn't pass all file as input to the -exec parameter?

There are all the files and symbolic links in the directory: ./02.tdf/IP_B186.tdf ./02.tdf/In_B186.tdf ./03.bed/IP_B186_vs_In_B186_peaks.xls.promoter_peak.bed ./03.bed/IP_B186_vs_In_B186_peaks.xls.bed ...
ManJi's user avatar
  • 13
1 vote
1 answer
90 views

Using find to pass multiple files to awk and redirect result into one output file

I have an awk script that processes files passed in. It runs on one input file and redirects into one output file... awk -f solar.awk ./PerformanceData_2023-08-02_02-02-17/tmp_YdayData.txt > output....
MaxG's user avatar
  • 217
0 votes
1 answer
54 views

Using find to process folder names (containing whitespace and ') for a bash script fails

Using bash version 5.* I created a script that creates a script that will play video and/or audio files in the given folder, the created playing-multimedia-files script using this function ffprobe -...
Rava's user avatar
  • 61
2 votes
1 answer
867 views

Using printf in "find" command

With the following command, I want to find a specific file name, print its name and then compress it in-place with bzip2 command. The compression works but file name is not printed. $ find . -name *....
mahmood's user avatar
  • 24.3k
0 votes
0 answers
53 views

pass arguments to gnome-terminal from find -exec command

i a file call "runAllBestScripts.sh". That file has this command: find ~ -maxdepth 1 -type f \( -name 'best*' -a -not -name 'buns*.sh' \) -exec gnome-terminal --tab --title="Build {}&...
thugmunch's user avatar
  • 133

15 30 50 per page
1
2 3 4 5
55