Questions tagged [exclude]

55 questions
229
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
  • 4,811
  • 3
  • 17
  • 10
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,979
  • 17
  • 47
  • 71
13
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,103
  • 25
  • 82
  • 116
13
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
  • 9,920
  • 23
  • 86
  • 147
9
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
  • 93
  • 1
  • 1
  • 3
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,620
  • 12
  • 50
  • 74
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
  • 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
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
  • 767
  • 1
  • 13
  • 37
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
  • 1
  • 2
  • 7
3
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
  • 357
  • 2
  • 3
  • 9
3
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,620
  • 12
  • 50
  • 74
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
  • 7
2
votes
2 answers

BAT file: Delete all files in directory older than 5 days except one file

I have a directory with many temp files. All files older than 5 days can be deleted except one file 'DoNotDelete.txt'. Therefore I should add an extra argument to my current script: forfiles /p "D:\tmp" /s /d -5 /c "cmd /c del @file : date >= 5…
Jvd
  • 21
  • 3
2
votes
1 answer

Linux Unzip with exclusions from .txt file

I have an unzipping script on Linux. It attempts to unzip with the command: unzip file.zip This is obviously successful. I now wish to exclude some files. The manual tells me of the -x option. I used that and it works also, but only for a single…
Tom
  • 23
  • 4
1
2 3 4