: faq :

How do I find files modified 15 minutes ago on linux?

-> find / -type f -mmin 15

How do I clear my bash history?

-> history -c
-> rm ~/.bash_history

How do I view recent logins to my linux system?

-> utmpdump /var/log/wtmp

How do I mount a NTFS? How do I read / write to a NTFS filesystem?

Make sure you have the fuse packages installed, e.g.: fuse-2.7.0-2.el5.rf, dkms-fuse-2.7.0-1.nodist.rf, fuse-ntfs-3g-1.1120-1.el5.rf, if on RHEL5
Then mount the filesystem by specifying the target as: ntfs-3g , e.g.: mount -t ntfs-3g /dev/sdb2 /mnt

How do I ping an entire network subnet in Linux?

-> ping -b

How do I add apache to default run level non-chroot'd in openbsd?

Edit /etc/rc.conf.local and add a line:
httpd_flags="-u" # start apache non-chroot

How do I restart apache in openbsd?

-> apachectl restart

How do I write a local file to a remote system's tape device over ssh?

-> tar -cv --rsh-command=/usr/bin/ssh --rmt-command=/sbin/rmt -f user@remotesys:/dev/st0 ./localfile

How do I create and write a tar file to a remote computer on the fly using ssh?

-> tar cvfz - /localdir | ssh user@remotesys "cat > /remotedir/newtarball.tar.gz"
The 'z' option is optionally used for compression

How do I setup my network card assigning an ip, netmask and gateway utilizing command-line tools?

At the command prompt:

-> ifconfig eth0 netmask up

Then we must setup the gateway ...

-> route add default gw eth0

How do I recursively report the number of files in a directory tree?

At the command prompt:

-> find DIR -type f | wc -l
We tell find to look in directory specified for objects of type file all at the same time piping stdout to wc to count the number of lines, or files found!

How do I configure X with SaX2 while having two video cards, possibly one is an onboard?

At the command prompt:

-> sax2 -p -- to find the chip id's of your video cards
-> sax2 -c 1 -m 1=nvidia -- we tell sax2 to not bother configuring the first card in the system ( chip 0 ), rather use chip 1 ( specified with -c option), also go ahead and specify the driver to use (-m and 1 for the chip id)

How do I remove a file with special characters in linux?
Utilizing ls, find, and rm we can take care of this by specifying the file we want to delete with it's inode #

At the command prompt:

-> ls -li -- to find the inodes of files in current directory
-> find . -inum xxxx -exec rm -f {} \; -- where xxxx is the inode # of the file you want to delete.

How do I move all directories non-recursively in an absolute directory at the same time excluding directories meeting an expression?
Utilizing find, xargs and grep we can accomplish this task easily ...

At the command prompt:

-> find $SRCDIR/* -maxdepth 0 -type d -print | grep -v "Expression" | xargs -i mv {} $DSTDIR
Where $SRCDIR is a variable for source directory and $DSTDIR is the destination

How do I create a cab archive file?
The process is easy once you get a hold of the right tool. Get a hold of cabarc.exe which is included in the IEAK6 package here

At the command prompt:

-> cabarc N files

Your set now!

How do I send email using a telnet session?
Here is how:

-> telnet smtp.domain.tld 25 --- 220 server message
-> helo --- 250 OK
-> mail from: sender@domain.tld --- 250 OK
-> rcpt to: recipient@domain.tld --- 250 OK
-> data --- please start mail input
-> . --- finishes off your email

After the server receives the '.' character it will queue the message for delivery. Thats it!

How do I host more than one domain on one IP with apache?
Here is an example vhosts.conf file:

NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domainone.tld
ServerAlias domainone.tld *.domainone.tld
DocumentRoot /www/domainone
<VirtualHost *:80>
ServerName www.domaintwo.tld
DocumentRoot /www/domaintwo

Or something of that nature.

How do I make my subfolders in htdocs visible with apache 2?
Create a .htaccess file in that folder that has this content: Options +Indexes ;)

... will add more .. later ...