Click to See Complete Forum and Search --> : Insert tip here <------


Pages : [1] 2

Elijah
10-30-2002, 12:47 AM
if you want to go to command line fast -
ctr+alt F5
to go back to gui -
ctr+alt F7

have the command line finish what you type-
(for example you have a command 'evolution')
evolu (press tab)

insert more here
|
|
|
\ /

yolkmeister
10-30-2002, 02:29 AM
have the command line finish what you type- (for example you have a command 'evolution') evolu (press tab)

The tab key matches only to the first *unique* filename, so if you hit the tab key and it does not autocomplete, hit it twice to get a list of all matching possiblities. For example:

cp r<TAB> will only complete if you have one file starting with "r"

cp r<TAB><TAB> will show all files starting with "r", like this:

run rpm rutabega rpc resolv.conf

Greg

bskahan
10-30-2002, 02:50 AM
there are generally 6 virtual console Ctrl-alt-F5 will get you to the fifth one.

ctrl-alt-[1 through 6] (from X) or alt-[ 1 through 6 ] (from another console) or alt-left/right (also from another console)

locate foo finds all files on your computer whos name contains foo. locate -r '[fF]oo' uses regex match to limit results (this one finds all foo or Foo).

Elijah
10-30-2002, 03:48 AM
Originally posted by bskahan

locate foo finds all files on your computer whos name contains foo. locate -r '[fF]oo' uses regex match to limit results (this one finds all foo or Foo).

as root, type 'updatedb' for the command 'locate' to recognize new files and it's location

godzakka
10-30-2002, 04:01 AM
'history' allows you to see all the commands you types into the console so far.

'dmesg' lets you see alot of sometimes helpful info about your computer

'|more' lets you go a page at a time, with 'f' being forward one whole page at a time.

'xf86cfg' allows you to see a very simple and powerful graphical interface to help you in setting up TV-out, dual monitors, and how your screens are configured (left to right, right to left, top and bottom, etc).

Elijah
10-30-2002, 04:46 AM
using "| less" may also work when getting page to page output from the terminal

in kde: ctrl+esc shows the processes going on, you may kill some if you want :cool:
ps -A also works the same
kill pid pid - process id
also "top"


put root to sleep:
while compiling or doing other running tasks in root type "ctr+z" to let it sleep for awhile, type "fg" (foreground) to wake up root.

mrBen
10-30-2002, 05:14 AM
Use grep to slim down those search results:

ps -aux | grep cupsd (see if cupsd is running)

rpm -qa | grep xbill (see if xbill is installed)

locate *.xpm | grep gnome (find where the gnome graphics are installed)


Disclaimer: There are probably flags to check some of these things automatically, but why learn 3 flags for 3 commands, when you can just use one easy command?

Grep is your friend ;)

bwkaz
10-30-2002, 03:43 PM
If you know you've typed in something long and tedious before (like, for example, wine --winver=win2000 -- radmin.exe -connect pc185 -through drawform.com), but it's been a while, so you don't want to hold down the up arrow (which will scroll back through previous commands) for a long time, just hit Ctrl-R, and type in something that's in the command (in this case, "radmin" should work well). Ctrl-R puts bash into reverse-string-match mode, where it will look backwards through the history for a string matching what you type, as you type it.

Also, I always edit my ~/.bash_profile (or /etc/profile, whichever) to export HISTSIZE=10000 ; export HISTFILESIZE=50000

The HISTSIZE variable tells bash to remember 10,000 lines before either throwing them away or writing them to the history file (~/.bash_history -- I don't know if it writes them, or dumps them). The HISTFILESIZE variable gives bash a limit on the number of lines in that history file. Once that number gets passed, the first lines are deleted to make room.

The default for HISTSIZE is something like 100, and HISTFILESIZE is like 1000. Much too small for me, personally.

Hayl
10-30-2002, 03:47 PM
TIP: Search www.google.com/linux, read the NHFs, and search the forums before posting :)

Elijah
10-30-2002, 05:56 PM
Originally posted by bwkaz
If you know you've typed in something long and tedious before (like, for example, wine --winver=win2000 -- radmin.exe -connect pc185 -through drawform.com), but it's been a while, so you don't want to hold down the up arrow (which will scroll back through previous commands) for a long time, just hit Ctrl-R, and type in something that's in the command (in this case, "radmin" should work well). Ctrl-R puts bash into reverse-string-match mode, where it will look backwards through the history for a string matching what you type, as you type it.

[/B]
wow I didn't know that one, I'll experiment with it, Thanks :cool:

bwkaz
10-30-2002, 07:03 PM
There's also a forward-search keystroke you can use, but I don't remember what it is. I have to read the bash manpage (readline section) to figure it out whenever I need it...

mdwatts
10-30-2002, 08:45 PM
Originally posted by Cybr099
TIP: Search www.google.com/linux, read the NHFs, and search the forums before posting :)

That's a good one. I would never have thought of that. :p

Elijah
10-30-2002, 09:01 PM
it isn't much:

ctrl+F1 to F* - change to another virtual desktop

gleather
10-30-2002, 09:10 PM
forward-search for history is Control-S, but that and Control-R might only work for VISUAL=emacs.

bwkaz
10-31-2002, 12:14 AM
But doesn't Ctrl-S suspend the current process?

fancypiper
10-31-2002, 12:26 AM
In the command line, use the well kept secret of mc (midnight commander), with a file manager, extractor, installer, editor ftp, and probably lots more handy tools I haven't used yet.

You can do the normal linux copy/paste with the mouse from one virtual terminal to another if gpm is installed and not disabled by left clicking and swiping text in one, alt-FN to switch to the virtual terminal you wish to paste into, and middle click will paste the text that was swiped in the first virtual terminal into the file at the blinking cursor position.

Make your own commands with an alias in your .bashrc file:
# Power down/reboot
alias off='shutdown -h now'
alias boot='shutdown -r now'

# For Redhat editor because I forget which one I use in which distro
# alias pico='pico -w'
# alias nano='pico -w'

# For Gentoo editor because I forget which one I use in which distro
alias pico='nano -w'
alias nano='nano -w

X_console
10-31-2002, 01:57 AM
Here's one. Compile links with the graphics support and you can browse really fast. Nice for slower machines with X support:

links -g

Has JavaScript and pictures too. :)

gleather
10-31-2002, 11:22 AM
Control-Z suspends a process. You then usually bg and do something else.

bwkaz
10-31-2002, 12:21 PM
Hmm... I wonder if my bash is screwy then. Whenever I hit Ctrl-S, bash stops doing anything, and I've got to either kill it or kill the Eterm that it's running in. Well, whatever.

slapNUT
10-31-2002, 02:33 PM
Hmm... I wonder if my bash is screwy then. Whenever I hit Ctrl-S, bash stops doing anything, and I've got to either kill it or kill the Eterm that it's running in. Well, whatever.
<Ctrl><s> is like a pause to bash.
Just hit <Ctrl><q> and you will be OK.

Here's one. Compile links with the graphics support and you can browse really fast. Nice for slower machines with X support:

links -g
Woah! I nominate this one for the "Tip-of-the-Day"

:cool: Links with graphics! :cool:

Elijah
10-31-2002, 09:34 PM
Originally posted by X_console
Here's one. Compile links with the graphics support and you can browse really fast. Nice for slower machines with X support:

links -g

Has JavaScript and pictures too. :)
don't anyone move! I've gotta try that :D

MMA
11-01-2002, 06:11 AM
Top tip THINK ABOU WHAT YOUR DOIN, EXPERIMENT, LEARN FROM MISTAKES.




PS: i justed to subscribe to this thread to keep an eye on all the tips :D

Elijah
11-01-2002, 06:41 AM
to print your man pages:
man <manpage> | col -b | lpr
I've found this tip somewhere...
I've tried it and get some funny prints ... but it works!

Elijah
11-01-2002, 06:42 AM
view your bootup messages:
dmesg

Elijah
11-01-2002, 06:47 AM
tired of the 'clear' command to clear your screen?
ctr+l

MMA
11-01-2002, 07:54 AM
edit your .bashrc to make your own customised bash prompt

slapNUT
11-01-2002, 04:43 PM
alias path='echo -e ${PATH//:/\\n}'

Put that in .bashrc for a really :cool: way to display your path.

Just edited your .bashrc and want to check out your fancy new alias or a new prompt? Don't logout and login! Just do this to immediately update your user settings:
. ~/.bashrc
Also works if you edit .bash_profile
. ~/.bash_profile

Elijah
11-02-2002, 06:22 AM
useful linux links:
http://www.edge-op.org/links1.html
www.google.com/linux (hehe)

Elijah
11-02-2002, 06:33 AM
if you want to lock a directory so that no user will be able to access or 'ls' to that dir do this:
chmod 000 dir/
root will still be able to access that though, to turn off the lock, simply put back the permissions to 777 or whatever ...

of course this is obvious, but is still good for locking up private files ;)

MMA
11-02-2002, 07:23 AM
OK you know that you brother/sister/parents/whoever use WinXP, you can't access there files becuase of the new NTFS security, right?

So go into linux, mount the drive (obviously read only) and then you can nose around :D

HHHEEHEHEHEHHAHAHAHAHAHAHAHAH :D :D :D :cool: :cool: :cool:

Elijah
11-09-2002, 06:31 AM
import myscreenshot.jpeg

then use your mouse to create a margin of the area you want to take a sc. shot.

sharth
11-14-2002, 12:03 AM
xmms-shell :)

/etc/init.d/xdm stop to actually kill your x display manager (change it around so you are going to the right directory.)

for virutal consoles, sometimes you need to hold alt in the switch.

mp32ogg is fun :)

teeitup
11-14-2002, 12:17 AM
the command script

If your trying to get compile a program and get errors and the errors fly by so you can't capture them.

If you want to create a document of some task that your doing at the command line try script

script will start an interactive session and create a transcript of the entire session when you exit. The output will be written to a file named typescript

man script

very cool :cool:

sk606
11-14-2002, 02:30 AM
someone mentioned customizing your bash prompt. i second that! you can make it way more useful! here's a really good how-to
http://www-106.ibm.com/developerworks/linux/library/l-tip-prompt/

rbermejo
11-14-2002, 09:45 PM
for i in `lynx -dump http://www.ugu.com/sui/ugu/show?tip.today|tee .ugutemp| grep -n "NOTE:" |cut -d: -f1`
do head -$i .ugutemp
done| grep -v "\[" | grep -v "NOTE:"

Take note how to use lynx to dump text into a file;



The world into your scripts........
:D

Vlad902
11-14-2002, 09:57 PM
Originally posted by slapNUT
alias path='echo -e ${PATH//:/\\n}'

Put that in .bashrc for a really :cool: way to display your path.

Just edited your .bashrc and want to check out your fancy new alias or a new prompt? Don't logout and login! Just do this to immediately update your user settings:
. ~/.bashrc
Also works if you edit .bash_profile
. ~/.bash_profile

also:
source ~/.bashrc
works:)

busa_blade
11-14-2002, 10:24 PM
ctrl-alt-backspace to restart X

bwkaz
11-15-2002, 03:01 PM
Well, ctrl-alt-backspace will kill X, not restart it. If your distro sets up inittab the right way, then X can be set up to restart whenever it dies, so if that's what's going on, then ctrl-alt-backspace will indeed restart X. But if not, if you're in runlevel 3 for example, then ctrl-alt-backspace won't restart anything, just kill the X that's already running.

;)

slapNUT
11-15-2002, 09:11 PM
Has anyone posted this goodie yet? It's my favorite!
finger @kernel.org

MMA
11-16-2002, 05:49 AM
Originally posted by slapNUT
Has anyone posted this goodie yet? It's my favorite!
finger @kernel.org

Please explain. What does finger do?

Elijah
11-16-2002, 06:24 AM
I've tried it and printed some kernel versions, pretty cool ... me thinks it's some kind of user query thing on a network.

man finger ;)

carbonate
11-16-2002, 03:27 PM
If you want to cut off all ICMP ECHO requests you don't need to mess with iptables or anything,
Just ;
issue the following,

#echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

All ICMP echo packages are ignored from now on.

You have to issue this command everytime your kernel is rebooted, putting this line into /etc/rc.local (might be other file if it's not RH) file will automaticly make it start everytime the machine is rebooted.

Dun'kalis
11-16-2002, 07:25 PM
Append text to the end of a file:

cat >> filename

The Most Quoted Pipe In The World:

who | wc -l

tells you how many users are logged in.

wc is an awesome tool, especially in combination with sed.

I'm gonna hope this command works:

cat filename | sed -e 's/word//' | wc -w

This *should* remove all instances of 'word' and then count the number of words left. Its actually quite useful.

This is where sed is awesome. I do this to keep an original around:

cp filename.py filename.py.backup
sed -e 's/idmp3/id3read/' \ filename.py.backup > filename.py

regexps are your friend. Learn them.

I haven't had access to a Linux box in a while, so...

Vlad902
11-16-2002, 08:19 PM
To write a *new* file (it will overwrite files beware!) do:

cat > filename


Then type what you want in there. Then when you're done press CTRL+D and there you go!

Shelton
11-18-2002, 10:17 PM
Hi

Here is a small list from a newbie to new newbies:

1. use ALT and F2 (together) to quickly run an application eg ALT F2 and enter Kmail into prompt will bring up KMail.

2. Cntrl and Escape to look at all your process running and sleeping (very handy)

3. When copying text, just highlight with the mouse over text and point to required place to paste then press the center button on mouse (too easy! and handy!)

4. Always place your new applications you install in the /usr/local/bin directory

5. The gear icon represents your .exe files in Linux and most can be found in
/usr/bin
and
/usr/sbin

Any others have any nice tips or would like to comment on these, please do so!

Cheers,
Shelton.

Dun'kalis
11-20-2002, 10:51 PM
Those are KDE only tips. Except for the installation, but thats the default on most ./configures and RPMs.

ldconfig. If you install a library and it can't be found, run this! It should work afterwards.

adamrobbie
11-22-2002, 03:12 AM
When you're at your comp typing or fragging away and you're thirsty.
Keep a frig next to your rig.
It'll help cool your rig and a convient source of soda
:=-)

buttercrunch
11-22-2002, 04:16 AM
:D

phlipant
11-22-2002, 05:01 AM
If you know you've typed in something long and tedious before (like, for example, wine --winver=win2000 -- radmin.exe -connect pc185 -through drawform.com), but it's been a while, so you don't want to hold down the up arrow (which will scroll back through previous commands) for a long time, just hit Ctrl-R, and type in something that's in the command (in this case, "radmin" should work well). Ctrl-R puts bash into reverse-string-match mode, where it will look backwards through the history for a string matching what you type, as you type it.




!w would work more easily
! followed by a letter recalls the last command
starting with that letter. if an intervening command has a w, !wine will recall the last command with wine.

EugeneTSWong
11-22-2002, 05:40 AM
When you want to logout, then type <Ctrl><D> and you'll save yourself 2 or more keystrokes. Does anybody know anymore <Ctrl> key combinations?


Edit: I just went through all the <Ctrl> key combinations, & think that I've found them all, but I would still prefer a list of all of them. Does anybody know of a list off of the top of their head? I could do a Google search, so don't go too far out of your way.

NeoB
11-22-2002, 06:41 AM
Getting around a samba permissions and su-ing to root i use Netraverse Win4Lin.

This allows me to run any M$ apps that wine can't handle and i save any network files to "My Documents" which is a symlink to my home folder.

The files is saved with all the correct permisions and i did'nt even go near root.

It seems to make my life (at work) easier.

Cip
11-22-2002, 06:57 AM
Originally posted by MMA
OK you know that you brother/sister/parents/whoever use WinXP, you can't access there files becuase of the new NTFS security, right?

So go into linux, mount the drive (obviously read only) and then you can nose around :D

HHHEEHEHEHEHHAHAHAHAHAHAHAHAH :D :D :D :cool: :cool: :cool:

Also if you have a pdf document on your Windows partition that has print disabled just look at it from Linux and you can print it.

afterthefall
11-25-2002, 07:37 AM
Add the following to your ~/.fluxbox/menu file (works well with keys and init, but don't do it with the slitlist because the changes won't stick).
[exec] (Edit Menu) {gvim ~/.fluxbox/menu}

wterm can do tinting, just use -tr and -bg at the same time.

Use mterm in your slit/dock/whatever to have instant commandline access.

Type "wtf is grep" and get a real answer. ("wtf is wtf" is pretty informative too.)

Learn vi. You can manipulate text files faster at the command line with vi than you can with any other editor, with the exception of gvim. vi's keybindings are rediculously fast once you learn them.

-Brian :D

danrees
11-25-2002, 07:51 AM
Wow, for anyone who has missed this in the earlier post links -g is great!

BaudBandit
11-25-2002, 08:34 AM
I think there should be a tips forum:D :D :D

MMA
11-25-2002, 09:50 AM
I would appreciate, i'm sure others too. If people would explain what there tips do along with the tip :D:D makes things a lot easier :D:D:D

Chs
11-25-2002, 01:41 PM
If u what to empty the boot record completly, maby u delete all files at the hd, but if u what to format it and i dont work, then u can use this program:

Take a Win98 startdisc and start from it, run debug

Write EXACLY as it says:

A 100
INT 13

RAX
0301
RBX
0200
F 200 L 200 0
RCX
0001
RDX
0080
P
Q

This writes 0 at the disks first 512 bytes, if u what the second drive, change 0080 to 0081

WARNING: I DONT KNOW REALY SURE WHAT THIS DOES! I THINK IT JUST DELETES THE MBR! I DONT TAKE ANY RESPONSABILITY AT ME!

Have a nice day!

//linuxCommand

bwkaz
11-25-2002, 03:44 PM
Originally posted by phlipant
!w would work more easily
! followed by a letter recalls the last command
starting with that letter. if an intervening command has a w, !wine will recall the last command with wine. I did not know that. Thanks! :)

ferreter
11-26-2002, 04:35 PM
Originally posted by godzakka
'history' allows you to see all the commands you types into the console so far.

'dmesg' lets you see alot of sometimes helpful info about your computer

'|more' lets you go a page at a time, with 'f' being forward one whole page at a time.

'xf86cfg' allows you to see a very simple and powerful graphical interface to help you in setting up TV-out, dual monitors, and how your screens are configured (left to right, right to left, top and bottom, etc).

After using the history command say you see a command you want to execute listed as the 17th item, simply type !17 to execute the command.

EDIT: Crap, should have read through the whole thread :)

phlipant
11-26-2002, 04:53 PM
you may have hit the ground on this one, but everyone is now typing the command history to realize how much easier it is to scroll through than the term window or using up arrow

Vlad902
11-26-2002, 09:36 PM
pico -m in X allows you to click ;)

Elijah
11-27-2002, 12:11 AM
the ctrl + r tip is a good one ... :)


keep 'em coming :D

sharth
12-04-2002, 06:16 PM
Originally posted by Chs
If u what to empty the boot record completly, maby u delete all files at the hd, but if u what to format it and i dont work, then u can use this program:

Take a Win98 startdisc and start from it, run debug

Write EXACLY as it says:

A 100
INT 13

RAX
0301
RBX
0200
F 200 L 200 0
RCX
0001
RDX
0080
P
Q

This writes 0 at the disks first 512 bytes, if u what the second drive, change 0080 to 0081

WARNING: I DONT KNOW REALY SURE WHAT THIS DOES! I THINK IT JUST DELETES THE MBR! I DONT TAKE ANY RESPONSABILITY AT ME!

Have a nice day!

//linuxCommand The first 512 bytes of the hard-drive are the mbr. however, a fdisk /mbr usually fixes any problems you are having. One step under assembly, binary :) Thats basically what I virus could do to piss people off :) I think you can also copy that and put it in a .com file on windows and it *should* do the same thing... now i wonder if anyone wants to try it.

matt95z
12-05-2002, 06:50 PM
If you can't get X to work use lynx to browse the forums and look for help.

fancypiper
12-05-2002, 07:29 PM
Originally posted by matt95z
If you can't get X to work use lynx to browse the forums and look for help. I use links instead. :D

Joe_Atlanta
12-13-2002, 03:56 AM
Originally posted by fancypiper
In the command line, use the well kept secret of mc (midnight commander), with a file manager, extractor, installer, editor ftp, and probably lots more handy tools I haven't used yet. Holy Bob! (http://www.subgenius.com/) This is great, suddenly the terminal ain't so scarey, like finally getting the old dosshell . A real saviour for us folks who work better with a visible directory structure. Thanks!

ferreter
12-13-2002, 12:51 PM
Here's a silly tip, If your going to run bastille via ncurses you have to have the perl-ncurses package or it doesn't work. (took me all night to figure that out darn it)

Elijah
12-15-2002, 06:27 PM
Originally posted by ferreter
Here's a silly tip, If your going to run bastille via ncurses you have to have the perl-ncurses package or it doesn't work. (took me all night to figure that out darn it)
bastille doesn't work for me ... yet. Is it good as guarddog (what I'm currently using just now)? I think I've still got those tarballs hanging around somewhere, it's not that very big on my todo list

fancypiper
12-15-2002, 11:54 PM
But you keep getting those stupid error messages. :mad: Sound familiar?

Try it this way:[phil@fancypiper phil]$ xhost +local:
non-network local connections being added to access control list
[phil@fancypiper phil]$ su -
Password:
[root@fancypiper root]# export DISPLAY=:0.0
[root@fancypiper root]# Now you can run that killer gui app as root from your user's account and point and click to your heart's content :D

You have the terminal to watch for error messages as well. :cool:

I suggest using one virtual desktop for this so you will get used to using extreme caution on that desktop. Check, double check and recheck before clicking. You have been warned! :D

MMA
12-16-2002, 09:45 AM
Originally posted by fancypiper
But you keep getting those stupid error messages. :mad: Sound familiar?

Try it this way:[phil@fancypiper phil]$ xhost +local:
non-network local connections being added to access control list
[phil@fancypiper phil]$ su -
Password:
[root@fancypiper root]# export DISPLAY=:0.0
[root@fancypiper root]# Now you can run that killer gui app as root from your user's account and point and click to your heart's content :D

You have the terminal to watch for error messages as well. :cool:

I suggest using one virtual desktop for this so you will get used to using extreme caution on that desktop. Check, double check and recheck before clicking. You have been warned! :D


After you do this, is it perminent? :D:D

PS: THNX maaann. I saw this somehwere in LNO and tried searching but i get loads of bull****, THNX for that :D:D:D:D

ferreter
12-16-2002, 02:14 PM
Originally posted by Elijah
bastille doesn't work for me ... yet. Is it good as guarddog (what I'm currently using just now)? I think I've still got those tarballs hanging around somewhere, it's not that very big on my todo list

I haven't tried guarddog yet myself so I couldn't tell you. I do know that bastille has been around for a while and does do a decent job of some hardening tasks.

MMA
12-16-2002, 02:18 PM
could some one please give me a quick explanation of what guarddog/bastille is.

I already posted saying people should explain what there tip does :D:D:D:D

Really appreciate it :D:D

red_over_blue
12-16-2002, 02:40 PM
Here's a trick (needs broadband)

1. First, ensure you have xmms installed with the mpeg layer 1,2,3 plugin.

2. Go to www.shoutcast.com (or any other streaming audio site) and get some streaming audio going (just click "tune in" and then open with xmms)

3. In XMMS: options - preferences - audio I/O - mpeg layer 1,2,3 player - configure - streaming

4. Enable "save stream to disk" and pick the path of a nice fat directory to save to MP3 stream to.

5. Now, press play again on xmms and it will start recording the stream.

6. The fun part... at the CLI, type the following:

at now + 500 minutes

and press enter. You should get another "command prompt" for at, and type:

killall -9 xmms

and press enter. Now do a

ctrl-d

To tell "at" that you are finished.

Then go to sleep. When you wake up, you will have a 500 minute MP3 that you can burn to a CD.

I also used the "at" command, left a blank CD-R in the drive, and had the disk burned for when I woke up!

ferreter
12-16-2002, 02:45 PM
Originally posted by MMA
could some one please give me a quick explanation of what guarddog/bastille is.

I already posted saying people should explain what there tip does :D:D:D:D

Really appreciate it :D:D

Bastille-linux is a system hardening tool which will automate tasks such as:
restricting local logon to non-root
set default umask settings
create a firewall w/ monitoring
and many other things

Guarddog I think is just for creating a firewall rule set, not certain if it does anything else.

MMA
12-16-2002, 02:47 PM
Now thats smart :D:D:D

Great tip, THNX :D

