Sunday, January 16, 2011

Linux Miscellaneous but important commands

To find help on some topic :
[root@SLES /]# man pwd
[root@SLES /]# info pwd

Also you can seek for a particual keyword ( say:  umask) in the man pages by:
[root@SLES /]# man -K umask

To find a file in the /usr directory, use:
[root@SLES /]# find /usr -name “*.doc”

To find files and directories owned by the group students in the /usr directory, use:
[root@SLES /]# find /usr -group students

Assuming a user left the organization and the files owned by his account name must be found and deleted for security reasons, use :
[root@SLES /]# find / -user Shaheer -exec rm  '{}'  ';'

Want to perform some quick mathematical calculations, use:
[root@SLES /]# bc

To set up date and time as 16 Jan 2000 17:35 you should use:
[root@SLES /]# date 0520173503

To synchronize it with the hardware clock, use:
[root@SLES /]# hwclock –-systohc

To check for memory and swap space usage, you can use:
[root@SLES /]# free
[root@SLES /]# top

To check the system load status averages and the uptime:
[root@SLES /]# uptime

To check when the system was booted last time:
[root@SLES /]# who -b

To check the status of a particular service:
[root@SLES /]# service sendmail status
[root@SLES /]# /etc/rc.d/init.d/sendmail status

To check the status of  all services:
[root@SLES /]# service –-status-all

Sometimes symbolic links to files are broken, eg assuming link file is deleted or some file is over written on it. To create a symbolic link for the /boot/grub/menu.lst file in the /etc directory as grub.conf use:
[root@SLES /]# ln -s /boot/grub/menu.lst /etc/grub.conf

If you want to know the SLES version, read the file /etc/SLES-release  or /etc/issue
[root@SLES /]# cat /etc/SLES-release
[root@SLES /]# cat /etc/issue

uname commands
[root@SLES /]# uname -p
[root@SLES /]# uname -m
[root@SLES /]# uname -i

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...