Monday, 27 February 2012

Useful linux commands

# id  ---------- Show the active user id with login and group

# id username ---------- Shows details for a particular user

last  ----------- Show last logins on the system

# who  --------- Show who is logged on the system

# who -u ------- shows the pid also of the logged in user, so easy to kill that particular user only. # kill -9 PID

# useradd -c "Colin Barschel" -g admin -m colin  ----- all in one line

ulimit -a
The shell limits are governed by ulimit. The status is checked with ulimit -a,
To change the open files limit from 1024 to 10240 do:
# ulimit -n 10240    , This is only valid within the shell.

 Login users and applications can be configured in /etc/security/limits.conf

# cat /etc/security/limits.conf
*  hard  nproc 250  # Limit user processes
asterisk  hard  nofile  409600 # Limit application open files

Use chkconfig to configure the programs that will be started at boot in a runlevel.

# chkconfig --list  ------- List all init scripts
# chkconfig --list sshd ----- Report the status of sshd
# chkconfig sshd --level 35 on ------ Configure sshd for levels 3 and 5
# chkconfig sshd off  -------- Disable sshd for all runlevels

Some Kernel Modules

#  lsmod  -------- List all modules loaded in the kernel
# rmmode --------  To remove a module
# modprobe usb-storage --------- To load a module
# insmod ----- To load a module 





No comments:

Post a Comment