fancypiper
12-16-2002, 02:48 PM
Originally posted by MMA
After you do this, is it perminent? :D:D
It's permanent as long as the x terminal stays open. :p

If you have to kill X for some reason or have a power outage or reboot, etc., you will have to do it again.

I reboot my machine when I:

1. Compile a new kernel
2. Install new hardware

So, I seldom have to do it.

I keep a commands file full of handy things I discover browsing this board and made a menu launcher for that file in gnp, my favorite X text editor, then I copy and paste the commands into the x terminal.

If you log in to the command line and use the startx command, you can put the user's command in a file .xinitrc. Here is mine for reference:# fancypiper Gentoo uilleann box user phil .xinitrc file
#exec kde
xhost +local:
#exec gnome-session
exec xscreensaver &
exec gkrellm -w &
exec fluxbox
Alter to fit your desire.

I think you can do something with .bash_profile or .bashrc or in the root account, but I haven't bothered to do it.

Hint: Try playing with that command in one of those files and see what happens. Then you give your tip for making the root's command permanent on re-boot. ;)

Of course, always rename your original dotrc file to something like orig.bashrc so you can fix it back if it breaks something. :eek:

MMA
12-16-2002, 02:48 PM
Originally posted by ferreter
Bastille-linux is a system hardening tool which will automate tasks such as:
restricting local logon to non-root
set default umask settings
create a firewall w/ monitoring
and many other things

Guarddog I think is just for creating a firewall rule set, not certain if it does anything else.

THNX, are they GUI? becuase i don't know much about firewalls in Linux :D:D

hecresper
12-16-2002, 03:07 PM
I used this little shell script while building LFS a while back:

