Last active
February 17, 2021 00:29
-
-
Save frankyonnetti/160ad77f32cbdd9b5734d9e61d73adb3 to your computer and use it in GitHub Desktop.
Terminal - comments #terminal #commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment