Friday, May 23, 2014

Linux Commands - 2

12:37 PM

This article explains some of the most used Linux commands and their basic usage which will be more helpful for beginners. All these commands should be entered at the command prompt and you must press the ENTER button to execute the desired command. Please note that all Linux commands are case sensitive.






11. cat   - Concatenate and print (display) the content of files.

root@linuxstorage:~# cat newfile

This file have list of data.

12. echo  - Display message on screen.

root@linuxstorage:~# echo newfile

newfile.

13. clear - Clear terminal screen.

14. df    - Display free disk space of whole file system.

root@linuxstorage:~#df

Filesystem           1K-blocks         Used              Available          Use%  Mounted on

/dev/sda2            151189708     9336308      134173400           7%     /

tmpfs                      1858556             216          1858340           1%     /dev/shm

/dev/sda1                3120456        97448           2864496           4%     /boot

15. df -h   - Display free disk space of whole file system in human readable.

root@linuxstorage:~#df -h

Filesystem            Size    Used   Avail    Use%   Mounted on

/dev/sda2             145G  9.0G   128G    7%        /

tmpfs                    1.8G  216K     1.8G     1%     /dev/shm

/dev/sda1             3.0G   96M    2.8G    4%        /boot

16. du -h - Display space used by specific directory in human readable and list what all files,sub-directory available in that directory and all there space used in details .

root@linuxstorage:~#df -h

8.0K    ./.gnome2/keyrings

16K     ./.gnome2/accels

4.0K    ./.gnome2/panel2.d/default/launchers

8.0K    ./.gnome2/panel2.d/default

12K     ./.gnome2/panel2.d

44K     ./.gnome2

4.0K    ./Templates

4.0K    ./Pictures

324M    .

17. du -csh - Display only total space used by specific directory in human readable.

root@linuxstorage:~#df -csh

324M    .

324M    total

18. exit   - Exit the command prompt shell.

19. free   -  Display memory usage.

root@linuxstorage:~#free

                 total             used           free         shared    buffers     cached

Mem:       3717116    1837284    1879832          0     225776    1041684

-/+ buffers/cache:       569824        3147292

Swap:      8290296          0          8290296

20. free -m - Display memory usage in human readable(MB).

root@linuxstorage:~#free -m

                    total       used       free     shared    buffers     cached

Mem:          3629       1794       1835          0        220       1017

-/+ buffers/cache:        556        3073

Swap:         8095          0          8095

Written by

0 comments :

Post a Comment

 

© 2014 Linux Storages | Updated . All rights resevered. Designed by Templateism