for i in ./*.tar
do
tar -xvf $i
done

I wanted to un-tar everything in one step. Someone on the lfs-mailing list gave it to me. :)

slapNUT
12-16-2002, 03:43 PM
Suppose you want to rename all .txt files to .doc
cat ~/bin/ext
#!/bin/bash
for i in *.$1
do
NEW=`echo $i|sed 's/\..*$//'`.$2
mv $i $NEW
done


I call it like this:
$ ls
a.txt b.txt c.txt d.txt
$ ext txt doc
$ ls
a.doc b.doc c.doc d.doc

<edit> Sorry that was an early version of the script, it would clobber files with more than one extension, hehehe.

#!/bin/bash
for i in *.$1
do
NEW=`echo $i|sed "s/\."$1"$//"`.$2
mv $i $NEW
done

With this one the file can have as many extensions as you like and it only works on the last one.

chris_i386
12-16-2002, 04:12 PM
I use this script to have a killall workalike for my university account:

#!/bin/sh
if [ $# -ne 1 ] ; then
echo " usage: kick process-name"
exit 1
fi
kill -9 `ps -e | grep $1 | cut -c2-7`


You can save it to a file named kick in your home-directory, and make it executable: chmod 700 kick

If Netscape happens to lock up again, you simply type
~/kick netscape

You can also type xkill in a terminal and then click on the app that has locked up, but that doesn't work over telnet etc.

SonicSnoop
12-17-2002, 10:55 PM
One thing I like to do is paste this into my /etc/profile file:

DEFAULT="\[\033[0;0m\]"

BLACK="\[\033[0;30m\]"
BLUE="\[\033[0;34m\]"
GREEN="\[\033[0;32m\]"
CYAN="\[\033[0;36m\]"
RED="\[\033[0;31m\]"
PURPLE="\[\033[0;35m\]"
BROWN="\[\033[0;33m\]"
LGRAY="\[\033[0;37m\]"

DGRAY="\[\033[1;30m\]"
LBLUE="\[\033[1;34m\]"
LGREEN="\[\033[1;32m\]"
LCYAN="\[\033[1;36m\]"
LRED="\[\033[1;31m\]"
LPURPLE="\[\033[1;35m\]"
YELLOW="\[\033[1;33m\]"
WHITE="\[\033[1;37m\]"


then I can set up my PS1's using $WHITE or what ever color I want through out my Command prompt and just add $DEFAULT at the end so the text you type isnt colored.

Elijah
12-17-2002, 11:05 PM
Originally posted by SonicSnoop
One thing I like to do is paste this into my /etc/profile file:

DEFAULT="\[\033[0;0m\]"

BLACK="\[\033[0;30m\]"
BLUE="\[\033[0;34m\]"
GREEN="\[\033[0;32m\]"
CYAN="\[\033[0;36m\]"
RED="\[\033[0;31m\]"
PURPLE="\[\033[0;35m\]"
BROWN="\[\033[0;33m\]"
LGRAY="\[\033[0;37m\]"

DGRAY="\[\033[1;30m\]"
LBLUE="\[\033[1;34m\]"
LGREEN="\[\033[1;32m\]"
LCYAN="\[\033[1;36m\]"
LRED="\[\033[1;31m\]"
LPURPLE="\[\033[1;35m\]"
YELLOW="\[\033[1;33m\]"
WHITE="\[\033[1;37m\]"


then I can set up my PS1's using $WHITE or what ever color I want through out my Command prompt and just add $DEFAULT at the end so the text you type isnt colored.

I use alias in my 'ls' to have --color option in it then save it to my profile

Elijah
12-17-2002, 11:14 PM
The LOST project (Linux one stanza tips), can be useful in your email. Contains losta tips.

http://lost.sourceforge.net/LOST/info-intro.php

chitown
12-18-2002, 01:31 PM
being a newbie and all.......

my tip is read the documentation you get with the program

readme or install for install problems or changelog for the new updates.

it helped me a bunch of times woth lib needs etc.......

Ludootje
12-23-2002, 07:47 AM
Originally posted by X_console
Here's one. Compile links with the graphics support and you can browse really fast. Nice for slower machines with X support:

links -g

Has JavaScript and pictures too. :)
I can't get that to work... I've did ./configure --help, but didn't see any option to compile graphics into links. When I do links -g with the links I have from a deb, it tells me 'g' is an unknown option... Could you please elaborate on how to compile it into links?

Ludootje
12-23-2002, 07:59 AM
Originally posted by MMA
After you do this, is it perminent? :D:D

PS: THNX maaann. I saw this somehwere in LNO and tried searching but i get loads of bull****, THNX for that :D:D:D:D
You can add the first part (for the user) in the user's ~/.bashrc, and the part for root in root's ~/.bashrc, because otherwise it isn't permament.

Ludootje
12-23-2002, 08:18 AM
Originally posted by Elijah
import myscreenshot.jpeg
then use your mouse to create a margin of the area you want to take a sc. shot.

or type this:
import -window root screenshot.png
to have a screenshot of the entire desktop, and in a much better format (png >>> jpg)

Ludootje
12-23-2002, 08:22 AM
Originally posted by slapNUT
Has anyone posted this goodie yet? It's my favorite!
finger @kernel.org
finger @kernel.org | grep "latest stable"
is useful too

geekgirl21
12-23-2002, 10:30 PM
Originally posted by bwkaz
There's also a forward-search keystroke you can use, but I don't remember what it is. I have to read the bash manpage (readline section) to figure it out whenever I need it... \

Up arrow key = CTRL-P[revious]=go backwards
Down arrow key = CTRL-N[ext]=go forwards

slapNUT
12-23-2002, 10:53 PM
Posted by Ludootje
I can't get that to work... I've did ./configure --help, but didn't see any option to compile graphics into links. When I do links -g with the links I have from a deb, it tells me 'g' is an unknown option... Could you please elaborate on how to compile it into links? Try ./configure --enable-graphics

geekgirl21
12-23-2002, 10:59 PM
1. Type morse in the command prompt. Hit <ENTER>
2. Type in the word "newbie". Hit <ENTER>
3. Your results should be:
daw dit,
dit,
dit daw daw,
daw dit dit dit,
dit dit,
dit,
daw dit dit dit daw,

which is "newbie" in Morse Code.

Try the same process with rot13. Your results should be:
arjovr

(Rot13 rotates your letter to 13 letters after it. a = n, b = o, c = p, and so on.)

Useless, but neat tips.

JThundley
12-24-2002, 03:21 AM
morse doesn't work. Sounds like something fun and useless though, where can I download it / get it to work?

Ludootje
12-24-2002, 08:36 AM
Originally posted by slapNUT
Try ./configure --enable-graphics
Thanks man, really appreciate it. I'll definitely try that out.

Ludootje
12-24-2002, 08:41 AM
Originally posted by JThundley
morse doesn't work. Sounds like something fun and useless though, where can I download it / get it to work?
It's part of the bsdgames package IIRC. Look for bsdgames on freshmeat.net or google.com/linux

geekgirl21
12-24-2002, 09:09 AM
morse is part of a games package (http://www2.cddc.vt.edu/linux/games/bsd-games-2.11.lsm). Before you download (http://www2.cddc.vt.edu/linux/games/bsd-games-2.11.tar.gz), be sure you have ncurses (ftp://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.2.tar.gz) installed on your machine.

DISCLAIMER: You're downloading these packages at your own risk, and I have no responsibility over what you do to your machine.

That said, enjoy!

tzimsce
12-24-2002, 12:30 PM
Originally posted by Elijah
as root, type 'updatedb' for the command 'locate' to recognize new files and it's location

um, why was "locate" not written to find stuff that is REALLY on the system?

tzimsce
12-24-2002, 12:34 PM
Originally posted by Cybr099
TIP: Search www.google.com/linux, read the NHFs, and search the forums before posting :)

Ever heard of "reinventing the wheel"? If all the auto manufacturers sat around learning how to make a frame, we'd never have any cars. If you know something, you shouldn't mind telling someone else how to do it. And, you shouldn't mind someone else asking.

ferreter
12-24-2002, 01:02 PM
Originally posted by tzimsce
um, why was "locate" not written to find stuff that is REALLY on the system?

Locate is the fast replacement for commands like find and whereis, it uses a database to speed up what would otherwise be a system wide search.

ferreter
12-24-2002, 01:05 PM
Originally posted by tzimsce
Ever heard of "reinventing the wheel"? If all the auto manufacturers sat around learning how to make a frame, we'd never have any cars. If you know something, you shouldn't mind telling someone else how to do it. And, you shouldn't mind someone else asking.

You also shouldn't mind finding answers on your own. Being self-sufficient is a good thing. People can't always have other hold thier hands for the smallest of things.

geekgirl21
12-24-2002, 01:12 PM
Originally posted by tzimsce
If you know something, you shouldn't mind telling someone else how to do it. And, you shouldn't mind someone else asking.

Hell, no.

Why ask a question that has already been answered very thoroughly in documentation? All it does is make you look stupid when you do it. BTW, here is my 3 step process that will solve almost all your Linux problems.

1) GAFC = Get a f------ clue.
2) RTFM = Read the f------ manual.
3) STFW = Search the f------ web.

99% of your questions will be answered that way. If you do that, and you still can't find the answer, then read this (http://www.tuxedo.org/~esr/faqs/smart-questions.html) to find out how to ask questions the smart way.

Geez. :rolleyes:

ferreter
12-24-2002, 01:50 PM
Originally posted by geekgirl21
Hell, no.

Why ask a question that has already been answered very thoroughly in documentation? All it does is make you look stupid when you do it. BTW, here is my 3 step process that will solve almost all your Linux problems.

1) GAFC = Get a f------ clue.
2) RTFM = Read the f------ manual.
3) STFW = Search the f------ web.

99% of your questions will be answered that way. If you do that, and you still can't find the answer, then read this (http://www.tuxedo.org/~esr/faqs/smart-questions.html) to find out how to ask questions the smart way.

Geez. :rolleyes:

*gives a standing ovation* ;)

geekgirl21
12-24-2002, 01:54 PM
Originally posted by ferreter
*gives a standing ovation* ;)

Thank you. *bows*

Ludootje
12-25-2002, 02:57 PM
Originally posted by tzimsce
Ever heard of "reinventing the wheel"? If all the auto manufacturers sat around learning how to make a frame, we'd never have any cars. If you know something, you shouldn't mind telling someone else how to do it. And, you shouldn't mind someone else asking.
... coming from someone who has already 6 (!) posts and who probably already helped TONS of people on this bbs and who has already seen the same question 100 times (not) :rolleyes:

we aren't paid for answering your problems, you know? the time I'm spending here, I could be paid to do something. So don't waste people's time by asking a question which has already been asked tons of times, just hit the ****ing 'search' button and SEARCH!!! your attitude is really one which I hate. what you're saying, is actually that someone who has a problem shouldn't search for it, but he should let others think & search instead of them (because that's what the people who answer do: they think about the problem, and sometimes search theirselves on google - I actually spent quite some time looking for packages etc. when someone needed it, while those persons could have searched it in my place). Just for that post, I already don't like you. While I don't mind answering questions, the askers shouldn't mind SEARCHING FIRST!
bah

Ludootje
12-25-2002, 02:59 PM
Originally posted by tzimsce
um, why was "locate" not written to find stuff that is REALLY on the system?
locate actually doesn't search your system (that would take much more time) but it searches a database. Therefore, it's *much* faster. This database has to be updated every now and then though (in general, it's updated every saturday AFAIK). to update this database, the find command is used. If you want to find something fast, you shouldn't do 'updatedb' (which executes the 'find' command) and then 'locate whatever', but you should directly use the 'find' command yourself, this is much faster.
Example: find /path/where/you/want/to/search -name foobar

Elijah
12-25-2002, 07:06 PM
bash-2.05b$ calc() { perl -wlne 'print eval'; }
bash-2.05b$ export calc

then type 'calc' and start calculating ;)

press ctrl+c to bail out.

Ludootje
12-26-2002, 05:42 AM
Originally posted by Elijah
bash-2.05b$ calc() { perl -wlne 'print eval'; }
bash-2.05b$ export calc

then type 'calc' and start calculating ;)

press ctrl+c to bail out.
Nice one! In general, I type "python" to start calculating, but this is very, very nice. I like it!
Addition to this great tip:
add those two line in your .bashrc, so that they will *always* work

klosie
01-07-2003, 03:02 PM
I find this usefull for manually running my backup scripts.

To run a command line program in background:

Follow your command with an &

$./mycommand &

louis_b
01-25-2003, 04:21 AM
I noticed that this thread sort of died on the 8th of January. It's a great thread and should be elevated to its own forum.

I anxiously await some more good tips.;)

Dun'kalis
01-25-2003, 12:33 PM
Keep backups of your critical system files (XF86Config, fstab, kernel config, etc), so if you decide to switch distros, you have lots of the stuff that you need.

MMA
01-25-2003, 12:35 PM
Originally posted by Dun'kalis
Keep backups of your critical system files (XF86Config, fstab, kernel config, etc), so if you decide to switch distros, you have lots of the stuff that you need.

Thats a great tip. I do it all the time. I don't just paste it into my new distro tho. I just look at the config file and edit what i need to. :D:D

PS: why didn't i say it :D:D

slapNUT
01-25-2003, 09:31 PM
louis_b
I noticed that this thread sort of died on the 8th of January. It's a great thread and should be elevated to its own forum.
Everyone should bookmark it, and if they figure out a really tough problem they should post it here.

I have it bookmarked. :cool:

JThundley
01-26-2003, 06:39 AM
I've been reading a book on Redhat Linux 7 so I've learned a bunch of usefull stuff, even though some things are horribly outdated. So I learned some new stuff that I didn't know, but I don't know if they'd be considered "cool tips".

Hows about... Like that other guy said about running a command with & at the end to run it in the background, if you ran a command and after starting it realized that it would be a time-consuming one, press ctrl-Z to pause it. You can then type in "bg" (without quotes) to send that program to the background and keep working. Or I think you can also kill it using the "ps" command and then the "kill" command.

JThundley
01-26-2003, 04:29 PM
Have you ever wondered how many processes are running? IN a terminal window, type:
ps ax | wc
and this will use the process command (ps) with the options ax to show all processes and X window process (I think) and then pipe the output to the word count (wc) command which will count the lines, words, and characters, in that order. if you just want to see the lines, put the -l option after wc. Just remember to subtract 3 from that number because the first line is a header, and the ps and wc commands take up a process that are over by the time you read the number of lines.

Dun'kalis
01-26-2003, 05:13 PM
Using shell scripting, you can create an entire adminstration toolkit that does all the stuff you would normally do by hand. I don't care much for complexity, so I just put a bunch of if statements in there that checked that $1 was a command, and $2 was any parameter I want/need.

I lost it though. Planning to rewrite it in Ruby...

Gaston
01-28-2003, 10:43 AM
I've done some mail admin work and sometimes sendmail process
hog the server to grinding halt.
To get things going after cleaning up the mess, I would need to
kill all running/hanging sendmail processes.

ps -aex |grep send |awk '{print $2}' first to make sure that I get the PID's of all running sendmail processes and to check that the
commaned I've entered is in right format. Then I'd kill them one
one by with one helluva swoop:

ps -aex |grep send |awk '{print $2}' |xargs kill -9

What this command does, it list all the sendmail process (ps -aex |grep send), then using awk, I can eradicate from the output just
what I want, this time, I want just PID's. Then I pipe the PID's through xrags to kill them.

Good thing about using xargs is that it handles running processes
one by one and thus won't hog all the resources on the server.

dana_renay
01-28-2003, 03:02 PM
The easiest way to resolve dependencies is by using apt for RPM. But if you haven't gotten around to installing it yet, you can use the command

rpm -qR -packagename

to list all the packages an installed package depends on.

If you want to check on a package that hasn't been installed, use

rpm -qpR -fullpackagename

w6bi
01-28-2003, 08:41 PM
To kill an X-application:

If you have a command line, type xkill; your cursor will change to a skull and crossbones :-D Clicking on any window will kill it (note - it won't necessarily kill all the processes associated with this window. Do a ps ax | grep <partofprocessname> to find any remaining PID's associated with that program or process.

If you're really lazy, or for some reason you don't have access to a command-line, Ctl-Alt-Esc will invoke xkill from the keyboard (at least under KDE; I suspect it's a feature of XFree86)

bee-aye

sharth
01-29-2003, 07:57 AM
Originally posted by w6bi
If you're really lazy, or for some reason you don't have access to a command-line, Ctl-Alt-Esc will invoke xkill from the keyboard (at least under KDE; I suspect it's a feature of XFree86) not always. on debian + blackbox / fluxbox / enlightenment, crtl+alt+esc kills the x server.

It is a generally globally understood way to fix problems though.

you can also just hit crtl+alt+f1 and go to the command line, login, su to root, ps -A, kill <pid> (or killall program name). If the kill command fails, then use kill -9 or killall -9

Elijah
02-01-2003, 04:34 AM
search>read>post@forums>mailinglists>irc
do them in order to solve most problems :D

that's my formula for avoiding getting flamed :)

Allen614
02-05-2003, 10:01 AM
Use "expect" for bash scripting.

Elijah
02-06-2003, 06:37 AM
use this LOST script to turn numlock on @ bootup:

> LOST Admin wrote:
>
> >####[ GNU/Linux One Stanza Tip (LOST) ]#######################
> >
> >Sub : NumLock ON at boot LOST #024
> >
> >To turn numlock on automatically for a few consoles at boot:
> >
> >#!/bin/sh # Use setled program. This script
> >INITTY=/dev/tty[3-6] # will turn *Numlock* on for con-
> >for tty in $INITTY; do # soles 3 through 6 only ... Fire
> >setleds -D +num < $tty # this script in rc.local/ equiv-
> >done # alent for your distro
> >

bwkaz
02-06-2003, 11:16 AM
But that won't work for X. If your X virtual terminal comes up with numlock off and you want it on, install XFree86-devel (or whatever it's called), grab the program below, and compile it with gcc -o numlock numlock.c -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXtst (that's a capital i in front of the /usr/X11R6/include, and a lowercase ell in front of X11 and Xtst).

The program:

#include <X11/extensions/XTest.h>
#include <X11/keysym.h>

int main()
{
Display *disp = XOpenDisplay(NULL);

if(disp == NULL) return 1;

XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock), True,
CurrentTime);

XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock), False,
CurrentTime);

XCloseDisplay(disp);

return 0;
} Pretty simple -- it just emulates a press and release of the numlock key. Put the numlock executable that you should get somewhere in your path (/usr/X11R6/bin works for me), and call it from your xinitrc file (either ~/.xinitrc if that exists, or /etc/X11/xinit/xinitrc otherwise).

Edit: BTW, this program is not mine. It came from Linux From Scratch's numlock.txt hint, available at hints.linuxfromscratch.org. Credit where credit is due, and all that. ;)

Elijah
02-06-2003, 05:01 PM
Thanks for adding that script :)

fancypiper
02-06-2003, 05:13 PM
Some CD burning tips:
# CD burning info
Adding an IDE CD-Writer to Linux (http://www.justlinux.com/nhf/Hardware/Adding_an_IDE_CD-Writer_to_Linux.html)
CD Writing HOWTo (http://www.tldp.org/HOWTO/CD-Writing-HOWTO.html)
# Burn an ISO to disk
cdrecord -v speed=5 dev=0,0,0 -data /path/to/foo.iso
# Burn from disk to disk
cdrecord -v dev=0,0,0 speed=5 -isosize /dev/cdrom
# Generate an ISO from a directory.
mkisofs -J -r -o foo.iso /path/to/directory
mkisofs -v -r -T -J -U -V "Label" -o foo.iso /path/to/directory
# Generate an ISO from a CD
dd if=/dev/cdrom of=foo.iso
Linux MP3 CD Burning mini-HOWTO (http://www.tldp.org/HOWTO/mini/MP3-CD-Burning/)
# Convert mp3 to wav
for i in *.mp3; do mpg123 -w `basename $i .mp3`.wav $i; done
# Convert mp3 to wav with lame
for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done
# Burn a CD from wav files
cdrecord -v -audio -pad speed=5 dev=0,0,0 /path/to/*.wav

MMA
02-06-2003, 05:30 PM
Originally posted by fancypiper
Some CD burning tips:
# CD burning info
Adding an IDE CD-Writer to Linux (http://www.justlinux.com/nhf/Hardware/Adding_an_IDE_CD-Writer_to_Linux.html)
CD Writing HOWTo (http://www.tldp.org/HOWTO/CD-Writing-HOWTO.html)
# Burn an ISO to disk
cdrecord -v speed=5 dev=0,0,0 -data /path/to/foo.iso
# Burn from disk to disk
cdrecord -v dev=0,0,0 speed=5 -isosize /dev/cdrom
# Generate an ISO from a directory.
mkisofs -J -r -o foo.iso /path/to/directory
mkisofs -v -r -T -J -U -V "Label" -o foo.iso /path/to/directory
# Generate an ISO from a CD
dd if=/dev/cdrom of=foo.iso
Linux MP3 CD Burning mini-HOWTO (http://www.tldp.org/HOWTO/mini/MP3-CD-Burning/)
# Convert mp3 to wav
for i in *.mp3; do mpg123 -w `basename $i .mp3`.wav $i; done
# Convert mp3 to wav with lame
for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done
# Burn a CD from wav files
cdrecord -v -audio -pad speed=5 dev=0,0,0 /path/to/*.wav


That is a fantastic tip. I belive now its worth book marking this page :D:D:D:D

I can't find good quick help like that these days :D:D:D

rid3r
02-07-2003, 11:12 AM
no big deal, just like to use it (man at):
$ at now + 35 minute <Enter>
> poweroff #whatever you want goes here <Enter>
<Ctrl>+<D>

Ludootje
02-08-2003, 02:42 PM
Originally posted by w6bi
(at least under KDE; I suspect it's a feature of XFree86)
It's a keybinding of KDE - you can change it trough kcontrol for example. So it has nothing to do with XFree86.

Originally posted by sharth
not always. on debian + blackbox / fluxbox / enlightenment, crtl+alt+esc kills the x server.
umm here ctrl+alt+esc doesn't do anything (using debian + bb), it's ctrl+alt+backspace you need to restart X.

sharth
02-08-2003, 03:22 PM
Originally posted by Ludootje
It's a keybinding of KDE - you can change it trough kcontrol for example. So it has nothing to do with XFree86.


umm here ctrl+alt+esc doesn't do anything (using debian + bb), it's ctrl+alt+backspace you need to restart X. I'm always a moron and screw that up. That's what i meant :)

ferreter
02-10-2003, 11:54 AM
a quick way to see what services are open via inetd on your machine.

grep -v ^# /etc/inetd.conf

It displays all lines not starting with a comment. Usefull for other things as well I'm sure.

MMA
02-10-2003, 12:19 PM
OK, i'll start something new here.

I'm looking for a tip. If you think you know what i'm looking for please give it to me :D

I have a 5 Button mouse. I want to use my dumb buttons for foreward and backwards in Mozilla (just like windows in IE)

Has anyone accomplished this?

ferreter
02-10-2003, 12:31 PM
I got an interesting book by O'Reilly called Linux Server Hacks. As I progress through the book I'll post some of the interesting things I find here. So far I'm impressed (for such a small book).

mrBen
02-10-2003, 12:43 PM
Originally posted by MMA
OK, i'll start something new here.

I'm looking for a tip. If you think you know what i'm looking for please give it to me :D

I have a 5 Button mouse. I want to use my dumb buttons for foreward and backwards in Mozilla (just like windows in IE)

Has anyone accomplished this?

I think this is possible, but personally I just install the Optimoz mouse gestures for Mozilla (from http://optimoz.mozdev.org) - the latest release allows for both a mouse gesture (for me right-click+slide left/right for back/forward) AND rocker buttons: hold right, click left for back, hold left, click right for forward. Magic :D

Ludootje
02-10-2003, 04:10 PM
Originally posted by ferreter
a quick way to see what services are open via inetd on your machine.

grep -v ^# /etc/inetd.conf

It displays all lines not starting with a comment. Usefull for other things as well I'm sure.

To those who aren't familiar with grep, here's the explanation:
grep <options go here> <pattern(s) you want to search for> <filename>
is the syntax for grep.

So if you search for foo in a file called bar.txt, you do this:
grep foo bar.txt

However, if you want grep to display all lines which don't contain foo in the file bar.txt, you use the -v option, as follows:
grep -v foo bar.txt

Which leaves only the explanation of the ^ thingie.
If you want to search for all lines starting with the word foo in the file bar.txt, you use this:
grep ^foo bar.txt

So logically, if you want all lines not starting with foo in bar.txt, you use this:
grep -v ^foo bar.txt

BTW you can use multiple patterns too, like this:
grep "foo bar" bar.txt

I hope this explains the line above to the grep-novices :)
Of course, man grep explains everything you want to know about grep.

slapNUT
02-10-2003, 09:34 PM
Posted by ferreter
grep -v ^# /etc/inetd.conf

It displays all lines not starting with a comment. Usefull for other things as well I'm sure.
Yeah just look through /etc. You'll find quite a few files you can make "cleaner" by using that command, e.g. /etc/inittab.

If you want to suppress blank lines from the output add this:

grep -v ^# /etc/inittab|grep '^.'

The second grep causes only lines with at least one character to be displayed (all blank lines are suppressed.)

Ludootje
02-11-2003, 12:03 PM
IMHO that option isn't really helpful, unless you know everything there is to know about a certain config file, since the commands are very helpful in general.
Knowing how to use grep in general is very useful though.

Ludootje
02-11-2003, 12:52 PM
I don't think output redirection has been explained yet, so here goes:

If you want to save the output of a command into a text file, you use >. An example to redirect the output of ls to foo.txt:
ls > foo.txt
IMPORTANT: If there is no file called foo.txt, it will be created - without a warning.
If, however, there akready is a file called foo.txt, it will be overwritten - also without a warning. This means the date which it contained at first will be lost.

Next we have the >> redirector, which does exactly the same as >, except that it appends a file. For those who aren't familiar with English, this means that in case foo.txt already exists, the data it contains won't be overwritten - the new data will just be added ('appended') to the end of foo.txt

As some might know, not all data which an application outputs into a terminal (or a text file) is output (aka stdout, or standard output), there are also error messages (aka stderr). To redirect the error messages to a file errormsgs.txt, you use 2>, like this:
appname 2> errormsgs.txt
The 2> redirector can be very useful if you're having a problem with an application: you start it up from a terminal like this:
buggy_application_name_goes_here 2> /tmp/error.log
and afterwards you include /tmp/error.log in a mail to the application's mailinglist/developer.
IMPORTANT: this will just redirect stderr, not stdout.

When you want to report information about a program which isn't behaving correctly like the above example, you'll probably want to redirect the normal output, too.
You can achieve this with 2>& redirector. So a better version of the error-reporting command line above would be this:
buggy_application_name_goes_here 2>& /tmp/error.log

So now you can redirect stdout and stderr... what's left? standard input, of course.
You can redirect input from a file using <.
How can this be useful? Well, let's take the first example again:
ls > foo.txt
This just redirects the output from the command ls to foo.txt, but what if we wanted to sort it using the command sort?
Well if you read this topic, you know how you can pipeline the data, like this:
ls | sort > foo.txt
Another possibility, is this one:
ls > foo.txt
sort < foo.txt > sorted_foo.txt
In this case, using the < redirector would be pretty dumb of course, since it would change a one-liner to two lines of code, and IMHO the second command is less clear.
However, I think you now understand how < works, which is the most important. The truth is I just don't know a useful way to use < at the moment - I've never used it even :)


heh this has become more a short howto then a tip I guess, but I hope this will be useful to somebody.

edit: apparently putting bold tags around the input redirector isn't working - don't know why though, since making > bold works just fine :confused:
edit 2: oh no that doesn't work either... well I guess it's because < & > can be used as HTML tags as well, but it should still work... I think.
maybe it works like this...
&lt;
&gt;
edit3: nope, it doesn't :)

mike_the_pengui
02-12-2003, 10:33 AM
two for your bios....

1. while on-line, use
rdate -s clock-1.cs.cmu.edu && hwclock --systohc
in a console as root. This will re-set your bios to atomic
clock time.

2. my bios will only let me boot to floppy if I change from booting
from my cdrom. but if I change the bios from cdrom, my cd-burner
will no longer be identified.
In order to burn, my bios must be set to boot from cdrom.
fyi.

Ludootje
02-12-2003, 11:15 AM
Originally posted by mike_the_pengui
two for your bios....

1. while on-line, use
rdate -s clock-1.cs.cmu.edu && hwclock --systohc
in a console as root. This will re-set your bios to atomic
clock time.
do you know of other hosts like that but for another timezone? or doesn't that work with timezones?

MMA
02-12-2003, 12:52 PM
Originally posted by mike_the_pengui
2. my bios will only let me boot to floppy if I change from booting
from my cdrom. but if I change the bios from cdrom, my cd-burner
will no longer be identified.
In order to burn, my bios must be set to boot from cdrom.
fyi.

Weird :confused:

Is this a tip?

b00zer
02-12-2003, 01:32 PM
pwd stands for present working directory and if you type pwd in a console it will display the full path where you're currently at.

fancypiper
02-12-2003, 05:14 PM
Don't forget that re-direction and piping add to the power in bash, so some of these tips use them.

# Basic piping
some_command | another_command
See Linux and the tools philosophy (http://linux.oreillynet.com/pub/a/linux/2000/07/25/LivingLinux.html)
# Basic re-direction:
command > textfile_name
See this Text Manipulation Article (http://linux.oreillynet.com/pub/a/linux/2000/05/05/LivingLinux.html)
# Basic concantenation:
If you don't want to overwrite a file but add to the bottom of an existing file, concantenate it:
command >> exisiting_text_file

The bash commands:
# Find CPU specifications
cat /proc/cpuinfo

# What pci cards are installed and what irq/port is used
cat /proc/pci

# Memory information
free

# How is the hard drive partitioned
fdisk /dev/hdXX -l

# How much free drive space
df -h

# Show disk usage by current directory and all subdirectories
du | less

# Find running kernel version
uname -r

# Find X server version
X -showconfig

# What is the distribution
cat /etc/.product
cat /etc/.issue
cat /etc/issue
cat /etc/issue.net
sysinfo

# For finding or locating files
find
locate
which
whereis

# Use dmesg to view the kernel ring buffer (error messages)
dmesg | less

# Watch error messages as they happen (sysklog needed)
as root, tail -f /var/log/messages (shows last 10 lines, use a number in front of f for more lines)

# What processes are running
ps -A

# Find a process by name
ps -ef | grep -i <plain text>
For example, XCDroast
ps -ef | grep -i xcdroast /* Case Insensitive */

