Coding

I have to clean this up.

  • coding
  • php
  • sql
  • webhosts
  • joomla tips. 

This section is a reflection of my coding skills -- cut and paste, and hastily thrown together. Most of this is copied from other sites -- just so I have fast reference here.
If it belongs to you - sorry. Let me know. Though most has attribution. ;-)

This is all you need.

find . -name "foo*"

find needs a starting point, and the . (dot) points to the current directory.

Condition flow

\! -name "*.c"
\( x -or y \)

Actions

-exec rm {} \;
-print
-delete

Examples

find . -name '*.jpg'
find . -name '*.jpg' -exec rm {} \;
find . -newerBt "24 hours ago"

 

Read more: Simple Linux Find Commands

Read more: Cheat Sheets

The tar Command
tar --exclude='folder'--exclude='upload/folder2'-zcvf /backup/filename.tgz

The tar (tape archive) command bundles a bunch of files together and creates an archive (commonly called a tar file or tarball) on a tape, disk drive, or floppy disk. The original files are not deleted after being copied to the tar file. To create an archive using tar, use a command like this, which bundles all the files in the current directory that end with .doc into the alldocs.tar file:

tar cvf alldocs.tar *.doc

Here's a second example,

Read more: Tar Commands

This is a linux command line reference for common operations.
Examples marked with • are valid/safe to paste without modification into a terminal, so
you may want to keep a terminal window open while reading this so you can cut & paste.
All these commands have been tested both on Fedora and Ubuntu.

Read more: Command Line Reference

Subcategories

Other sites hosted by L Rio.