Monday, January 6, 2014

Useful Linux Commands (ubuntu)

Find the size of a directory
du -ah 

See how much space is free, and how much is used
df -h

List all the commands that you can use as sudo
sudo -l

If the output of the command is:
    (www-data) NOPASSWD: /usr/bin/php
    (www-data) NOPASSWD: ALL

You can run php as www-data, but also, you can run any other command as www-data.

To run chmod as www-data
sudo -u www-data chmod g+w testdir

Copying files from one machine to another, when you want to copy only the changes the next time around.
rsync -avz from_local_dir machinename:/some/dir/on_other_machine


No comments: