School of Computing. Dublin City University.
Online coding site: Ancient Brain
coders JavaScript worlds
du Space used by me du | sort -n # why -n? default is k listing in M du -BM listing in G du -BG top-level only --max-depth=1
df -h Show space on all disks df -k exact kilobytes
Filesystem Size Used Avail Use% Mounted on /dev/sda1 696M 65M 632M 10% /boot/efi /dev/sda8 96G 46G 46G 51% / /dev/sda9 96G 1.5G 90G 2% /DATA kita.computing.dcu.ie:/local2/home/student/student 2.0T 1.2T 770G 60% /users/student kita.computing.dcu.ie:/local2/home/tutors 2.0T 1.2T 770G 60% /users/tutors tmpfs 3.9G 115M 3.8G 3% /dev/shm tmpfs 783M 2.3M 780M 1% /run ...
Filesystem Size Used Avail Use% Mounted on /dev/sda1 71G 33G 35G 49% / kita.computing.dcu.ie:/local2/home/student/student 2.0T 1.2T 770G 60% /users/student kita.computing.dcu.ie:/local2/home/tutors 2.0T 1.2T 770G 60% /users/tutors tmpfs 3.9G 16M 3.9G 1% /dev/shm tmpfs 795M 1.8M 793M 1% /run udev 3.9G 0 3.9G 0% /dev
df -ThOn DCU Linux you will see these:
index.htmlWhat file that refers to depends on what directory you are in now.
../index.htmlis also relative path. It looks for index.html in the parent of the current directory.
Directory before | Command | Directory after |
/users/gdf | cd users/ec2 | /users/gdf/users/ec2 |
/users/gdf | cd ../ec2 | /users/ec2 |
/users/gdf | cd ec2 | /users/gdf/ec2 |
/dir/dir/dir/public_html/index.htmlGives the full "path" from the root down to the file.
Directory before | Command | Directory after |
/users/gdf | cd /users/ec2 | /users/ec2 |
Case matters in filenames in UNIX (this is why case often matters on Web).
Question: Is case sensitivity a good thing? Or is it a flaw in UNIX?Advantages of case sensitivity:
Solutions to "404 Not Found" because of case:
Long file names and multiple periods OK.
e.g.
product.4652.suppliers.us.html
#define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */
Avoid these chars in filenames, because they have meaning to the Unix command-line and utilities:
space (separate arguments) # comment < redirection > redirection ` result of a program | pipe & detach process ; separate multiple commands on the same line * wildcard ? wildcard ^ start of line $ end of line / variable value [ pattern matching ] pattern matching \ "quoted" character / should be in pathname, not filename ' string delimiter " string delimiter ! shell history |
0-9 a-z A-Z Use these inside filename only, not at start or end: . - _ |
$ find . | grep ' '