I would love some help to write a shell script that will return the list of files skipped by my git repository.  There is an example code below  %&gt; bash git_ignore.sh | cat -e .DS_Store$ mywork.c~$   Thank you.
14298
I am getting my feet wet with Git and have the following issue:  My project source tree:  / | +--src/ +----refs/ +----... | +--vendor/ +----...   I have code (currently MEF) in my vendor branch that I will compile there and then move the references into /src/refs which is where the project picks them up from.  My issue is that I have my .gitignore set to ignore *.dll and *.pdb.  I can do a git add -f bar.dll to force the addition of the ignored file which is ok, the problem is I can not figure out to list what files exist that are ignored.  I want to list the ignored files to make sure that I don't forget to add them.  I have read the man page on git ls-files and can not make it work. It seems to me that git ls-files --exclude-standard -i should do what I want.  What am I missing?
2861
I wrote the following script to diff the outputs of two directores with all the same files in them as such:  #!/bin/bash  for file in `find . -name "*.csv"`   do      echo "file = $file";      diff $file /some/other/path/$file;      read char; done   I know there are other ways to achieve this.  Curiously though, this script fails when the files have spaces in them.  How can I deal with this?  Example output of find:  ./zQuery - abc - Do Not Prompt for Date.csv
104573
Even when /tmp has no file called something, searching for it with find will return 0:    $ find /tmp -name something    $ echo $?   0   How can I get a non-zero exit status when find does not find anything?
1451
I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of its name. e.g.,: before: File.h after: file.h I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make git ignore case changes? [edit] I suspect it is Visual Studio doing something weird with that particular file, because it seems to happen most often when I open and save it after changes. I don't have any way to fix bugs in VS however, but git should be a bit more capable I hope.
123071
I have the following in a script  for server in ${servers[@]}; do     echo ${server}     ssh user@${server} "for i in /tmp/foo* ; do echo ${i}; done" done   But it doesn't work. Weird thing, I see $I amount of return lines. So if I have ten files, I see ten blank lines.
83889
I have an older version of Git installed at:  /usr/bin/   I recently downloaded a newer version to:  /usr/local/bin   When I type:  which git   I get the location of the old version. I believe that this is just because /usr/bin/ appears before /usr/local/bin in my $PATH variable and so the older version of git is 'found' first.   To test this, I renamed the older version of git to "git_old". Now when I type:  which git   I get the location of the newer version, as expected. But when I type:  git --version   I get the following error:  -bash: /usr/bin/git: No such file or directory   I'm just wondering why my computer is going back to looking in the old location for Git?
67456
Considering  about the order of execution in the shell as it relates to redirection, and despite the fact that if a file doesn't exist it gets created first so that cat example.txt | shuf &gt; example.txt doesn't complain that the file doesn't exist - which just confirms the order from what I understand - then why is it that about once every thousand times on my system the shuffle works when I do this (backup contains 15 static values each on their line)  for i in $(seq 1 1000); do     cp backup test     echo $i     cat test | shuf &gt; test     cat test done   How can there seemingly be an exception to the ?
30719
Is there any way to exclude commands like rm -rf, svn revert from being getting stored in bash history? Actually I, by mistake, have issued them a number of times even though I have no intent to do, just because I am doing things quickly and it happened. Hence results in lost of lots of work I have did so far.
87790
I am creating a script, which should download latest version of an application from repository and deploy the app.  The main issue: there are several repositories and I need to check, which of them has most recent version.  E.g.  http://repo1/xyz/LATEST -&gt; (redirects to) -&gt; http://repo1/xyz/app-1.0.0.0.zip http://repo2/xyz/LATEST -&gt; (redirects to) -&gt; http://repo1/xyz/app-1.1.0.0.zip   So I need to iterate over available repositories and get only a filename - no need to download obsolette versions of software.
66160
I can run this command from my command line prompt:  cp -r folder/!(exclude-me) ./   To recursively copy all contents of folder except for the subdirectory named exclude-me into the current directory.  This works exactly as intended.  However, I need this to work in a bash script I've written, where I have this:  if [ -d "folder" ]; then   cp -r folder/!(exclude-me) ./   rm -rf folder fi   But when I run the script:  bash my-script.sh   I get this:  my-script.sh: line 30: syntax error near unexpected token `(' my-script.sh: line 30: `  cp -r folder/!(exclude-me) ./'   And I'm at a loss as to why it works from the command prompt, but the exact same line doesn't work in a bash script.
13803
How would I go into listing all directories that do not have a file with a given file name inside? e.g. given this tree  /   /a      README      file001      file002   /b      README      file001   /c      file003   I want to list the directories that do not have a file named README, in this case it would be directory /c. How would I do that? I can't think of any syntax using e.g. find.
100382
I'm having trouble with a bash script I want to make  I know ls will list files that are in a directory but I want it to list directories that are in directory1 but NOT in directory2, and then list files in directory2 that are NOT in directory1.  In a feeble attempt, I tried:  ls -al | diff directory1 directory2   Quickly I realized why it didn't work. Can anyone help out a total bash nerd out?
112660
Having migrated to Linux from Windows, I would like to find an alternative software to Winmerge or rather learn command line tools to compare and sync two folders on Linux. I would be grateful if you could tell me how to do the following tasks on the command line... (I have studied diff and rsync, but I still need some help.)  We have two folders: "/home/user/A" and "/home/user/B"  Folder A is the place where regular files and folders are saved and folder B is a backup folder that serves as a complete mirror of folder A. (Nothing is directly saved or modified by the user in folder B.)  My questions are:   How to list files that exist only in folder B? (E.g. the ones deleted from folder A since the last synchronization.) How to copy files that exist in only folder B back into folder A? How to list files that exist in both folders but have different timestamps or sizes? (The ones that have been modified in folder A since last synronization. I would like to avoid using checksums, because there are tens of thousands of files and it'd make the process too slow.) How to make an exact copy of folder A into folder B? I mean, copy everything from folder A into folder B that exists only in folder A and delete everything from folder B that exists only in folder B, but without touching the files that are the same in both folders.
10983
I have two lists, a complete list and a partial list. I want a bash script that will search the complete list for any lines that are in the partial, if there are, they will be removed from the complete list. Can anyone help?
106924
I am trying to find all directories in a folder recursively while exclude all git submodules  by excluding all path containing .git file. How could I do it?     Explanation:  .git file exists at the root of every submodules folder. This submodule folder could be included anywhere.    Test Case  $ mkdir Test $ cd Test $ mkdir a $ mkdir b $ mkdir c $ cd a $ mkdir .git $ cd .. $ cd b $ touch .git $ cd .. $ cd c $ mkdir c1 $ mkdir c2 $ cd.. $ find . -type d \( \( ! -name . -exec [ -e {}/.git ] \; -prune \) -o \( \( \  -name .git\  -o -name .vscode\  -o -name node_modules\  -o -name Image\  -o -name Rendered\  -o -name iNotebook\  -o -name GeneratedTest\  -o -name GeneratedOutput\   \) -prune \) -o -print \) | sort    Expected Results  . ./a ./c ./c/c1 ./c/c2
55464
How can I see the hidden files in Finder?  For instance, if I have a file named: .something  is is not listed.  Right now I have to open the terminal and type ls -la.
111306
I want to remove certain files using find and -exec. But unlikely bash tells me, that I'm "missing" some argument.   find . -name *.png -exec rm {} /;   what do I miss?  same "missing argument" return for my attempt to rename some files:  find . -name ic_launcher.png -exec mv {} other_name.png /;   Can somebody tell me, what bash does miss, and why this command isn't successful?