danielhpavey.uk

A sorta, kinda, web development and design blog...

Posts tagged #terminal:

Set User and Group Permissions Correctly in Linux (Ubuntu)

Monday 20 November 2017

Set User and Group Permissions Correctly in Linux (Ubuntu) I often struggle to get the file permissions set up correctly in Linux, especially in a web server setup. However I think I've finally stumbled upon the magic incantations to make it all work... Set the group / owner of a directory recursively: chown -R

Tags: #web dev #ubuntu #terminal

Recursively count all the files in a directory

Friday 27 November 2015

Recursively count all the files in a directory Every now and then I need to do this... so this is here for reference... find . -type f | wc -l linux - Recursively count all the files in a directory

Tags: #terminal

A Couple of Tips for Using PHP at the Command Line

Tuesday 21 April 2015

A Couple of Tips for Using PHP at the Command Line On vary rare occasion I find it useful to run php in the command line. There are a couple of easy ways to do this, but the first thing you might want to do is check your php version. This is easily…

Tags: #php #web development #terminal #commandline

How to get Octal File Permissions from the Command Line

Monday 19 November 2012

How to get Octal File Permissions from the Command Line Just putting this here as a note for myself. File permissions in Linux can be displayed in octal format using Linux stat command. stat -c '%A %a %n' * %A Access rights in human readable form %a Access rights in octal %n File name How

Tags: #mac #terminal #command line

Batch Rename File Extensions in Terminal for Mac

Monday 17 September 2012

Batch Rename File Extensions in Terminal for Mac for f in *.JPG; do base='basename $f .JPG'; mv $f $base.jpg; done https://discussions.apple.com/thread/1667375?start=0&tstart=0

Tags: #mac #apple #terminal

Open all Changed and Unstaged Files from Git in Vim

Monday 6 November 2017

Open all Changed and Unstaged Files from Git in Vim function vdiff(){     vim $(git ls-files --others --exclude-standard && git diff --name-only) ) }

Tags: #vim #web development #git #terminal #alias