Linux Tips

RPM

For Red Hat and related distros you can use rpm (Red Hat package manager) for managing software installation.

You can see what is installed with

rpm -qa

To see what files are installed for a particular package, use

rpm -ql package-name

To see what files will be installed for a particular rpm file, use

rpm -qlp filename

System time

If you need to change the system time, you should make sure you update the hardware clock as well as Linux's:

date -s 11:00 hwclock --systohc

Creating a floppy disk image

dd if=/dev/fd0 of=disk1.img bs=1440k count=1

Finding big files

This finds all files bigger than 10Mb and displays their size in k, sorted by size:

find / -size +10000k -printf "%b %p\n" |sort -g

DNS lookup

To check the mail server for a domain, use:

nslookup -type=MX michaelhinds.com

3c59x change speed

To go down to 10Mb with the 3c59x driver, do:

ifconfig eth0 down rmmod 3c59x insmod 3c59x options=1 ifconfig eth0 up <ip address>

It's the same with the 3c90x, but instead of "options" use "media_select"

Files modified in last 8 days

find . -mtime -8

Creation time

Don't know if you can check a file's creation time:

UNIX and UNIX like OS`s (and POSIX implementing OS`s, for that matter)
don`t keep an absolute file creation time. They keep a change time
(file metadata -- "stat information" -- has changed), a modification
time (file contents have changed), and an access time (a read operation
has occurred on the file).

However, if the stat information (ctime) hasn't changed since creation (quite possible) that should give you the creation time. So, you could use this:

ls -lt --time=ctime

xinetd

RH7 uses xinetd instead of inetd. To open up a new box, edit /etc/xinetd.d/telnet. Make sure disable=no.

Edit /etc/xinetd.d/wu-ftpd. Make sure disable=no.

/etc/init.d/xinetd restart