Skip to main content

Posts

Showing posts with the label Linux

su and sudo command

Su vs. Sudo The su command switches to the super user – or root user – when you execute it with no additional options. You’ll have to enter the root account’s password. This isn’t all the su command does, though – you can use it to switch to any user account. If you execute the  su bob command, you’ll be prompted to enter Bob’s password and the shell will switch to Bob’s user account. Once you’re done running commands in the root shell, you should type  exit  to leave the root shell and go back to limited-privileges mode. Sudo runs a single command with root privileges. When you execute  sudo command , the system prompts you for your current user account’s password before running  command  as the root user. By default, Ubuntu remembers the password for fifteen minutes and won’t ask for a password again until the fifteen minutes are up. This is a key difference between su and sudo. Su switches you to the root user account and requires the root acc...

Difference between scp and rsync

Some introduction web pages talking about it. https://blog.akendo.eu/rsync-scp/ http://superuser.com/questions/393608/difference-between-scp-and-rsync Some differences: 1) Performance scp will be faster 2) Security scp is more secure, but if you were to use rsync -avz -e ssh, then rsync would be as secure 3) Capability rsync can 'sync' the two copies, so lets say if your scp stopped in middle of the transfer for some reason (network issue lets say), you could use rsync to complete the transfer. scp will simply overwrite. alias scpresume="rsync --partial --progress --rsh=ssh" rsync can also exclude certain subdirectories/files using the  --exclude  flag, scp can't do that.