I’m having trouble using the regex of the find command. Probably something I don’t understand about escaping on the command line. Why are these not the same? Bash, Ubuntu Answer Regular expressions with character classes (e.g. [[:digit:]]) are not supported in the default regular expression syntax used by find. You need to specify a different regex type such as posix-extended
Tag: unix
Given two directory trees, how can I find out which files differ by content? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
What is the difference between “source script.sh” and “./script.sh”?
What is the difference between source <script> and ./<script>? Answer source script.sh runs the script within the current process, thus all variable assignments are preserved as variables even after the script finishes (and don’t have to be explicitly export’d). ./script.sh just runs the script in a subprocess, and any variables which are assigned disappear after the script is done.
How do you set your pythonpath in an already-created virtualenv?
What file do I edit, and how? I created a virtual environment. Answer The most elegant solution to this problem is here. Original answer remains, but this is a messy solution: If you want to change the PYTHONPATH used in a virtualenv, you can add the following line to your virtualenv’s bin/activate file: This way, the new PYTHONPATH will be
Rename JPG files according to date created
I want to rename all files in a certain directory. Renaming them to their date of creation. So if my file is Image1.jpg, it should rename into something like “Jan 16 12:09:42 2011.jpg” I want to do this through command line. I’ve been trying: But how can I combine this with mv command? And how will I iterate stat and
How do you find the original user through multiple sudo and su commands?
When running a script via sudo or su I want to get the original user. This should happen regardless of multiple sudo or su runs inside of each other and specifically sudo su -. Answer Results: Use who am i | awk ‘{print $1}’ OR logname as no other methods are guaranteed. Logged in as self: Normal sudo: sudo su
Why is this MYSQL statement giving me an error?
The file is there. I even pasted the path into the mysql console. The permissions are correct. In fact, I even tested it on root user and root mysql. Answer Note that when you do LOAD DATA INFILE, MySQL is looking for that file on the server – not on your client machine. If you want to use LOAD DATA
MySQL the command line and pagers
I cant find anything about this from searching here. I use mysql on the command line at work and I work with fairly large tables so I set the mysql pager allowing a more readable result if I run a query, that returns 1000’s of results. I use the command below to set the pager. This suits my needs but
what is the ‘what’ command on AIX under LINUX
I am used to use what to find out some version string in my program, which is normal defined as a string in the c++ code, starting with “@(#)”. Now I cannot find it in Linux. Can anyone tell me what I am supposed to do? Thanks a lot! Answer The what command is part of the Source Code Control
How can I format my grep output to show line numbers at the end of the line, and also the hit count?
I’m using grep to match string in a file. Here is an example file: grep -i null myfile.txt returns How can I return matched lines together with their line numbers like this: I know -c returns total matched lines, but I don’t how to format it properly to add total null count in front, and I don’t know how to