|
LinkExchange Member | Free Home Pages at GeoCities |
Unix file systems are the hierarchical. All file systems together make up the tree. All devices are files, for example /dev/rmt/0lbn - is the tape, /dev/dsk/c0t2d3s2 - is the disk partition /dev/null - empty device, you can redirect all garbage to this device
All file systems starting from root "/". Note, that UNIX uses the regular slash "/" instead of DOS's back slash "\".
To get a disk report use the "disk free" command df -k , where k means kbytes. Here the result example:
Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t2d0s0 48023 23400 19823 55% / /dev/dsk/c0t2d0s3 327711 250346 44595 85% /usr /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd swap 165816 32 165784 1% /tmp /dev/dsk/c0t2d0s4 433639 332821 57458 86% /opt /dev/dsk/c0t1d0s7 1967118 1692863 77545 96% /export File names convention: File name does not contain metacharacters of shell such as &, < , >, ; *, $ File maximal name length is less than 256. Examples of file name extensions: c-file "filename.c", header file "filename.h", object file "filename.o", a.out - executable standard file name
A Shell is the command intepretator that executes commands from a terminal or a file. There are some popular shells: sh, csh, tcsh, ksh, bash
sh - Bourne shell, it's the standard shell csh - C-shell, one of more popular shells, tcsh - GNU extended version of csh ksh - Korn shell bash - Bourne again sh, extended version of sh. Environment variables are variables that are defined per given shell, for example: HOME - home directory name for given shell PATH - path collection for given shell MANPATH - collection for on-line manulals DISPLAY - IP address for given host and him display and many others. env, printenv - show environment variables Commands using shell history: !pattern - run last command starting with "pattern" !! - run last command !!:p - only show last command !!:s/old/new = ^old^new ls !$ - get last argument from the last command tcsh line commands : ^a - go to beginning of a line ^e - go to end of a line ^d - previous command ^n - next command ^k - erase to end of line and more ^u - erase a line
Unix command DOS equivalent Description ls dir List directory pwd Print working directory cd cd Change directory cp copy Copy file rm del Remove (delete) file mv rename Move (rename) file mkdir mkdir Make (create) directory rmdir rmdir Remove (delete) directory cat type Concatenate (display) file more type Display file by pages man help Man pages (help)
ls -l permissions, owner, group, number of bytes, date, ... See result example: total 1808 drwxr-xr-x 2 rafael daps 1024 Nov 25 15:57 Save-24-Nov-97/ drwxr-xr-x 2 rafael daps 512 Jan 9 1997 Scenarios/ -rwxr-xr-x 1 rafael daps 6436 Nov 19 15:04 a.out* -rw-r--r-- 1 rafael daps 1173 Nov 4 16:26 changes_to_1.5.5 -r--r--r-- 1 rafael daps 3927 Nov 26 16:51 communication.c -r--r--r-- 1 rafael daps 13698 Sep 28 10:03 dbs_sender.c -rw-r--r-- 1 rafael daps 30136 Nov 3 20:25 diff_ev ............ ls -a show hidden files See result example: ./ Mail/ ../ Packages/ .Xauthority SYBASE_1 .Xdefaults Top/ .alias.own ccc .app-defaults/ ccmail/ .cshrc conf1.gif ls -tl - show all files sorted by time
Copy files cp - copy files cp f1 f2 - copy file "f1" to file "f2" cp -i f1 f2 - copy with confirmation cp f1 f2 f3 /dirname - copy files "f1", "f2", "f3" to /dirname cp *.c /dirname - copy all files *.c to /dirname cp -r dir1 dir2 - recursive copy directory dir1 dir2 Move files mv - move files mv f1 f2 - rename file "f1" to file "f2" mv -i f1 f2 - rename with confirmation mv f1 f2 f3 /dirname - move files "f1", "f2", "f3" to /dirname mv *.h /dirname - move all files *.h to /dirname
mkdir "dirname" - make directory rmdir "dirname" - remove directory rm -r "dirname" - recursively remove directory du -s - show disk usage ( in blocks ) du -k - show disk usage ( in kbytes )
man "keyword" - display manual pages about "keyword" man -k "keyword" - show summaries from index index database man -s 2 "keyword" - display chapter 2 about "keyword"
[Home] [Five UNIX Tips] [Tip 2 - User environment and multi processing] [Tip 3 - UNIX windows] [Tip 4 - NFS protocol and shareable systems] [Tip 5 - More about file system] [UNIX vendors, Home Pages, Workstations, FAQs, News Groups]