Linux Fast Guide: Finding Help
Linux Fast Guide: Finding Help
Linux commands are still and they will always be very useful
in a Linux system. I will try to list here, for linux beginners,
some of the most important console commands:
finding help:
mount -t msdos /dev/hdd /mnt/ddrive - Mount hard disk “d” as a msdos file system
and call it ddrive under the /mnt directory.
mount -t vfat /dev/hda1 /mnt/cdrive - Mount hard disk “a” as a VFAT file system and
call it cdrive under the /mnt directory.
find / -name ”*fname*” - Starting with the root directory, look for the file containing
the string fname
locate missingfilename - Find a file called missingfilename using the locate command
- this assumes you have already used the command updatedb (see next).
updatedb - Create or update the database of files on all file systems attached to the
linux root directory.
which missingfilename - Show the subdirectory containing the executable file called
missingfilename.
grep textstringtofind - Starting with the directory called dir, /dir look for and list all
files containing textstringtofind.
ls -laC - List all files in current directory in long format and display in columns.
Cd foldername - openfolder
rm -rf name - Kill off an entire directory and all that includes files and subdirectories.
more filetoview - Display the file called filetoview one page at a time, proceed to
next page using the spacebar.
head filetoview - Display the first 10 lines of the file called filetoview.
head -20 filetoview - Display the first 20 lines of the file called filetoview.
tail filetoview - Display the last 10 lines of the file called filetoview.
tail -20 filetoview - Display the last 20 lines of the file called filetoview.
rpm -ql package - List the files and state the installed version of the package called
package.
rpm -i --force package - Reinstall the rpm package called package having deleted
parts of it (not deleting using rpm -e).
tar -zxvf archive.tar.gz or tar -zxvf archive.tgz - Decompress the files contained in the
zipped and tarred archive called archive
./configure - Execute the script preparing the installed files for compiling.
User Administration
adduser accountname - Create a new user call accountname.
/bin - Common programs, shared by the system, the system administrator and the
users.
/ boot- The startup files and the kernel, vmlinuz. In some recent distributions also
grub data. Grub is the GRand Unified Boot loader and is an attempt to get rid of the
many different boot−loaders we know today.
/dev- Contains references to all the CPU peripheral hardware, which are represented
as files with special properties.
/etc - Most important system configuration files are in /etc, this directory contains
data similar to those in the Control Panel in Windows
/home- Home directories of the common users.
/initrd- (on some distributions) Information for booting. Do not remove!
/lib- Library files, includes files for all kinds of programs needed by the system and
the users.
/lost+found- Every partition has a lost+found in its upper directory. Files that
were saved during failures are here.
/misc- For miscellaneous purposes.
/mnt- Standard mount point for external file systems, e.g. a CD−ROM or a digital
camera.
/net- Standard mount point for entire remote file systems
/opt- Typically contains extra and third party software.
/proc- A virtual file system containing information about system resources. More
information about the meaning of the files in proc is obtained by entering the
command man proc in a terminal window. The file proc.txt discusses the
virtual file system in detail.
/root- The administrative user's home directory. Mind the difference between /, the
root directory and /root, the home directory of the root user.
/sbin- Programs for use by the system and the system administrator.
/tmp- Temporary space for use by the system, cleaned upon reboot, so don't use this
for saving any work!
/usr- Programs, libraries, documentation etc. for all user−related programs.
/var- Storage for all variable files and temporary files created by users, such as log
files, the mail queue, the print spooler area, space for temporary storage of files
downloaded from the Internet,or to keep an image of a CD before burning it.
/etc/fstab - List of devices and their associated mount points. Edit this file to add CD-
ROMs, DOS partitions and floppy drives at startup.
/etc/mtools.conf - Configuration for all the operations (mkdir, copy, format, etc.) on a
DOS-type filesystem.
/etc/crontab - Lists commands and times to run them for the cron deamon.
/etc/cron.* - There are 4 directories that automatically execute all scripts within the
directory at intervals of hour, day, week or month.
/etc/group - Similar to /etc/passwd but for groups rather than users.
/etc/gshadow - Used to hold the group password and group administrator password
information for shadow passwords.
/etc/hosts - A list of all known host names and IP addresses on the machine.
/etc/inittab - Specifies the run level that the machine should boot into.
/etc/smb.conf - Config file for the SAMBA server. Allows file and print sharing with
Microsoft clients.
/etc/passwd - The user database with fields giving the username, real name, home
directory, encrypted password and other information about each user.
/etc/rc.d/rc0.d - Contains files used to control run level 0. Usually these files are
softlink files.
/etc/rc.d/rc1.d - Contains files to control run level 1. Scripts beginning with an S are
for start, K for kill.
/proc/cpuinfo - Information about the processor such as its type, make and
performance.
/proc/dma - Shows which DMA channels are being used at the moment.
/proc/filesystems - Filesystems that are configured into the kernel. The file used to
detect filesystems if the /etc/filesystems does not exist.
/proc/interrupts - Shows which interrupts are in use and how many of each there have
been.
/proc/kmsg - Messages output by the kernel. These are also routed to syslog.
/proc/self - A symbolic link to the process directory of the program that is looking at
/proc. When 2 process look at proc, they get different links.
/proc/stat - Various statistics about the system such as the number of page faults since
the system was booted.
now u have the kernel do all this in local dirctory ( dirctory with linux file system)
1.gzip -dc linuxkernel-2.x.x-x.gz.tar | tar xvf -
or //here u extracting your kernel
bzip2 -cd dc linuxkernel-2.x.x-x.bz2.tar | tar xvf -
2. "cd liunuxkernel-2.x.x-x/"
3. "make menuconfig" (or xconfig or gconfig in the grafical user interface) do what
ever u want here . //chossing the kernel setting
4. Esc and save your setting
5. "make" //building your kernel it wel take some time
6. "make modules_install" //installing the modules in your kernel
7. stell in the linux kernel folder
8. "cp arch/i386/boot/bzImage /boot/" here u must chosse your arch folder i.e for
amd64 that well be "cp arch/x86_64/boot/bzImage /boot/ " or whatever.//here u
copy your kernel "bzImage" it,s your kernel to the /boot dirctory
9. "cd /boot/"
10."mv bzImage vmlinuz-2.x.x-x" //here u rename your kernel
11."mkinitrd" //u build the kernel initial now for this we
renamed the kernel
12."cd grub/" //now we well configure grub boot loader
13."vi menu1st" // vi is a text editor
14.press i
15.now write thier lines ,those one that describe linux kernel locaion and the initial
location then change the bath for your kernel location(vmlinux-2.x.x-x) and the
initial path (initrd-2.x.x-x )
16.when u finish check what u did and press Esc
17.":wq" //saving the changes that u made in the text file "menust1"
18."reboot"
19.have fun with your kernel .