# See current environment list, or pipe to file
env | more
env > environmentvariablelist.txt

# Show current userid and assigned groups
id

# See all command aliases for the current user
alias

# See rpms installed on current system
rpmquery --all | more
rpmquery --all > <filename>.txt
rpmquery --all | grep -i <plaintext> /* find specific rpms with name in them */

# What directory am I using
pwd

Look at man <command> or info <command> for the flags and options you can use for bash commands.

0116
02-17-2003, 12:21 AM
Great thread everyone, thought i would join just so i could share :)
1)extra docs
if man isn't enough for you, consider looking in
/usr/share/doc/name_of_application
For example, /usr/share/doc/sed contains a wonderful faq :)

2) install surfraw to ease web searches .

Edit the /etc/surfraw.conf file and enter your browser (i entered galeon)
def SURFRAW_graphical_browser galeon
Now search away!
for example
$google linux tips
Much easier than using search boxes.

3)Read the other GNU/Linux tips
There's quite a bunch...
For example

http://lost.sourceforge.net/LOST/LOST.fortune.db.gz

AxeZ
02-17-2003, 05:59 PM
Don`ŧ have familiar editor handy...:)

cat > some_file.txt << "EOF"

> type some text <enter>
> type some text <enter>
> type some text <enter>
> type some text <enter>
> EOF


Voila text file created with your text in it....:)

JohnT
02-18-2003, 12:52 AM
Searching with google/linux, just got easier.
Go here (http://www.justlinux.com/forum/showthread.php?s=&threadid=68807&highlight=mozilla)
and download and install the .zip. In Mozilla open "Preferences" >Navigator>Internetsearch. Choose "google/linux" and save. Restart Mozilla. Now when you highlight and right-click on a word or phrase on a web page and choose "web search" it will use http://google.con/linux as your search engine. It will also be available in the sidebar.

MMA
02-18-2003, 03:40 PM
Originally posted by JohnT
Searching with google/linux, just got easier.
Go here (http://www.justlinux.com/forum/showthread.php?s=&threadid=68807&highlight=mozilla)
and download and install the .zip. In Mozilla open "Preferences" >Navigator>Internetsearch. Choose "google/linux" and save. Restart Mozilla. Now when you highlight and right-click on a word or phrase on a web page and choose "web search" it will use http://google.con/linux as your search engine. It will also be available in the sidebar.


You can also install the google toolbar, and yahoo companion toolbar, except i hate the fact that the yahoo companion toolbar doesn't have the bookmark feature, like the IE version, I use google for search and yahoo for bookmarks.

JohnT
02-18-2003, 04:14 PM
I just thought this would be a cleaner way to do it. I didn't need another toolbar or space taken up on the one I have with another search link.

Elijah
02-18-2003, 04:42 PM
Originally posted by JohnT
Searching with google/linux, just got easier.
Go here (http://www.justlinux.com/forum/showthread.php?s=&threadid=68807&highlight=mozilla)
and download and install the .zip. In Mozilla open "Preferences" >Navigator>Internetsearch. Choose "google/linux" and save. Restart Mozilla. Now when you highlight and right-click on a word or phrase on a web page and choose "web search" it will use http://google.con/linux as your search engine. It will also be available in the sidebar.
Also works with the phoenix browser :)

JohnT
02-18-2003, 07:02 PM
That's good news.:p

fishhead
02-19-2003, 06:45 PM
Learn shell scrpting .... it'll change your life ...

MMA
02-19-2003, 06:49 PM
Or maybe why not learn Perl too, or Python. They'll more then change your life. :D:D

DommiTL
02-21-2003, 03:11 AM
find / > foo.txt

grep 'term' foo.txt

index from root then search the text file for whatever term you want. Much simpler and quicker than finding from find.

just run a cron once daily.

:D

Elijah
02-21-2003, 03:21 AM
Originally posted by DommiTL
find / > foo.txt

grep 'term' foo.txt

index from root then search the text file for whatever term you want. Much simpler and quicker than finding from find.

just run a cron once daily.

:D
another way to do it is:
#updatedb
$locate foo

MMA
02-21-2003, 07:31 AM
Originally posted by DommiTL
find / > foo.txt

grep 'term' foo.txt

index from root then search the text file for whatever term you want. Much simpler and quicker than finding from find.

just run a cron once daily.

:D


That i think is a waste of CPU resources.

But that grep thing is nice.

bwkaz
02-21-2003, 10:17 AM
Why not find / -name '*term*'?

DommiTL
02-21-2003, 11:06 AM
find takes much longer than grep does

you run a find command to index the directories and then you can grep. if you run find and write it to a ascii file once per day, assuming that you make no changes you will find the dir of file a lot quicker than you would just by using find.

bwkaz
02-21-2003, 01:20 PM
Oh, I see. You use find to create the index, then grep to find the file. OK.

You do the exact same thing that updatedb and locate/slocate do.

elderdays
02-21-2003, 01:54 PM
ctrl-x then $ will give you all your bash variables.

Use these with 'echo $variable' to get useful info.

the_darkhorse13
02-27-2003, 02:26 AM
I know this one's obvious... but for those of you experiencing Mozilla's 'lag' as you scroll down a page (i guess this only applies to people with crud video cards) then change your colors down to 15bit. It works wonders on the speed of applications compared to the cpu-sucking 32 bit color. .....and its taken me a looooong time to figure this out..:mad:

Ludootje
02-27-2003, 02:24 PM
Originally posted by bwkaz
Oh, I see. You use find to create the index, then grep to find the file. OK.

You do the exact same thing that updatedb and locate/slocate do.
the find & grep thing is slower then updatedb & locate I presume.
Why reinvent the wheel when there already are things to do a fast search... This seems quite useless to me, except maybe if you're tight on HD space and don't want to install updatedb & locate, but otherwise... :rolleyes:

Ubermensch
03-04-2003, 05:23 PM
Subscribe :D

I'm a super newbie so I have nothing to contribute yet.

MMA
03-04-2003, 06:20 PM
I hope Hayl doesn't mind.

But he gave me this great howto, and i would like to share this with everyone here.

This howto shows you how to configure your media, internet buttons on your keyboard to do what ever you want. (eg: run xmms etc etc).

Its an OpenOffice writer file.

If anyone wants a MS Word format (:D:D:D), just give me a PM.


http://www.mooktakim.freeserve.co.uk/MultimediaKeyboard.zip

Ludootje
03-07-2003, 03:52 PM
Not sure if this has been posted yet...

If you start a program in a terminal, like this:
app-name
and you want your term back, but without quitting the app, hit ^Z (that's control-Z)
this will halt the app, and tell it's number.
to get it back, type this:
fg <number of app>
example:
fg 1

If you started an app, like this:
app-name
and want it to run in the background (so you should've started it as "app-name &"), you do this:
^Z (to halt it)
bg <number of app>
example:
bg 1
This will make it run in the background.

Also, if you halt an app with ^Z, and then decide you want to kill it, instead of looking up it's PID (process ID number) using 'ps aux' (or whatever ps options you want to use) or without using killall, you can use this:
kill %<number of app>
example:
kill %1

You might wonder: how do I know the number of the app?
Well, when you put it in the background with ^Z, you get to see this:
[1]+ Stopped app-name
In this case, 1 is its number.

I hope this helps and that I'm not repeating someone :)

SubDefy
03-07-2003, 05:24 PM
not sure if this has been posted but to save time you can just hit tab if you have a long filename but make sure its unique or not similar to the others type like a part of it and hit tab it should autocomplete it

i know it helped me out

Ludootje
03-08-2003, 07:40 AM
If you're like me and just can't memorize the syntax of the 'date' command, the attached little script will help you *a lot*

(when saving it, remove the '.txt' part and (optionally) add the extension '.sh')

lotusjps46
03-14-2003, 12:31 AM
Ok, here is a fix for anyones mouse. Makes it faster and more accurate, without that jerky motion:

As root, open the file XF86Config-4 in a text editor (usually this is located in /etc/X11 ). find the section for your mouse, and add this after the last Option:

Option "Resolution" "1600"

Should look like this for a PS/2 mouse "

Section "InputDevice"
Identifier "PS/2 Mouse"
Driver "mouse"
Option "Protocol" "PS/2"
Option "ZAxisMapping" "4 5"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "true"
# Option "Emulate3Timeout" "70"
Option "SendCoreEvents" "true"
Option "Resolution" "1600"
EndSection


Or like this for a USB mouse:


Section "InputDevice"
Identifier "USB Mouse"
Driver "mouse"
Option "Device" "/dev/input/mice"
Option "SendCoreEvents" "true"
Option "Protocol" "IMPS/2"
Option "ZAxisMapping" "4 5"
Option "Buttons" "5"
#Option "Emulate3Buttons" "true"
Option "Resolution" "1600"
EndSection


Save it, restart X, and see the difference.

trn
03-14-2003, 02:38 AM
Originally posted by MMA
OK, i'll start something new here.

I'm looking for a tip. If you think you know what i'm looking for please give it to me :D

I have a 5 Button mouse. I want to use my dumb buttons for foreward and backwards in Mozilla (just like windows in IE)

Has anyone accomplished this?

Uh, oh... looks like someone forgot to STFW :D j/k i found lots of good info on sidebuttons here

http://www.linuxquestions.org/questions/showthread.php?threadid=21303

Ludootje
03-15-2003, 12:09 PM
Originally posted by lotusjps46
Ok, here is a fix for anyones mouse. Makes it faster and more accurate, without that jerky motion:
What jerky motion are you talking about? I don't really understand what that option does...
Anyway I'll try it later and see if it does something :)

newbieME
03-18-2003, 10:36 AM
Awesome thread people, i thought i should post my first post here ;)

Before using fdisk /mbr to overwrite your mbr, make sure you only have once active partition :D if you have more than one set as active, you will get invalid partition table error and it won't boot!.

(You would probably want to set the partition with your working os active eh? like windows ;) )

MMA
03-18-2003, 12:54 PM
Here's a fantastic tip. Well i use it anyway.

Make a /boot partition (about 50Mb). The first primary on your master (hda1) HD.

Install a small distro, any old would do (just to install grub). Choose hda1 as your /boot. Install it.

Choose grub as your bootloader.

Then make a GRUB boot floppy like this:

# mke2fs /dev/fd0
# mount /dev/fd0 /mnt/floppy
# mkdir -p /mnt/floppy/boot/grub
# cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub/
# cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub/
# umount /mnt/floppy
# grub

grub> root (fd0)
grub> setup (fd0)
grub> quit

Then install what ever OS you want. Don't choose hda1 for anything. Not even /boot for a linux distro. Then if the OS writes over the mbr just put the floppy back into the drive and boot grub.

then type:
grub> root (hd0,0) // Your boot partition
grub> setup (hd0) // Where the boot record is installed, here, it is the MBR

Thats all you need.

Now whenever you want to add an entry to grub, you just edit the /boot/menu.lst file in your hda1 partition. Thats it!

You won't need an OS for grub. All you need is the floppy, just incase your mbr gets over written, and keep your /boot partition safe :-)

When installing a linux distro, just choose any partition as root, don't choose a seperate /boot.

Some distro's have special entries in grub. Just copy the entry from menu.lst file in the distro's /boot/grub/menu.lst file and copy it to the menu.lst file in your hda1 partition and thats it.

no need to run grub or anything.

spreelanka
03-23-2003, 01:59 PM
if you have multiple distro's on your system, just use one boot partition, and don't mount it. save hd space and more

ps, links -g rocks!!!

Gertrude
03-24-2003, 04:57 AM
If you want to track someone to see who they have "su"d to use the command:

pstree -u

and you would get output like this

|-sshd---sshd---bash---bash---bash(gert)---bash(root)

showing that the user "gert" is currently logged in as "root" via ssh

Suramya
03-26-2003, 08:36 PM
Hi Everyone,
First of all thanks for a great set of tips. They made life a lot simpler for me. So here is a set of keystrokes you might find useful:

Ctrl-X then ~ Lists all the users on the system
Ctrl-X then / Lists all files in the current directory
Ctrl-X then ! Lists all files in /usr/bin

Ctrl-X then @
Gives me "localhost localhost.localdomain"
havn't figured out where its getting this from. Best guess is that its getting it from /etc/hosts. Any Idea's?

Also thanks to 'slapNUT' for the tip about using Ctrl-Q to restart a shell paused by Ctrl-S.

Also Ctrl-Alt-Esc doesn't do anything in my system (Redhat 7.3 running KDE).

Thanks,
Sur

sharth
03-26-2003, 09:00 PM
crtl-x ! actually prints out everything in your path.

3m00
03-29-2003, 06:23 PM
Instead of chmod -w from root, you can actually do a "chattr +i file". This will use ext2 option to prevent it from being written to. To take that back, do a "chattr -i file". Might be good to prevent root kits from script kiddies, "chattr +i /etc/passwd". (not many people know of this little trick, especially not script kiddies.)
Also : thx to fancypiper for that CDrecord thing. Doing a "cat /dev/cdrom > ./iso.iso ; cdrevord -v -speed=2 -dev=0,0,0 -data iso.iso" is so much harder than "cdrecord -v dev=0,0,0 speed=2 -isosize /dev/cdrom")

NoahsMyBro
04-04-2003, 04:01 PM
I'm looking for something that I know exists - I've read about it before. But I can't remebmer the command!

Let's say you're tooling away at the command line, and you cd to somewhere distinct from your current location (Ex. You're in "/sbin" and you go to "/home/joe/images" ) . What is the syntax to cd back to where you wre previously?

I know you can "cd ~" to go to your home directory, and I know "cd .." will take you up one directory, but how do you cd back to the previous directory you were in?

Thanks,
Steve

spreelanka
04-04-2003, 05:27 PM
ok, i actually found this as a result of one of the links on this page but it's so cool i had to share.
always been able to open my windows partition in linux, but getting something from my linux partition usually requires a reboot(or more now that i'm using wxp).
anyway, to explore your linux partitions in windows use explore2fs which can be found here:
http://uranus.it.swin.edu.au/~jn/linux (http://uranis.it.swin.edu.au/jn~/linux/)

write is still experimental though! personally i wouldn't use it if you have any critical data, but that's just me.

bwkaz
04-04-2003, 05:32 PM
Originally posted by NoahsMyBro
Let's say you're tooling away at the command line, and you cd to somewhere distinct from your current location (Ex. You're in "/sbin" and you go to "/home/joe/images" ) . What is the syntax to cd back to where you wre previously? cd -, that is, cd dash.

You can also be messing around (e.g.) /sbin, then do a pushd /home/me/other, then mess around in there (and possibly change directories again), then do a popd to jump back to /sbin.

Shodan
04-04-2003, 06:17 PM
You can also be messing around (e.g.) /sbin, then do a pushd /home/me/other, then mess around in there (and possibly change directories again), then do a popd to jump back to /sbin.


Alright I have done some playing with these and haven't figured them out entirely. It seems as if I can only pop once though I can push several times.

can anyone share how these work?

JD

bwkaz
04-04-2003, 07:01 PM
Seems to work for me...

[bilbo@beta bilbo]$ pushd /usr/bin
/usr/bin ~
[bilbo@beta bin]$ pushd /lib
/lib /usr/bin ~
[bilbo@beta lib]$ pushd /usr/lib/gtk-2.0/
/usr/lib/gtk-2.0 /lib /usr/bin ~
[bilbo@beta gtk-2.0]$ pushd ~
~ /usr/lib/gtk-2.0 /lib /usr/bin ~
[bilbo@beta bilbo]$ popd
/usr/lib/gtk-2.0 /lib /usr/bin ~
[bilbo@beta gtk-2.0]$ popd
/lib /usr/bin ~
[bilbo@beta lib]$ popd
/usr/bin ~
[bilbo@beta bin]$ popd
~
[bilbo@beta bilbo]$

chrismiceli
04-04-2003, 11:24 PM
to remove all the lines of history
history -c

that way you can hide what you have been doing!

BLAMM0
04-06-2003, 04:45 PM
open teh gnome terminal and type halt :D

bwkaz
04-06-2003, 05:03 PM
OK, assuming you're root, and assuming /sbin is in your PATH, that would work (BTW, for anyone considering trying it, it'll shut down your computer -- at least it does it cleanly). But ... err... why would you be telling people to do it? Unless you want to screw them up, but I was under the impression that stuff like this only went on in less-than-reputable IRC channels... :rolleyes:

BLAMM0
04-06-2003, 05:10 PM
it was only a joke :) i appologise if anyone tried that and lost data or smht :rolleyes:

Shodan
04-06-2003, 05:16 PM
hey blammo

you could always just edit the original post and put in a disclaimer - or at least tell people what it really does up front...

JD

BLAMM0
04-06-2003, 05:54 PM
ok i will in the future.:cool:

MMA
04-06-2003, 05:56 PM
aahhh, geezzz. Three posts jusrt becuase of a small joke. Come maann. Have a sense of humor.
Doing halt won't kill anyone. Anyway, most people knew it was a joke anyway.

gleather
04-06-2003, 08:48 PM
as root:
# mkrescue
follow instructions

JThundley
04-08-2003, 02:12 AM
ooh, I just found one!

Push Ctrl-Alt-(Keypad +)
or Ctrl-Alt-(Keypad -)

This is will cycle different resolutions or zoomlevels in X. It's a cool little trick, and I've had a game (clanbomber) crash and leave my desktop looking all weird, and now I know how to fix it.

chud67
04-08-2003, 03:30 PM
To list only the directories (not the files):
ls -l | grep ^d

shadowrider
04-08-2003, 04:02 PM
Originally posted by spreelanka
if you have multiple distro's on your system, just use one boot partition, and don't mount it. save hd space and more

ps, links -g rocks!!!
i've been wondering this for a long time, what does really "links -g" do?:)

DarkJedi9
04-08-2003, 04:12 PM
Nifty little security fix: I don't want somebody being able to "zap" my xscreensaver but I want to be able to use ctrl+alt+backspace if I lock X, so I put this line in my ~/.bashrc file.

alias startx="startx;exit"

This way whenever X quits it logs out and the person who killed X doesn't get a prompt. It can be a little inconvenient if you shut X off but still want a prompt, but I think it's worth it.

spreelanka
04-08-2003, 06:27 PM
Originally posted by shadowrider
i've been wondering this for a long time, what does really "links -g" do?:)

if you compile links with
./configure --enable-graphics
you have a fast browser with graphics...even from the console!!!
it's great if i don't feel like starting up X just to do something online real quick, but need graphics.
I'd definately check it out. Especially on a slower system, I don't even see a reason for X11, unless it's just a workstation and processing is remote

shadowrider
04-09-2003, 02:49 AM
wait..how do u "compile" this "links" ?
not exactly sure what's going on.:confused:

mrBen
04-09-2003, 03:24 AM
Originally posted by shadowrider
wait..how do u "compile" this "links" ?
not exactly sure what's going on.:confused:

Are you being serious, or sarcastic?

Links is a text-based web-browser (taking it's name from the well-known text browser Lynx), but if you add the above options when you compile it from source, then you also get graphics support in the console.

To do this, download the source code, unpack it as normal and then compile it with:

./configure --enable-graphics
make
make install


and then you should be able to run Links with the -g flag to enable graphics.

If you need more info on compiling, I suggest you read the Help File in the library on this page.

MMA
04-09-2003, 04:06 AM
But it only works when X is running, it opens up a new window (it doesn't run in console). So there a bit like mozilla. :D:D

spreelanka
04-09-2003, 04:26 AM
Originally posted by MMA
But it only works when X is running, it opens up a new window (it doesn't run in console). So there a bit like mozilla. :D:D

did you shut down X and TRY it in the console? perhaps you should try it first...

MMA
04-09-2003, 04:54 AM
No what i did was CTRL+ALT+F1 and typed it in. But i'll try it out next time :D:D

chud67
04-09-2003, 03:50 PM
In your .bashrc file, add the following line:

alias rm='rm -i'

This will prompt you with a "are you sure you want to delete this" before actually removing the file.

shadowrider
04-09-2003, 11:25 PM
Originally posted by mrBen
Are you being serious, or sarcastic?

Links is a text-based web-browser (taking it's name from the well-known text browser Lynx), but if you add the above options when you compile it from source, then you also get graphics support in the console.

To do this, download the source code, unpack it as normal and then compile it with:

./configure --enable-graphics
make
make install


and then you should be able to run Links with the -g flag to enable graphics.

If you need more info on compiling, I suggest you read the Help File in the library on this page.
oh cool. thx for the great info.
i just never heard about this browser before.
how's the speed compare to mozilla?

Elijah
04-11-2003, 06:07 AM
prioritize a command:

#nice -n -20 xcdroast

man nice

mrBen
04-11-2003, 07:06 AM
Originally posted by shadowrider
oh cool. thx for the great info.
i just never heard about this browser before.
how's the speed compare to mozilla?

TBH, I've never tried it with the graphics thingy, but being a text-based browser it'll be massively quicker than mozilla.

Ludootje
04-18-2003, 09:48 AM
Originally posted by JThundley
ooh, I just found one!

Push Ctrl-Alt-(Keypad +)
or Ctrl-Alt-(Keypad -)

This is will cycle different resolutions or zoomlevels in X. It's a cool little trick, and I've had a game (clanbomber) crash and leave my desktop looking all weird, and now I know how to fix it.
That won't always work: you need to edit /etc/X11/XF86Config(-4) first, and tell X what resolutions you screen can handle. It'll only cycle trough those resolutions, so if you only have the one you normally use, it won't work. (just explaining it in case it isn't working for someone and doesn't know why - I know I had that problem a while ago:))

Elijah
04-18-2003, 10:38 AM
Loads of Linux Links (http://loll.sourceforge.net/linux/links/index.html) :)

ultraslacker
04-23-2003, 07:13 PM
Time savers

kde shortcuts let you skip a step in using search engines - for instance, 'cpan: postgresql' as a run command or as a konqueror location will display the search results for postgresql on CPAN. Other useful shortcuts are gg (google), ggg (google groups), and sf (sourceforge). You can add your own, of course.

As mentioned earlier in this thread, ctrl-U, ctrl-K, ctrl-W, ctrl-A, and ctrl-E are shell shortcuts. They are also supported in kde and other desktop environments.

DrJones
04-29-2003, 05:30 AM
I'm still a newbie, but one of my professors showed me this trick which helps a TON.

It's a program called 'screen' that most distro's seem to install. Basically it lets you start a session that is independant of where you are or how you are loged in. So (like happened today) i can be at school on those linux boxes, and ssh into my box here, start up screen, and start a simulation program i'm running that will take >24 hours to run. Then i can close that conection and log out just fine, and the program will keep runing. I can log in and check on it, or when i get back to my place log in and get the terminal.

Here's how to do it. Open up a terminal and type screen -D -R That will create a screen session and you can then do whatever you want with it. When you are done, and you want to save the screen, do ctrl+A then ctrl+D. That will log you out of the screen, but it will still be there, you just have to log in again using the screen -D -R command, and you'll be right where you left off. Very very usefull, esp. if you are like me and are always loged in from somewhere else with big programs running. There are a lot of other commands and tricks, but this is enough for most people.

MMA
04-29-2003, 03:09 PM
Originally posted by DrJones
I'm still a newbie, but one of my professors showed me this trick which helps a TON.

It's a program called 'screen' that most distro's seem to install. Basically it lets you start a session that is independant of where you are or how you are loged in. So (like happened today) i can be at school on those linux boxes, and ssh into my box here, start up screen, and start a simulation program i'm running that will take >24 hours to run. Then i can close that conection and log out just fine, and the program will keep runing. I can log in and check on it, or when i get back to my place log in and get the terminal.

Here's how to do it. Open up a terminal and type screen -D -R That will create a screen session and you can then do whatever you want with it. When you are done, and you want to save the screen, do ctrl+A then ctrl+D. That will log you out of the screen, but it will still be there, you just have to log in again using the screen -D -R command, and you'll be right where you left off. Very very usefull, esp. if you are like me and are always loged in from somewhere else with big programs running. There are a lot of other commands and tricks, but this is enough for most people.


I just got into ssh and this is EXACTLY what i was looking for. I heard about screen being that you can split the window etc. But this is just fantastic. I have a small server with gentoo installed. I normally connect my TV to it, which is VERY hard to read anything. So when an emaerge takes hours i have to use the TV and an old keyboard and run the emerge. Now i won't even need the keyboard either. Thank you.

:D:D:D:D

PS: i i'm VERy happy :D:D

janet loves bill
04-29-2003, 07:48 PM
this is more of an FYI for the newer members to Linux, If you want to know about the Kernel........goto /usr/src/Kernel(version) directory....there is a documentation directory, for the 2.4.20 kernel this folder total 5 megs of info. 1.6 megs of texts alone. Read thru this directory, very interesting stuff............

lazy13
05-01-2003, 01:28 AM
Something I just learned that I thought was kinda neat, maybe it's common knowledge, I don't know. To make a quick switch in resolution in X

CTRL + ALT + '+' on the numeric keypad to go to the next lowest res.

CTRL + ALT + '-' on the numeric keypad to go to the next highest res.

I was suprised at how quick the change was.

gleather
05-02-2003, 10:21 AM
Don't leave your computer with focus on a window that accepts input.

Elijah
05-10-2003, 10:19 AM
now this is interesting for bash .... another alternative to ctrl+r, type "!" at the beginning of the prompt and type any part of the long command you used before.

ex. you typed a long command $wine blah blah etc etc
you can just type $!wi <enter>
and it will search for any similar commands you recently typed.

Elijah
05-10-2003, 10:25 AM
now this is interesting for bash .... another alternative to ctrl+r, type "!" at the beginning of the prompt and type any part of the long command you used before.

ex. you typed a long command $wine blah blah etc etc
you can just type $!wi <enter>
and it will search for any similar commands you recently typed.

MMA
05-10-2003, 10:44 AM
hhmm, you liked this tip so much you had to post it twice :D:D:D

Elijah
05-10-2003, 11:05 AM
Originally posted by MMA
hhmm, you liked this tip so much you had to post it twice :D:D:D
I did? :confused: i think the last one was the ctrl+r thing, this one is the "!" one, but they do work almost the same .. i think :D

gbell7211
05-10-2003, 03:46 PM
Add your user to the wheel group than edit /etc/pam.d/su

uncommenting auth sufficient /lib/security/$ISA/pam_wheel.so trust use_uid

and auth required /lib/security/$ISA/pam_wheel.so use_uid

Than no more having to type password each time you su

sploo22
05-16-2003, 03:40 PM
My favorite trick - instead of grep, pipe output into less and use the / search command. It lets you see practically an unlimited amount of context!

e.g.

# strings /dev/hdb1 | less
:/secret

Oooooh, being root is FUN!!!!!! :D

Add your user to the wheel group than edit /etc/pam.d/su

uncommenting auth sufficient /lib/security/$ISA/pam_wheel.so trust use_uid

and auth required /lib/security/$ISA/pam_wheel.so use_uid

Than no more having to type password each time you su

If you can do that, why not just log in as root all the time? :eek:

gbell7211
05-16-2003, 06:54 PM
I do it personally for ease of editing and file that I have to without having to actually enter a password each time. I never said it was for everyone.
I just prefer to simplify my life I suppose.

cheers

gbell

Elijah
05-16-2003, 10:54 PM
root is too powerful, so powerful that a simple command rm could whack your system (even if you know what you're doing, a single typo could ruin things). I would'nt recommend being root all the time ... I made a mistake as a user once and erased my entire /home/* directory what more could it do for root...

CaptainPinko
05-16-2003, 11:21 PM
the tab is key is the answer to forgetting upper or lower case

sharth
05-17-2003, 07:49 AM
Originally posted by Elijah
root is too powerful, so powerful that a simple command rm could whack your system (even if you know what you're doing, a single typo could ruin things). I would'nt recommend being root all the time ... I made a mistake as a user once and erased my entire /home/* directory what more could it do for root... or a simple accidental paste into a shell (from personal experiance)

sharth
05-17-2003, 07:52 AM
Originally posted by gleather
Don't leave your computer with focus on a window that accepts input. xtrlock works wonders :) (and for those pesky siblings as well)

sploo22
05-18-2003, 03:19 PM
Originally posted by Elijah
root is too powerful, so powerful that a simple command rm could whack your system (even if you know what you're doing, a single typo could ruin things). I would'nt recommend being root all the time ... I made a mistake as a user once and erased my entire /home/* directory what more could it do for root...

That's exactly my point. If you can become root anytime you want, you stop thinking about it as much, and then it's easy to make the same kind of mistake. Trust me, I know what you mean - one time I completely wiped out gcc and all I could find was the source RPM!

lostDawg13
05-20-2003, 05:17 AM
While you have your usual text sessions from [ctrl]-alt-F[1-6], with the usual alt-F7 for your X session, if you type

startx -- :2

or;

startx -- :3

etc,

you can then access the second X-session by pressing [ctrl]-alt-F8,

the third one by pressing [ctrl]-alt-F9

and etc

Enjoy! :)

BillC
05-26-2003, 07:14 PM
Originally posted by MMA
THNX, are they GUI? becuase i don't know much about firewalls in Linux :D:D

I thought this was a tips forum.:confused:

It's time for you to learn about freshmeat.net and google.com. Repeated questions about the basic capability of the same program show that you are not doing your own research.

Here, try these:
http://www.google.com/search?q=bastille+linux
http://www.google.com/search?q=guarddog+linux
http://freshmeat.net/search/?q=bastille&section=projects
http://freshmeat.net/projects/guarddog/?topic_id=43%2C151%2C57%2C150

After giving these a thorough reading if you still have questions, post on this topic again. I can not recommend membership in a nearby Linux Users Group too highly.
http://www.linux.org/groups/

I also can not recommend getting used to working at the command line too highly, either. Linux is not a fully gui environment. (neither is Windows, come to think of it) Many chores are still best handled from the command line using a text editor or any of hundreds of utilities. Many of the tips posted thus far rely on the CLI. If you can't use it, then the tips simply won't work. Typing alt+F2 simply won't cut it. When you use a gui, you are limited to the switches the programmer thought useful under the circumstances he / she envisioned. I promise you, from the bottom of my tiny little shriveled up heart, that the programmer overlooked something you will desperately need. Learn the CLI.

I know you are new to Linux and I don't want to jump down your throat, but 'tech support' in Linux is what happens after you RTFM, not before.

The idea is that most of us do this as a hobby and no one is paid to do the thinking for anyone else. If you want to learn about Linux, we're pleased to help you along. Get used to following links to documentation or being told where to find it on your own computer. If we just say "RTFM", it's probably already on your computer. Open Konqueror and type man:commandname or info:commandname before posting a question about a command here. Better yet, open a terminal window and type $man commandname <enter> or $info commandname <enter>. Your chances of getting flamed will drop through the floor and your knowledge of Linux will earn you accolades and immoral offers from members of the opposite sex. Err, ummmm ... probably just more respect than you presently get. Forget the part about the immoral offers ... they don't happen half-often enough to make reading a man page worthwhile. But if it should work out that the information is not already on your computer, then you should query google.com using the name of the command that has you stumped or the text of the error message you can't decipher.

If you want to learn for yourself, we're willing to help. If you just want to pick our brains, you'll need to sign up for a support contract at the usual rates.

BillC
05-26-2003, 07:34 PM
Originally posted by Elijah
search>read>post@forums>mailinglists>irc
do them in order to solve most problems :D

that's my formula for avoiding getting flamed :)

Amazingly enough, if you search and read first, you will almost never have to post a simple problem.

If someone shows that they have done their homework, they will almost never get flamed no matter how far off-course they have drifted. Just google first, ask later. The problem is not that people might not comprehend some technical detail, it's trying to pick others pockets for the answers.

If I can answer a question for someone by googling for it, I don't post the answer, I post the google results page I used to get there.

How else are they going to learn?

gbarrier
06-04-2003, 07:56 AM
.

NoahsMyBro
06-04-2003, 09:28 AM
Originally posted by gbarrier

As for me, I do DD and ask questions as a last resort.


Just a quick question --
What is 'DD' ?

gbarrier
06-04-2003, 09:39 AM
Originally posted by NoahsMyBro
Just a quick question --
What is 'DD' ?

Due diligence, or to do a proper invistigation.

Elijah
06-06-2003, 05:50 AM
when planning to buy new hardware, always check to see if it's compatible!(google it!) :eek: I already have 2 devices (digicam & scanner) that aren't working .... yet... :mad:

Ludootje
06-06-2003, 06:57 AM
Originally posted by gbarrier
I'm new to this site and as one of my first posts I really hate to say something like this but in your case it's necessary... If you don't want to answer any questions then go somewhere else. If it's such a burden for you to be here then by all means go "make some money". I sure wouldn't want to be one that causes you a financial burden.

As for me, I do DD and ask questions as a last resort. But if all the steps are always followed and a quick answer is never needed or better explination wanted, there would be no use of anyone being here. We could all go and make some money elsewhere. And for the record, for that post I DON'T LIKE YOU EITHER!!! So remember me... and if I ever ask a question, let someone else amswer it! I would hate to think you were giving information to me for free when you could be making money somewhere else. A matter of fact, i'm sure everyone else new here that read your remarks would rather not deal with you either. So do the other new users a favor and just don't answer their questions either. My suggestion is for you to just quickly browse the forums then go back to work and let the truly helpful ones answer questions without belly-aching about it!!!

What a jerk!!!!
Actually, I don't mind answering questions - not at all. That's why I spend/spent so much time here. The thing I have a problem with is tzimsce's (the guy I was replying to) attitude, i.e. that people shouldn't search for help but directly ask, and that we shouldn't suggest searching.
So my post didn't mean "you have to pay us to get answers" but it meant "you shouldn't be complaining about the way we help you. if you buy something and it's not working, than you have the right to complain because you gave something to them in exchange. if someone gives you something for nothing, than you shouldn't be complaining".
IMHO there's a big difference between what I said and what you thought I said :)

bradfordgd
06-06-2003, 01:51 PM
This is for us all who spend so much time sitting on our rump behind a computer we not only see our knowledge of Linux increase, but our waist size as well...

Use plain yogert in your next tuna fish sandwich instead of Mayo.

Spell
06-06-2003, 08:35 PM
Vi commands such as / (search down) and ? (search up) work in the man pages. Nice for man pages like smb.conf.

Ludootje
06-07-2003, 12:21 PM
I don't remember if this was said already or not...

When you view a man page, its content is sent to a pager. default pager are 'more' and 'less'. to see what they do, type "more filename.txt" and "less filename.txt". The difference between both is that 'less' can also scroll up (using the arrow keys).
This makes less better than more. If you want man pages etc to use less instead of more, edit your $HOME/.bashrc and add these lines:
PAGER=$(which less)
export PAGER
and to always use less instead of more, you edit the same file and add this line:
alias more='less'

(note: for the changes to apply, either start a new terminal or type 'source ~/.bashrc')

However, there's even better then less: most. Get it from ftp://space.mit.edu/pub/davis/most/
If you want to use most instead of less (which I really recommend), you simply need to replace 'less' by 'most' in the code I gave you, and also add an alias which aliases 'less' to most.
From most's homepage (http://space.mit.edu/~davis/jedsoft/most/): "most supports multiple windows and can scroll left and right"
Another useful feature is that if you view a man page with it for instance, it colors some things like options etc.

Elijah
06-14-2003, 01:00 AM
Sub : A digital clock for your prompt [#2] LOST #422

If bash is your default shell, you can have a digital clock
as your prompt, by adding this to your .bash_profile. It has
a transparent background and looks good on Eterm/ xterms:
PS1='\u (at) \h\[\033[36;25m[\t]\[\033[32;25m:\w\$\[\033[m '


please post if anyone figured out how to set it to 12 hour format instead of 24 :)

hop-frog
06-14-2003, 01:33 AM
Originally posted by fancypiper
In the command line, use the well kept secret of mc (midnight commander), with a file manager, extractor, installer, editor ftp, and probably lots more handy tools I haven't used yet.
mc has an ftp program? where?

fancypiper
06-14-2003, 01:58 AM
Check either the right or left hand pane.

You can set one pane up on the remote as well.

An Introduction to the Midnight Commander (http://www.linuxgazette.com/issue23/wkndmech_dec97/mc_article.html)

shreev
06-14-2003, 01:22 PM
I saw a post earlier about using the & symbol at the end of a command to send it to the background...but...when the terminal from which it is started is closed...bam...the process goes off too..

To avoid this use a nohup at the beginning of the command:

for example : I start mlgui (gui fronted for mldonkey) ...I used to start it from an xterm like this...

#mlgui &

Use this instead :

#nohup mlgui &

that way the process continues runnning even when u close the xterm...

cool,huh ??:D

DavidSulc
06-18-2003, 12:01 PM
Check out this site for lots of tutorials on everything Linux, ranging from LP1 & LP2 certification courses (available for free), to configuring a caching proxy, to information about emacs, stow, cvs, etc.

http://www-106.ibm.com/developerworks/linux/

It's a great ressource !

chrisP
06-18-2003, 09:37 PM
well i just wanted to subsribe but while im at it,,
1. I add
alias rm='mv --target-directory="$HOME/.Trash/"'

to my .bashrc file.. This way if i rm something by mistake or typo a reg expression i can just go to ~/.Trash and retrieve the file or directory...

If you really want to remove something just use /bin/rm instead.....

I add a crontab to clean out the .Trash directory every once in a while...

2. Somtimes scp is a useful command.. Secure copy that uses ssh..
.....scp filename host_or_ip:path_on_remote_machine
......so maybe scp /etc/profile 192.168.1.101:/home/configbackups

onryou
06-21-2003, 04:28 AM
I get quite a bit of enjoyment out of,
atl - ctrl -backspace

It will log you out of your account instantly, so you can log on root, or another user.

Suramya
06-21-2003, 07:34 AM
Originally posted by onryou
I get quite a bit of enjoyment out of,
atl - ctrl -backspace

It will log you out of your account instantly, so you can log on root, or another user.

Actually this just kills the current x-session and pretty uncleanly at that. A lot of times you have orphan processes left running and these have to be killed manually.

I would recomend against using this instead of the logout feature. This is supposed to be a last ditch option as it is pretty bruteforce.

If I am wrong someone please correct me.

- Suramya

z0mbix
06-21-2003, 10:18 AM
Originally posted by Elijah
please post if anyone figured out how to set it to 12 hour format instead of 24 :)

Change the lower case t to uppercase ;)

Elijah
06-22-2003, 01:36 AM
Originally posted by z0mbix
Change the lower case t to uppercase ;)
That's cool, Thanks :p

most of the stuff there is kinda cryptic ... PS1?? :confused: wonder what I'm dealing with here? there a howto for this? :)

gir_ownz
06-22-2003, 02:09 AM
check your memory usage with 'free'

sploo22
06-22-2003, 01:10 PM
Originally posted by Elijah
most of the stuff there is kinda cryptic ... PS1?? :confused: wonder what I'm dealing with here? there a howto for this? :)

PS1 is an environment variable that controls your prompt (when using Bash). For more info, read the manual page.

Elijah
06-22-2003, 05:01 PM
ah, the keyword is bash?

ok, I can take off from here. Thanks :)

Ludootje
06-22-2003, 05:44 PM
I'll explain PS1 a bit more for those who don't understand it.
If you login non-graphically or when you start an x terminal (xterm, rxvt, konsole,...) then you get something like this:
your_username@hostname directory_in_which_you_are $
This is called a prompt. Like most things in GNU/Linux, you can change it. This prompt is defined by a variable - in this case the PS1 variable. There are many, many others, an example which might make it more clear is the 'EDITOR' variable. This defines your defaults editor.
so if you type this:
EDITOR=vim
export EDITOR
Then vim is your default editor. Same goes for the PS1 variable. Since you don't want to re-define those variables each time you login, you can save them in files - generally your ~/.bashrc
There's also a PS2 variable, but this one does something totally different.
There used to be a good bash prompt editing howto on zombix.org, but apparently it's gone... IBM developerworks (www.ibm.com/developerworks) has one as well, from Daniel Robbins iirc.

sceadu
07-02-2003, 12:47 AM
To scroll up or down in a terminal use:
Shft + PGUP
Shft + PGDN

slapNUT
07-11-2003, 05:51 AM
Here's how you tell a kernel what device it is booting off of.

rdev /boot/vmlinuz-2.4.21 /dev/hddX

This is helpful if you swap drives around and you cannot get a kernel to boot.

Suramya
07-11-2003, 08:56 PM
Originally posted by slapNUT
Here's how you tell a kernel what device it is booting off of.

rdev /boot/vmlinuz-2.4.21 /dev/hddX

This is helpful if you swap drives around and you cannot get a kernel to boot.

Do you enter this line in GRUB/LILO's config file or at the boot prompt?

- Suramya

Alex Cavnar, aka alc6379
07-12-2003, 10:48 PM
Originally posted by Suramya
Do you enter this line in GRUB/LILO's config file or at the boot prompt?

- Suramya

Neither. You enter it as root at the command prompt.