Notes:
Naming a file
- File Types - bytestream vs. fixed record
- can contain up to 256 characters, except when the file is under an
MPE group or account, then 16 characters is the limit
- can be any combination of:
- alphanumeric character
- special character + - _ .
- case matters - file1, FILE1, File1, fILE1 are different files
Creating and listing files
- Files starting with . (dot) are hidden and not normally listed,
use ls -a
> cat > file1 (Enter/Return to end each line, CTRL-Y to finish)
> vi file1
> ls
Viewing and printing a file:
> more file1
> cat file1
> lp file1
Copying, renaming, and removing files
> cp file1 file2 (If file2 exists, it is overwritten.)
> mv file1 file2 (If file2 exists, it is overwritten.)
> rm file2
Displaying and Changing a File's Permissions and Ownership
- Display a file's permissions:
> ls -l
-rw-r--r-- 1 CGI.APACHE APACHE 57 Feb 2 19:26 file1
-rw-r--r-- 1 CGI.APACHE APACHE 57 Feb 2 19:26 file2
Change a file's permissions:
> chmod u+x file1
Change a file's ownership:
> chown MGR.APACHE file1
Change a file's group:
> chgrp SYS file1
> ls -l
-rwxr--r-- 1 MGR.APACHE SYS 57 Feb 2 19:26 file1
-rw-r--r-- 1 CGI.APACHE APACHE 57 Feb 2 19:26 file2
Top
Programming Posix
Hosted by 3kRanger.com
email 3kRanger
Updated