Do Some Basic UNIX: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
<p> | <p> | ||
<table border="1" cellpadding="2" cellspacing="2"> | |||
<tr> | <tr> | ||
Line 52: | Line 52: | ||
<p>Three numbers indicate the permissions for the owner, the group and the world.</p> | <p>Three numbers indicate the permissions for the owner, the group and the world.</p> | ||
<dl> | <dl> | ||
<dd type="1">1 - execute permission | <dd type="1">1 - execute permission</dd> | ||
<dd type="1">2 - write permission | <dd type="1">2 - write permission</dd> | ||
<dd type="1">4 - read permission<p> | <dd type="1">4 - read permission</dd><p> | ||
</dl> | </dl> | ||
You can add these permissions together, for example: | You can add these permissions together, for example: | ||
<dl> | <dl> | ||
<dd type="1">7 - read, write, execute | <dd type="1">7 - read, write, execute</dd> | ||
<dd type="1">6 - read and write (not execute) | <dd type="1">6 - read and write (not execute)</dd> | ||
<dd type="1">5 - read and execute (not write) | <dd type="1">5 - read and execute (not write)</dd> | ||
</dl> | </dl> | ||
<p><font face="courier">chmod 777 <i>filename</i></font></p> | <p><font face="courier">chmod 777 <i>filename</i></font></p> | ||
<ul> | <ul> | ||
<li type="1">Give all users read, write and execute | <li type="1">Give all users read, write and execute</li> | ||
</ul> | </ul> | ||
<p><font face="courier">chmod 744 <i>filename</i></font></p> | |||
<ul> | |||
<li type="1">owner read, write, execute</li> | |||
<li type="1">group members and all others read only</li> | |||
</ul> | |||
<p><font face="courier">chmod 755 <i>filename</i></font></p> | |||
<ul> | |||
<li type="1">owner read, write, execute | |||
<li type="1">all other read and execute (but not write) | |||
</ul> | |||
<p><font face="courier">chmod 700 <i>filename</i></font></p> | |||
<ul> | |||
<li type="1">owner read, write execute | |||
<li type="1">others: no access | |||
</ul> | |||
<font face="courier">chmod -R</font> will make these changes to all of the files in any sub-directories, as well. | |||
</td> | </td> | ||
</tr> | </tr> |
Revision as of 00:29, 9 September 2006
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
Some basic unix commands
Want more? Try the excellent tutorials at FreeEngineer.org, Mayo, UnixGeeks.org or Idaho state
Command | Meaning |
---|---|
man function | show the manual page for a function |
top | shows currently running processes - do not leave this running for more than 30sec (ctrl-c) |
ps | show the names of all running processes |
mkdir dir_name | create a sub-directory of the current directory |
rmdir dir_name | remove a directory. You must remove files in the directory first. |
cp source dest | copy a file or directory from source to dest |
rm file_name | remove a file (permanent!) |
chmod xxx file_name | change the file permissions:
Three numbers indicate the permissions for the owner, the group and the world.
You can add these permissions together, for example:
chmod 777 filename
chmod 744 filename
chmod 755 filename
chmod 700 filename
chmod -R will make these changes to all of the files in any sub-directories, as well. |
ls | list contents of current directory |
ls -l | list the contents of the directory (long form, showing sizes) |
ls dir_name | list the contents of the named directory |
cd dir_name | change to the named directory |
pwd | show the name of the current directory |
. | the current directory |
.. | the parent directory of this directory |
more file_name | print out the contents of the named (text) file |
df | show the free space on the present disk |
du | show the disk usage on the system |
* | unix wild card - matches all file names (except those beginning with '.')
e.g. rm * will remove all files from the current directory! <blink>You will absolutely never type 'rm *'. Ever.</blink> Always type something like "ls *" first to verify what such a wildcard will match |
xemacs file_name textedit file_name |
These are all text editors that are found commonly on unix systems. Most people seem to prefer xemacs, but each has its adherents. |
? | matches any single character |