Feeds:
Posts
Comments

Archive for January 9th, 2008

du – estimate file space usage
taufanlubis@toshiba:~$ du -h MyData/repo_gutsy/
4.0K MyData/repo_gutsy/partial
530M MyData/repo_gutsy/

taufanlubis@toshiba:~$

df – report file system disk space usage
taufanlubis@toshiba:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 88G 28G 56G 34% /
varrun 501M 100K 501M 1% /var/run
varlock 501M 0 501M 0% /var/lock
udev 501M 72K 501M 1% /dev
devshm 501M 0 501M 0% /dev/shm
lrm 501M 34M 468M 7% /lib/modules/2.6.22-14-generic/volatile
/dev/sda1 1.5G 139M 1.4G 10% /media/sda1
/dev/sda2 20G 12G 8.9G 56% /media/sda2

taufanlubis@toshiba:~$

file – determine file type
taufanlubis@toshiba:~$ file easycam1.png
easycam1.png: PNG image data, 519 x 318, 8-bit/color RGBA, non-interlaced
taufanlubis@toshiba:~$

diff – compare files line by line (find differences between files)
To test it, I created 2 files, test1 and test2.
taufanlubis@toshiba:~$ cat > test1
data test 1
1 2 3 4 5 6 7 8 9 0
a b c d e f g h i j

type ctrl-z
[6]+ Stopped cat > test1

taufanlubis@toshiba:~$ cat > test2
data test 2
1 2 3 4 5 6 7 8 9 0
a b c d e f g h i j
A B C D

type ctrl-z
[7]+ Stopped cat > test2

taufanlubis@toshiba:~$ diff test1 test2
1c1
< data test 1

> data test 2
3a4
> A B C D
taufanlubis@toshiba:~$
You see that there 2 lines which are different, line 1 (show the different) and line 4 (only file test2 has it).

 

exit – exit the console
taufanlubis@toshiba:~$ exit

 

echo – display a line of text
taufanlubis@toshiba:~$ echo ‘This is only a test’
This is only a test
taufanlubis@toshiba:~$ sudo echo “202.155.0.10″ > /etc/resolv.conf
taufanlubis@toshiba:~$ sudo echo “202.155.1.15″ >> /etc/resolv.conf

 

Read Full Post »

Follow

Get every new post delivered to your Inbox.

Join 70 other followers