| ||||
Permissions and navigation in Unix in the Radford system:
Login:
Using a Mac, use Terminal application / PC should be Telnet or other line command internet protocol ap
(Using a PC on campus -__________, or download applications like putty )
ssh -l loginname ruacad.radford.edu
Following the password prompt, you will see
Type xterm-color unknown
tcsh: using dumb terminal settings.
TERM = (ruterm)At this prompt, type VT100
So that the line reads TERM=(ruterm) VT100Navigating
pwd print working directory (where am I?)
man help manual to get information, ex.: man ls
who who else is logged on
ls list structures (show files)
ls -C list structures in columns
ls -R list structures everything
ls -l list structures with permissions and other info
ls –a list structures and show invisible files too
ls -l |more list structures with permissions and "pipe" to more
cd .. go up a directory (that's cd space dot dot)
cd foldername go into a directory
mkdir foldername make a new directory
rmdir foldername remove a directory
rm name remove a file
mv name newname rename a file
Three ways to open and (two ways to) edit a file:
pico filename -- open existing file / make new one using "pico" editor
vi filename -- open existing file / make new one using "vi" editor
more filename -- open existing file in "read only" mode / use space bar to continue, hit q to get out.
Pico editor commands
<control> X quit <control>K cut
<control> U undo <control>G Help
vi editor commands
<esc> toggle (switch back and forth) command and write modes
u undo
i insert mode r replace on character
R replace mode (overwrite) x delete a character
dd delete a line 10 dd delete 10 lines
l move left one character e move left one word
k move up one line j move down one line
h move right one character man Help (manual)
<esc> :q! quit without saving changes
<esc> :wq quit and save changes (write quit)
<esc> :w! save changes (write)
Changing permissions
1. The basic command is chmod followed by a space, then what type of permission you want followed by another space, then the folder name, the file name or the special command for all files.
EX: chmod 755 file1.html -- Standard web for a file called "file1.html"
chmod 755 *.* -- Standard web permission for all files in the folder
chmod 755 foldername -- Standard web permission for a folder (directory)
EX2: If you are setting permissions for a dynamic_php folder or files, the permissions look like this:
Chmod 711 file1.html -- and so on.
2. What does it mean?
If you type ls –l to find the permissions, you might get something that looks like this:
drwx------ 22 bill staff 748 Jan 20 23:41 Sites
This is a directory with owner read write execute permission but no permission for group or other. Here is one with permission for group and other:
drwxr-xr-x 22 bill staff 748 Jan 20 23:41 Sites
See the difference? The last six places in the permission line now have r-x which means read not write and execute. Read write execute would be rwx and read only would be r—