Terminal - comments #terminal #commands
http://www.westwind.com/reference/OS-X/commandline/files-folders.html
### drupal files and folders ###
################################
# apply permissions
# cd to directory
# -Recursive (all sub files/dir) user:group
$ sudo chown -R 506:main live-docs
# drupal permissions
# http://www.lullabot.com/articles/keeping-drupals-files-safe
$ sudo chown -R deploy:apache sites/default/files
$ sudo chmod 775 sites/default/files
$ sudo chmod g+w -R sites/default/files
# change group permissions
sudo chgrp apache -R defult/files
# Copy a file:
# Go to the file directory and type:
cp file_name ~/path/to/directory
# Copy directory
# -a option is an improved recursive option, that preserve all file attributes, and also preserve symlinks.
# The . at end of the source path is a specific cp syntax that allow to copy all files and folders, included hidden ones.
cp -a /source/. /dest/
# Create new directory
$ mkdir foo
# Remove / Delete directory called /tmp/foo
$ rmdir /tmp/foo
# Recursive removal:
$ rm -rf /path/to/directory
# Move a directory to another
$ mv Foo/ Faa/
# Move just files in a directory to another
$ mv Foo/* Faa/
# You have new mail - message
remove: /var/mail/<whatever_user>
### Tar
#extract
tar --exclude='._*' -xvf test.tar.gz
# Set new password on UNIX
$ passwd