TIPs & TRICKs

General discussion about Linux, Linux distribution, using Linux etc.
Post Reply
if
Battalion Quarter Master Havaldaar
Posts: 224
Joined: Tue Aug 13, 2002 12:52 pm
Location: Islamabad
Contact:

TIPs & TRICKs

Post by if »

Aslam-o-Aliakum,

please reply this post and send some of tip or tricks u known in linux...

e.g. 1) In linux u can run 6 x Command interface at a time and 1 x GUI...

for fast switching CTRL + ALT + F1.... F6 (6 command interface)
back to GUI CTRL + ALT + F7

2) to complete next available filename / directory name on command line

# ls r<tab> OR # cd /etc/e<tab>
# ls rpmts.h OR # cd /etc/export
if u find anything which shows my lack of knowledge,
please guide me... thx
------------------------------------
Aslam-o-Aliakum-Wa-Rahmatullah-Wa-Barakatuhu
------------------------------------
if
newbie
Company Havaldaar Major
Posts: 156
Joined: Thu Aug 08, 2002 4:18 am
Location: lahore

Re: TIPs & TRICKs

Post by newbie »

if wrote:Aslam-o-Aliakum,

please reply this post and send some of tip or tricks u known in linux...

e.g. 1) In linux u can run 6 x Command interface at a time and 1 x GUI...

for fast switching CTRL + ALT + F1.... F6 (6 command interface)
back to GUI CTRL + ALT + F7

2) to complete next available filename / directory name on command line

# ls r<tab> OR # cd /etc/e<tab>
# ls rpmts.h OR # cd /etc/export


when you give again the startx command it gives you error that X server is already running.
in that case you need to give the command

startx -- :1
and for freeing your tty for other works "startx -- :1 &"

for running the 3rd X server you need
startx -- :2
and run 6 X servers at a time.
and feel free to switch between them

by pressing alt + ctrl + f?
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

TIPS & TRICKS

Post by LinuxFreaK »

Dear Friends
Salam All.

Tips & Tricks

Ctrl + B Goes Back A Character.
Ctrl + F Goes Forward A Character.
Ctrl + K Cut All Test From The Cursor To The End Of The Line ( Not Ctrl + U ).
Ctrl + U Cut All Test From The Cursor To The Beggining Of The Line.
Ctrl + Y Paste Text.
Ctrl + P Goes Up In You History List.
Ctrl + N Goes Down In Your History List.
Ctrl + D Delete A Character ( Also Seen EOF If The Current Line Is Empty ).
Ctrl + Z Will Put A Process Running in Forground To Sleep.
* To Put Sleeping Process Running In Background Run 'bg'.
* To Kill The Sleeping Process Type 'Kill %'.
* To Put The Sleeping Process Back Into Forground Type 'fg'.
Ctrl + S Enables Scroll Lock. All Terminals Output Will Be Suspended.
Ctrl + Q Disable Scroll Lock.
Ctrl + L Clear Screen.
Ctrl + A Put Cursor At The Beggining Of The Line.
Ctrl + E Put Cursor At The End Of The Line.
Ctrl + R Search The Previous Command.
Ctrl + C Will Give You A New Prompt at Text Line.
Farrukh Ahmed
farhanksa
Subedar
Posts: 359
Joined: Sun Nov 03, 2002 6:40 am
Location: Lahore
Contact:

save ur partiton info some where

Post by farhanksa »

i had been having bad time regarding my partiton distruction and coruption
i wana to say is...go to linux shell or use any of the win based s/w to find exact starting sector and ending sector of partiton

in shell u can do it by
fdisk -l
or fdisk -l >/home/partiton_info to save the out put of the command in the file in /home directory
best way is to have print of it or write it some where safe..
another things is i use to the fat partiton using linux bcz win98 dont support to creat more than 1 primary partiton.

another tip is that u must have small partition of FAT which u always mount in linux so save things and transfer from win to linux or from linux to win
although nits possible in many other ways..but easiest way nis this one
also i suggest u to leave 1 or 2 sector between each partiton.
s7r1k3r
Battalion Quarter Master Havaldaar
Posts: 221
Joined: Wed Aug 07, 2002 3:02 pm
Location: Rawalpindi

Automounting windows (vfat) filesystems on startup.

Post by s7r1k3r »

Here is a small and useful tip. Most of us use linux and windows in a dual boot combination. We can use the mount command to mount windows file systems on linux. Example:

mount -t vfat /dev/hda1 /mnt/CDrive

Remember the first primary partition on first fixed disk is hda1. As most of us never create a secondary, third or fourth primary partition on the same harddisk so there is no hda2, hda3 or hda4. The first logical drive in the extended partition is hda5 (D drive on windows). So if you want to automount all of your windows partitions in linux when you boot into linux. Just update the /etc/fstab file with the appropriate entries. A sample:

------------------------------------------------------------------------------
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda9 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda1 /mnt/CDrive vfat defaults 0 0
/dev/hda5 /mnt/DDrive vfat defaults 0 0
/dev/hda6 /mnt/EDrive vfat defaults 0 0
-----------------------------------------------------------------------------------

And don't forget to first create the mount directories in /mnt : :x

ALLAH HAFIZ.
a10n3 s7r1k3r
tuxdost
Cadet
Posts: 1
Joined: Wed Aug 07, 2002 8:00 pm
Location: Germany
Contact:

free sectors between partittions

Post by tuxdost »

@farhanksa:

you suggested leaving 1/2 free sectors between different partitions. It sounds an interesting idea. Has anybody esle also made some good experience with this tip?

how effective is this idea in practice?
farhanksa
Subedar
Posts: 359
Joined: Sun Nov 03, 2002 6:40 am
Location: Lahore
Contact:

i used it to be on safe side

Post by farhanksa »

aoa
i use this method bcz once i lost my all 40 gb partiton table incloding fat ,ntfs, ext2
and i purchased a recovery s/w and its was asking for the startgin and ending sector of the partiton...

1 important things that sounds more prwer full is ..when u have mane distros on ur single harddisk..how u bot into them..
while i was configuring grub and lilo for addditon on sun solaris i was facing problem and i cannot remove the grub from the first sector of partition...bcz solaris loader enwraped the lilo

to be on safer side when u work low level ...it may be help ful to u soe time
if
Battalion Quarter Master Havaldaar
Posts: 224
Joined: Tue Aug 13, 2002 12:52 pm
Location: Islamabad
Contact:

Post by if »

Aslam-o-Aliakum,

at console to see current directory where u are working

#pwd

to change the prompt of console

#PS1="/u@/w"

note : /u for user and /w for working directory
if u find anything which shows my lack of knowledge,
please guide me... thx
------------------------------------
Aslam-o-Aliakum-Wa-Rahmatullah-Wa-Barakatuhu
------------------------------------
if
shaheryar786pk
Lance Naik
Posts: 18
Joined: Fri Jun 13, 2003 1:17 pm
Location: Lahore
Contact:

Post by shaheryar786pk »

At most a harddisk (HDD) can support one special partition (called Master Boot Record or MBR) and four primary partitions. You can't override this limit as it is imposed by HDD vendors.

When you install Microsoft Windows 2000 or above, it needs at least one primary partition on which it installs two file systems, one is either FAT16/32 or NTFS while other one is a swap filesystem (contained in a system file named pagefile.sys on the Windows root partition, but you can't see it normally as it is a system file).

When you install Redhat or some similar Linux then you need to provide a separate partition for swaping. thus, 2 primary partitions are consumed in the Linux installation.

At the remaining 4th primary partition you can install another Operation System (like SCO Unix 5.0.6 on my HDD) or alternately you can make it an Extended Partition. An extended partition is also a primary partition (as it can be see when you use fdisk in DOS to view partition-table, at first screen at shows all the primary partition and if you further wish to see logical partitions then it show logical partitions). A logical partition is a merely a sub-partition inside an Extended Partition.

So, don't think there never is /dev/hda2 partition. You can even see that while partitioning the HDD using Drutdisk in RedHat Linux, just see the label for DOS Extended Partition, you will see /dev/hda2 (or something similar as the partition numbers are assigned in the order of their creation so if you have create the Extended Partition at the end then the label would be /dev/hda4 rather then /dev/hda2).
Shaheryar S. Sheikh
shaheryar786pk@yahoo.co.uk
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

if wrote:to change the prompt of console

#PS1="/u@/w"

note : /u for user and /w for working directory
it's backslash, not slash: PS1="\u@\w"
zaeemarshad
Lieutenant Colonel
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Location: Islamabad
Contact:

Post by zaeemarshad »

may be not so relevant about the shell but a quick tour of configuring samba to access win shares and share linux shares. set the workgroup directive to ur domain name. set security=server and password server=(ur pdc)create shares in the smb.conf file(syntax is given there) restart samba. then do a smbuser to equalize root and administrator. u may do it for any user.

smbadduser root:administrator (smbadduser unixid:ntid)
remember to set the same password on nt and linux. now add a machine account for the linux machine to the windows domain. now u can browse shares on linux. use mount to access shares from windows
Post Reply