Skip to content
Advertisement

Tag: unix

linux find regex

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

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.

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

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

Advertisement