Thursday, February 9, 2012

HOW TO change file permissions on LINUX

To change file permissions on Linux is easy stuff that should just fly off your fingertips, but just in case you forgot or someone asks you a question and you want to just send them a summary.

To change file ownership
usage: chmod +x thefilename

File permissions
666 means the sign of the devil! And also that the owner is allowed to read and write, group is allowed to read and write, and everyone is allowed to read and write. Well what good is that if you can't run it?

777 means read, write and execute for the owner, group and everyone respectively.

123 means owner can execute, group can write, everyone else can write and execute

321 means owner can write and execute, group can write, everyone else can execute

4321 same as 321, except that "4" is a special mode bit for "Set User ID" on execution

Using grep
searching for a file containing a certain string
usage: grep string filenames | more
means look for this string within these names of files, could be 2* (for example a bunch of log files beginning with 2012-month-day etc) pipe to more

Verifying process ID
usage: ps -ef | grep theprocessIDnumber

No comments:

Post a Comment