unix


Unix Basics


How do I list my directory?

    Use the ls command.

    The ls command is similar to the dos command ‘dir’. It gives you a list of the files in your current directory. Another aspect of the ls command is that it doesn’t give you all the information about a file. In order to get a full listing of the current directory, you must type in ‘ls -l’. This will give you the long listing of that directory. ls stands for “list” and ls -l stands for “long listing”.


How do I change my password?
    Type "passwd" at the UNIX prompt. 

How do I change all my htm extension files to html?
    Use a simple shell script.
    #!/bin/csh
    foreach file (*.htm)
    mv ${file} ${file}l
    end
    

What are some basic UNIX commands?
    cd      Change Directory
    dir     LIst all files and sizes
    exit    Exit
    kill    kill a process
    ls      List all files
    ls -a   List all files, even hidden files
    more	read the file without opening it
    pico    A nice editor
    pine    A nice email program
    rm      Remove
    

How can I get help with a command?
    Use the “man” command.

    “man” stands for “manual pages” and the proper usage of the command is like this:

    man unixcommand

    For example, to get the manual pages for the ls command type:

    man ls

    This will bring up the manual pages for the ls command. Manual pages are sometimes quite cryptic and difficult to understand. If you can’t understand a manual page and you are still confused, you might think about getting a unix book, or asking someone who knows.


How do I change permissions on a file or directory?
    Use chmod.
    These are the permissions that you need to know if you do an ls -l or dir at the unix prompt
    rwx – rwx – rwx
    owner group all
    this give read,write, and excute to all. If you want to change it, look at the numbers below:
    --x     1
    -w-     2
    -wx     3
    r--     4
    r-x     5
    rw-     6
    rwx     7
    
    If you would like to set your file to rwxr-xr– you would type:

    chmod filename 754