Useful Linux commands
netstat -tulpen
lists all active ports and listening services
nmap -sT 127.0.0.1 -p 1-9000
- same as above but more readable - list services listening to ports 1-9000 on local machine (except this doesn't seem to exist on BB1)
xinetd - red hats imlpentation of inetd (wake-up process) in /etc
To restart a xinetd process use the following (e.g. sshd)
service sshd restart
chkconfig --list
lists xinetd controlled ports
To check the pid of a service (e.g. sshd)
cat /var/run/sshd.pid
Another way to kill a process "seems" to be (check before using). There are all these .pid files in /var/run which you can cat and get the pid. These are likely to be set up when a process starts to store the pid. Investigate further.
rm -f /var/run/sshd.pid /etc/rc.d/init.d/sshd start
/etc/services all ports and mapped services
Make aliases
Edit the ~/.bashrc file adding e.g. alias trousers="cd /opt/trousers"
On Mac it is ~/.bash_login
Alternatively, in order for it to be added for all users, add your alias or other change to /etc/bashrc
Users and groups
To add user to /etc/sudoers file use command visudo (from root)
Add a group
groupadd plone
Add a new user
useradd plone -g plone -d /home/plone -p password
Basic OS info
Here's how to get that easy-to-forget info about your Linux OS.