Questions

How to find all files containing specific text (string) on Linux?

How do I find all files containing a specific string of text within their file contents? The following doesn't work. It seems to display every single file in the system. ``` find / -type f -exec grep ...

27 Sep at 12:52

How do I check whether a file exists without exceptions?

How do I check whether a file exists or not, without using the [try](https://docs.python.org/3.6/reference/compound_stmts.html#try) statement?

27 Mar at 19:42

How do I merge two dictionaries in a single expression in Python?

I want to merge two dictionaries into a new dictionary. ``` x = {'a': 1, 'b': 2} y = {'b': 3, 'c': 4} z = merge(x, y) >>> z {'a': 1, 'b': 3, 'c': 4} ``` Whenever a key `k` is present in both diction...

12 Feb at 07:3

Move the most recent commit(s) to a new branch with Git

How do I move my recent commits on master to a new branch, and reset master to before those commits were made? e.g. From this: ``` master A - B - C - D - E ``` To this: ``` newbranch C - D - E ...

How do I get the directory where a Bash script is located from within the script itself?

How do I get the path of the directory in which a [Bash](http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) script is located, that script? I want to use a Bash script as a launcher for another appl...

24 Jul at 23:51

How to disable text selection highlighting

For anchors that act like buttons (for example, the buttons on the sidebar of this Stack Overflow page titled , , and ) or tabs, is there a CSS standard way to disable the highlighting effect if the u...

How do I execute a program or call a system command?

How do I call an external command within Python as if I had typed it in a shell or command prompt?

How do I change the URI (URL) for a remote Git repository?

I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved "origin" to a NAS and successfully tested cloning it from here. I would like to know if I can change the URI of "ori...

24 Aug at 19:29

Which equals operator (== vs ===) should be used in JavaScript comparisons?

I'm using [JSLint](http://en.wikipedia.org/wiki/JSLint) to go through JavaScript, and it's returning many suggestions to replace `==` (two equals signs) with `===` (three equals signs) when doing thin...