UNIX

VMS to UNIX commands

Command        Description

  1. cat                    Display contents of files or standard input if no file name is supplied

  2. cd                    change working directory

  3. cp                    copy a file to another file

  4. date                  display date and time

  5. echo                 display text on the screen

  6. ls                      list files in working directory or other directorie

  7. mkdir               create a directory

  8. mv                    rename a file or move it to another directory

  9. ps                     list information about active processes

  10. pwd                 display the name of the path of the current working directory

  11. rm                    delete a file or files

  12. rmdir                remove empty directory

  13. sort                  sort lines in a file

  14. wc                    count the number of lines, words, and characters in a file 

  15. who                  displays who is logged in

 

Command's Purpose

Linux

Basic Linux Example

Copies files

cp

cp thisfile.txt /home/thisdirectory

Moves files

mv

mv thisfile.txt /home/thisdirectory

Lists files

ls

ls

Clears screen

clear

clear

Closes prompt window

exit

exit

Deletes files

rm

rm thisfile.txt

Edits files with simple text editor

pico

pico thisfile.txt

Compares the contents of files

diff

diff file1 file2

Finds a string of text in a file

grep

grep this word or phrase thisfile.txt

Displays command help

man

man command

Creates a directory

mkdir

mkdir directory

View a file

less

less thisfile.txt

Renames a file

mv

mv thisfile.txt thatfile.txt

Displays your location in the file system

pwd

pwd

Changes directories with a specified path (absolute path)

cd pathname

cd /directory/directory

Changes directories with a relative path

cd ..

cd ..

Displays the time

date

date

Shows amount of RAM and use

free

free

Displays who is logged on

who

who

Removes empty directory

rmdir

rmdir /directory/directory

Display contents of files or standard input if no file name is supplied

cat

cat

 

 

$ ls -ld test_directory/drwx------   
    2 hoehnj   hoehnj       4096 Apr 12 12:17 test_directory/

$ chmod o+x test_directory/

$ ls -ld test_directory/drwx-----x   
    2 hoehnj   hoehnj       4096 Apr 12 12:17 test_directory/

Now you want to give read access on the file.

$ cd test_directory/

$ ls -l test_file -rw-------   
    1 hoehnj   hoehnj          0 Apr 12 12:19 test_file

$ chmod o+r test_file

$ ls -l test_file -rw----r--   
    1 hoehnj   hoehnj          0 Apr 12 12:19 test_file

So, for a directory it's:           chmod o+x directory

and for a file it's:                chmod o+r file