Users from the command line:
adduser techmint -G users,<othergroups>
deluser username
addgroup groupname
adduser username newgroup
System backup
https://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync
This article is about using rsync to transfer a copy of your “/” tree, excluding a few select folders. This approach is considered to be better than disk cloning with
ddsince it allows for a different size, partition table and filesystem to be used… … …
This command depends on brace expansion available in both the bash and zsh shells. When using a different shell,
--excludepatterns should be repeated manually.
# rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folderUsing the
-aAXset of options, the files are transferred in archive mode, ensuring that symbolic links, devices, permissions and ownerships, modification times, ACLs and extended attributes are preserved.The
--excludeoption will cause files that match the given patterns to be excluded. The contents of/dev,/proc,/sys,/tmpand/runwere excluded because they are populated at boot (while the folders themselves are not created),/lost+foundis filesystem-specific. Quoting the exclude patterns will avoid expansion by shell, which is necessary e.g. when backing up over SSH. Ending the excluded paths with*will still ensure that the directories themselves are created if not already existing.Be aware that you will need a Linux compatible file system, eg:
ext4to maintain symlinks etc, when using the-aAXoptions.
Copy old user to new user
http://ubuntuforums.org/showthread.php?t=1280723
sudo adduser newuser
sudo usermod -a -G adm,users newuser
sudo cp -av /home/olduser/. /home/newuser/
<or rsync -aP /home/olduser/. /home/newuser/ >
sudo chown -R –from=olduser newuser:newuser /home/newuser
(logout and in again to see new group permissions active)
find -name "*foo*.filetype" -exec rename 's/foo/bar/' {} ";"
find /folder/. -name bar -type d -execdir mv {} baz \;
-execdir changes directory to the parent before executing the command, so the mv here will be local to each parent directory.