General Linux notes

Below are some useful Linux commands.

To mount a ramdisk:

mount -t tmpfs none /mnt/point

This is a cool way to share  command line session with someone on a Linux box:

1) make the remote user run screen

2) run screen -x

Using the procedure, 2 people can collaborate, and type together in the same terminal on a linux machine where 1 or both of the people are remotely sshed in and not sitting in front of the computer.

Netcat is a cool program. It is a hacker’s “Swiss Army Knife” essentially, all it does it open a network connection to the specified host at the specified port, and write data. Here’s a way to transfer files without setting up SMB/sftp/ftp/whatever else:

 push from sending side: cat backup.iso | nc 3333
receive on receiving side: nc -l 3333 > backup.iso

Set a static IP on your linux machine from the command line?:

ifconfig eth0 dstaddr netmask up

Backup local files to an rsync server:

rsync -avzPi --stats -e ssh <local files or folders> USER@IPADDRESS:<remote folder>

Set system time from the command line:

 date <date/time code>     //sets the OS time
/sbin/hwclock --systohc    //write the OS time to hardware

By: Neil Sikka

Posted On : 2011/03/26


Recent Posts


Blog Archive

WordPress Lightbox