r3 - 10 Aug 2008 - 17:06:35 - SamPrestonYou are here: TWiki >  Main Web > ComputerTips > LinuxTips

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

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
Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions

tip TWiki Tip of the Day
Control table attributes with TablePlugin
The TablePlugin gives extra control of table display: Allows sorting Changing table properties ... Read on Read more

 
Powered by TWiki
, create new tag

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback