File management: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
add unpacking gz files
Line 39: Line 39:
</source>
</source>


== Unpacking gz files ==
The files are compressed using Lempel-Ziv (LZ77) algorithm. GNU zip (gzip/gunzip) is used for this.
<syntaxhighlight lang="bash">$ gunzip file.gz</syntaxhighlight>
or
<syntaxhighlight lang="bash">$ gzip -d file.gz</syntaxhighlight>




[[Category:System administration]]
[[Category:System administration]]

Revision as of 20:45, 29 June 2016

Copy including hidden files

  • Last tested on Ubuntu 14.04.2 LTS (trusty)
$ cp -r folder1/. target/


Setting a default group for a folder

  • Last tested on Ubuntu 16.04 LTS (xenial)

This is to set permission for an existing folder for collaboration. This assumes the group name to be dev, and the folder to be /srv/www/project.

This sets setgid bit on the folder.

$ sudo find /srv/www/project -type d -exec chgrp dev {} +
$ sudo find /srv/www/project -type d -exec chmod g+s {} +

Make it writable by the group.

$ sudo chmod -R g+w /srv/www/project

Change group ownership of existing files.

$ sudo chown -R mhan:dev /srv/www/project

These commands should be executed for a new folder.

$ sudo chgrp dev /srv/www/project
$ sudo chmod g+s /srv/www/project


Unpacking gz files

The files are compressed using Lempel-Ziv (LZ77) algorithm. GNU zip (gzip/gunzip) is used for this.

$ gunzip file.gz

or

$ gzip -d file.gz