Monday, November 16, 2009

Linux Commands - system administration

* su - log into root account.
* df - quick check for the disk space. "df -h -T" -h let output human readable, -T shows the file system type.
* du - quick check for file size. "du -h" shows the size of folders and files under current directory in a more readable format.
* finger - check who is on the system. fingure followed by user id shows detail history of a user.
* passwd - change the passwd of the current user. type in passwd then enter, you will be asked for old password then new password.
* dd - disk duplicate. "dd if=/dev/hdb1 of=/backup/", if stands for input file, of stands for output file.
* shutdown - shutdown the system. -h flag means halt, -r indicates reboot. For example "shutdown -h +120" will put the system into hibernate after 120 min.
* tar - zip and unzip files or directory. "tar cvfz tarball.tar.gz ./directory/" archive and compress the directory "dir" into file "tarball.tar.gz", "tar xvf tarball.tar.gz" unzip it. c means create new, x means untar, v means berbose, f means file.
* chmod - change file permission. "chmod 777 filename" give read, write, execute permission to owner, group and world. 7 = 4 + 2 + 1 = r + w + x.
* chown - change file's owner. "chown me file1" change file1's owner to "me".
* chgrp - change file's group. "chown users file1" changes file1's group to "users".
* id - print user and group id.
* groups - view the groups a user belongs to. "groups root" display all the groups root belongs to.
* groupadd - create new group. "groupadd mygroup" create a new group mygroup.
* groupmod - modify a group. "groupmod -n testgroup mygroup" change the name of mygroup to testgroup.
* groupdel - delete a group. "groupdel testgroup" delete the group testgroup.
* useradd - add a user. "useradd -g mygroup myuser" add the user myuser to group mygroup.
* usermod - modify a user. "usermod -g users myuser" change the group of myuser to users.
* userdel - delete a user. "userdel myuser" delete the user myuser.

1 comment:

chatgpt's view about universe

 is there god? The existence of a higher power, commonly referred to as "God," is a matter of personal belief and faith. There is ...