Questions tagged [exclude]
61 questions
275
votes
9 answers
Unix zip directory but excluded specific subdirectories (and everything within them)
I'm trying to zip a directory (on Unix via SSH) but I need to exclude a couple of subdirectories (and all files and directories within them).
So far I have this:
zip -r myarchive.zip dir1 -x dir1/ignoreDir/**/*
That doesn't seem to work though.
I…
sulman
- 5,681
17
votes
3 answers
7zip: How to exclude files (not file types) using an exclude list file?
I know you can create a text file containing a list of files and then tell 7zip to reference this file so that it can exclude them from the archive, but I cannot find the syntax for that. Can someone help?
oscilatingcretin
- 5,493
15
votes
2 answers
tar - exclude certain files
I wish to tar all files in a directory and its subdirectories that do NOT end in .jpg, .bmp, .gif, or png.
So, given the following folders and files:
foo/file.txt
foo/file.gif
foo/bar/file
foo/bar/image.jpg
I want to tar only the files file.txt and…
Alan
- 153
15
votes
5 answers
When running `rm -rf`, is it possible to exclude certain subdirectories?
I routinely use bind mounts to aid in making space available in multiple locations without having to have multiple logical volumes / physical partitions / LUNs, etc.
For example, I may have a 200G LV mounted at /space. From there, I will make…
warren
- 10,322
13
votes
1 answer
How to prevent ST2 from searching in excluded folders?
I've got a sublime-project like this:
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": ["_doc", "cache", "logs", "_release"],
"file_exclude_patterns": ["*.sublime-workspace"]
}
]
}
In…
laurent
- 5,774
5
votes
1 answer
Why doesn't WinMerge filter .git folders although the FileFilter is in effect?
When comparing git repo clones, I am annoyed by the appearance of the .git folder and its contents in the directory compare tab.
In the Tools -> Filters... dialog, I have the Exclude Source Control filter in the FileFilters list. Examining this…
ysap
- 2,730
5
votes
1 answer
Excluding a folder from the home directory with rsync exclude list
I am trying to set up rsync for OS X 10.8.4 using an exclude file. However, it does not recognize the paths I want to exclude.
I want to copy the user ABC's home directory to a folder called Backup_Mac on a mounted external drive.
rsync -av…
Alex
- 53
- 1
- 1
- 3
5
votes
3 answers
Shell command to find files containing one word but not the second word
All
I have the below two files in my linux machine and I wanted to find out file which contains "word1" and doesn't contain "word99"
file1.txt
word1
word2
word3
word4
word5
file2.txt
word1
word2
word3
word99
I have been using the…
4
votes
2 answers
How do delete *.jpg files from an already existing Archive?
I have at least 40 archive files, 100 MB each, which also includes many .jpg files within.
How I can delete the .jpg files from these archives easily?
To be more exact, I am looking for a way to delete all these fields directly from the archived…
GorovDude
- 367
4
votes
5 answers
How do I exclude directories from my Windows 7 backup?
I'm setting up a backup for a friend's computer onto his USB drive. I was reading this article about the Windows 7 Backup and Restore feature.
Everything looks okay, but for the life of me, I can't figure out how to get to this screen.
I need to…
Matt Alexander
- 807
4
votes
1 answer
How to compare folders but ignore certain subfolders in WinMerge?
I'm used to compare folders using WinMerge (2.16.6.0) and more and more often I need to compare folders but to ignore certain sub-folders (like node_modules, allure-results etc.)... how can I do that?
As suggested here, I'd tried adding…
radui
- 425
4
votes
2 answers
How to exclude folders from WinDirStat scan?
During the lifetime of a typical computer, many folders are static in their contents. For example, a program like Matlab, loaded with some toolboxes, is installed once and seldom changes ever after. It takes a large amount of disk space, but more…
ysap
- 2,730
4
votes
3 answers
XCOPY /Exclude Directory Syntax
I'm trying to use XCOPY to copy a directory that looks like this:
-MainFolder
-ManyFoldersIWantToCopy
-ManyFoldersIWantToCopy
-...
-Source Code
I want to use the /EXCLUDE option to copy every folder except Source Code.
I tried using the…
Onion-Knight
- 213
3
votes
3 answers
grep multiple exclude extension
I find single exclude extension like
grep --exclude "*.js" "a" *
How do I write multiple exclude masks?
I have tried the code below, but it doesn't work:
grep -r --exclude=*.\{html,htm,js} "li" *
grep -R -E '(\.js|rb)' "create" *
3
votes
1 answer
Tar: Exclude certain extensions in subfolders
I have a folder which includes subfolders which in turn have subfolders as well. I tried:
tar --exclude='*.msh' --exclude='*.geo' -czvf cont.gz run-1/*
to compress all files and subfolders in run-1 but the files with msh and geo extensions. But tar…
Shibli
- 133