Good Tuition Makes Fast Progress with Linux

Got lots of help and advice this evening from my mate who is a bit of a wizard with computers.

This evening I learnt these handy commands:

(find . -type f -name ‘*.htm*’); do
(to find all files within a directory that end in .htm or .hmtl or .htmanything)
tar cvzf ~/mybackup.tar .
(to back up the current directory to the home directory.
cvzf stands for c: create archive, v: verbose, z: use compression, f: use the following filename)
ls ~/mybackup.tar
(to list the contents of the backup)
mv ~/mybackup.tar ~/websites.20070926.tgz
(to move the backup into a directory dated today)
mkdir ~/websitebackups
(to make a new directory in the home directory)
mv ~/*tgz ~/*backups
(to move all directories ending in tgz to the directory ending in backups – in this case, moving the one file we created earlier)

The purpose of all this was to prepare to change the URLs inside all of my web files from absolute to relative. Still not done that part yet.

Oh, I have got as far as changing the permissions across all directories in /var/www/ also, which was simply done by

sudo chmod 755 -R *

Piece of cake.

One last thing was the command;

gksu nautilus
(which opens the file server in su mode, so that files can be copied over using the GUI. I am still a bit wet behind the ears, and like the good old drag and drop files in Linux). I will learn to do it all through the terminal eventually. One thing at a time.

Leave a Reply

Your email address will not be published. Required fields are marked *