User Tools

Site Tools


utils_commands

This is an old revision of the document!


Useful commands

Data management

File and directory size

# du -sh /var/*

Disk usage

# df -h

Change permissions

Change directories permission:
$ find /path/to/base/dir -type d -exec chmod 755 {} +
Change files permission:
$ find /path/to/base/dir -type f -exec chmod 644 {} +

Change ownership

Owner:
$ chown owner_name * -R
Group:
$ chgrp group_name * -R

Copy / backup large folders

Test the command with -n
$ rsync -nav –delete-after /source/ /destination/ Execute command : -a for archive (keep files structure + recursive…), -v for verbose, –delete-after to delete files in backup directory if they do not exist in source (moved, renamed, …) $ rsync -av –delete-after /source/ /destination/

utils_commands.1588692534.txt.gz · Last modified: 2020/05/05 15:28 by xavier