Tags:
create new tag
, view all tags

Linux Tips

Useful Commands

uname

use this to find the current kernel revision and processor type, as well as other information

ldd

ldd filename: shows library dependencies for the executable/library specified by filename

nm

list symbols from library

ntpdate / sntp

ntpdate hostname: synchronizes time with hostname -- outdated on most systems, on opensuse use 'sntp -P no -r hostname' instead

Important Files

fstab

Defines mounted disks and other media

inittab

Defines runlevels, allows specification of the runlevel to start in. This is useful when you don't want to automatically start the X GUI.

chroot

Changes the root directory, such that a mounted drive could seem like root. For instance, if I mounted a harddrive at /mnt/sda1, 'chroot /mnt/sda1' would put me in a shell where that drive seemed like the root drive.

ifconfig

Allows network interfaces to be brought up and down, allows setting static IP addresses and modifying the MAC address of an interface.

ifup

Allows release/renewal of DHCP-assigned IP addresses, like windows's ipconfig /release or /renew

How To...

Restore a corrupted MBR with GRUB

  1. Boot the machine using a live linux version such as knoppix
    1. you might want to make sure the live CD is for the same architecture as your machine (at least 32 or 64 bit)
  2. Mount the drive

Check if a disk/file system has been corrupted

  1. The file system has to be unmounted, so if it's the root partition, you'll have to boot using a live CD distro. Otherwise, just make sure the drive is unmounted.
  2. Run fsck on the drive, ie fsck /dev/sda2

Spoof a MAC address

ifconfig eth# down
ifconfig eth# hw ether ##:##:##:##:##:##
ifconfig eth# up

DHCP

use the commands ifup, ifdown, ifstatus


-- SamPreston - 28 Apr 2007

Topic revision: r4 - 2011-03-08 - SamPreston
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback