Explore

Loading

Tuesday, February 14, 2012

Unix Commands

1. Files

1.1. Filename Substitution
Wild Cards ? *
Character Class (c is any single character) [c…]
Range [c-c]
Home Directory ~
Home Directory of Another User ~user
List Files in Current Directory ls [-l]
List Hidden Files ls -[l]a
1.2. File Manipulation
Display File Contents cat filename
Copy cp source destination
Move (Rename) mv oldname newname
Remove (Delete) rm filename
Create or Modify file pico filename
1.3. File Properties
Seeing Permissions ls -l filename
Changing Permissions chmod nnn filename
chmod c=p…[,c=p…] filename
n, a digit from 0 to 7, sets the access level for the user
(owner), group, and others (public), respectively. c is one of:
uuser; ggroup, oothers, or aall. p is one of: rread
access, wwrite access, or xexecute access.
Setting Default Permissions umask ugo
ugo is a (3-digit) number. Each digit restricts the default
permissions for the user, group, and others, respectively.
Changing Modification Time touch filename
Making Links ln [-s] oldname newname
Seeing File Types ls -F