Unix Cheat Sheet Page 4

ADVERTISEMENT

Permissions, important and tricky!
Unix permissions concern who can read a file or directory, write to it, and execute it.
You can change file permissions with letters:
u = user (yourself)
g = group
a = everyone
r = read
w = write
x = execute
chmod u+rw
Give yourself read and write permission
{filespec}
Give yourself execute permission.
chmod u+x {filespec}
chmod a+rw
Give read and write permission to everyone.
{filespec}
System info
Show date and time.
date
Check system disk capacity.
df
Check your disk usage and show bytes in each directory.
du
Unix Directory Format
Long listings (ls -l) have this format:
- file
d directory,
* executable
^
symbolic links (?)
file size (bytes)
file name
/ directory
^
^
^
^
^
drwxr-xr-x 11 mkummel
2560 Mar
7 23:25 public_html/
-rw-r--r--
1 mkummel
10297 Mar
8 23:42 index.html
^
^^^
user permission
(rwx)
date and time last modified
^^^
group permission (rwx)
^^^
world permission (rwx)
Dotfiles (aka Hidden Files)
Dotfile names begin with a "." These files and directories don't show up
when you list a directory unless you use the -a option, so they are also
called hidden files. Type ls -la in your home directory to see what you
have.
Some of these dotfiles are crucial. They initialize your shell and the
programs you use. rc means "run commands". These are all text files that
can be edited, but change them at your peril. Make backups first!
Here's some of what I get when I type ls -laF:
.cshrc
my C-shell startup info, important!
.history
list of past commands.
.login
login init, important!
4

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4