You will get a nasty surprise when the number of files increase to more than one xargs
command: Then you will first make a tar file of the first files and then overwrite the same tar file with the rest of the files.
GNU tar
has the --exclude
option which will solve this issue:
tar cvf ~/app.tar --exclude .git --exclude "*.log" .
Related Contents:
- How can I handle spaces in file names when using xargs on find results?
- Is there a grep equivalent for find’s -print0 and xargs’s -0 switches?
- ls: terminated by signal 13 when using xargs
- How to find all files containing specific text (string) on Linux?
- How do I find files that do not contain a given string pattern?
- Make xargs handle filenames that contain spaces
- Fast way of finding lines in one file that are not in another?
- grep without showing path/file:line
- How to concatenate multiple lines of output to one line?
- How can I get `find` to ignore .svn directories?
- Using semicolon (;) vs plus (+) with exec in find
- How can I search for a multiline pattern in a file?
- Find files and tar them (with spaces)
- Notepad++ find in files filter EXCLUDE
- How to display modified date time with ‘find’ command?
- How to use fill_in with find in Capybara (if possible)
- Can I make `find` return non-0 when no matching files are found?
- How to view hidden files using Linux `find` command
- how to find out mac addresses of all machines on network
- How can I use netsh to find a rule using a pattern
- How to Find a file in FreeBSD
- How to find and replace all occurrences of a string recursively in a directory tree? [duplicate]
- Linux find and grep command together
- How to delete many 0 byte files in linux?
- Delete a list of files with find and grep
- find . -type f -exec chmod 644 {} ;
- total size of group of files selected with ‘find’
- Sublime Text: How to jump to file from Find Results using keyboard?
- Get all files modified in last 30 days in a directory
- How to count occurrences of a word in all the files of a directory?
- Python packaging: wheels vs tarball (tar.gz)
- How can I find all files containing specific text (string) on Linux?
- How can I pipe stderr, and not stdout?
- grep a tab in UNIX
- How to only get file name with Linux ‘find’?
- Regex (grep) for multi-line search needed [duplicate]
- Using grep to search for a string that has a dot in it
- MongoDB Show all contents from all collections
- How to get the part of a file after the first line that matches a regular expression
- How to search a specific value in all tables (PostgreSQL)?
- Regex lookahead for ‘not followed by’ in grep
- Show filename and line number in grep output
- Is there a smarter tar or cpio out there for efficiently retrieving a file stored in the archive?
- How do I master the UNIX find command?
- Tar: avoid archiving of files larger than certain size
- gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
- grepping binary files and UTF16
- Always include first line in grep
- How to get last Git tag matching regex criteria
- How do I return only the matching regular expression when I select-string(grep) in PowerShell?