Go Back   Cyber Tech Help Support Forums > Operating Systems > Linux

Notices

Linux Problem solving for all open source distributions of Linux, such as Debian/Ubuntu, Fedora, RedHat, Suse, Mandriva and other proprietary unixes such as Solaris, SGI Irix. Newbie friendly too!

Reply
 
Topic Tools
  #1  
Old July 8th, 2003, 10:33 PM
Dodge's Avatar
Dodge Dodge is offline
CTH Subscriber
 
Join Date: May 2001
O/S: Windows Vista 32-bit
Location: Kentucky
Age: 47
Posts: 6,421
Tips and tricks.

How about posting your tips and tricks for everyone. As I am new to linux, I'd like to see what you all have found to help speed up linux.

Since I'm new I dont have tips or tricks yet. Haven't really had time to dive into Mandrake really good yet.
Reply With Quote
  #2  
Old July 8th, 2003, 11:57 PM
R4NG3R's Avatar
R4NG3R R4NG3R is offline
Senior Member
 
Join Date: Feb 2003
Location: TEXAS
Age: 34
Posts: 729
Remember this:

"The command line is my friend."

-TwistedCranium
Reply With Quote
  #3  
Old July 9th, 2003, 02:26 AM
twistedcranium's Avatar
twistedcranium twistedcranium is offline
CTH Subscriber
 
Join Date: May 2003
Posts: 1,133
add aliases to your bash rc to automate commands

One of the first thing that I do when I get an account on a unix/linux machine at work or setup a linux install at home is to modify my bash shell profile to preset aliases for me.

Firstly, I should mention that the 'bash' shell is the default shell loaded with the recent RedHat versions and is likely the most commonly used shell in the linux/unix world. When you fire up a terminal window, that command line is your shell. To determine what shell you're currently using type 'echo $SHELL' at the prompt. Pick your shell from the following

ECHO RESULTS
/bin/bash.............bash shell (bourne again shell)
/bin/sh...............bourne shell (predecessor to the bash shell)
/bin/csh..............C shell
/bin/tcsh.............enhanced version of C shell

Secondly, I'll mention what an alias is. An alias is somewhat like a variable that can be used to reprlace a string of characters. For example, lets say that you want to do a long listing of the files in a directory, with all the attributes shown as well as hidden files and pause the listing should it scroll off the screen. This command would be 'ls -la |more'. That's hard to type, especially if you do this often enough...so we create an alias to handle this command for us.

At your shell prompt, type

alias llm 'ls -la |more'

from that point on during that shell terminal session all you need to do is type llm and it will execute the full ls command with the -la switches and pipe that to the more command to pause the scrolling.

Now, the alias feature is great, but wouldn't it be even better if you could put a collection of aliases somewhere and have them available in a moment's notice in any shell terminal session. Well, you can do that by editing your bash shell RC script.

In your user directory (/home/username) there should be a file named .bashrc which you can edit in a plain text editor. Here is a sample....

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

PATH=$PATH:$HOME/bin:$HOME/utils:/sbin:/bin:/$HOME/programming:/$HOME/programming/Projects
export PATH

# aliases
alias trash="rm -rf"
alias ll="ls -la"
alias lm="ls -la |more"
alias pss="ps -U username"
alias shred="shred -u"

PS1="[\t][\u \w]\$ "


**notice the alias lines in the RC file?

These lines set the aliases for you each time you open a terminal shell session as the system processes your .bashrc when starting the session. The trash alias I use delete a file or folder and tell it to ignore the "are you sure?" prompt; the ll and lm are my listing aliases; the pss alias tells me what processes I have running as username; and shred just allows me to use the shred command without having to use the -u switch.

Soooooo, anytime you catch yourself typing the same text more than three times, alias-away!!
Reply With Quote
  #4  
Old July 9th, 2003, 10:04 AM
Dodge's Avatar
Dodge Dodge is offline
CTH Subscriber
 
Join Date: May 2001
O/S: Windows Vista 32-bit
Location: Kentucky
Age: 47
Posts: 6,421
I find this utility very useful for when you are in Windows and want to view files you have downloaded in a linux partition. Explorer2fs
Reply With Quote
  #5  
Old July 10th, 2003, 12:19 AM
twistedcranium's Avatar
twistedcranium twistedcranium is offline
CTH Subscriber
 
Join Date: May 2003
Posts: 1,133
Ease the GIMP window arrangement

Do you work with graphics in The GIMP? Have you opened the application in the midst of tons of other windows and spend a bunch of time minimizing/maximizing all of the little tool windows that make up GIMP when you switch between applications?

If so, then here's a tip that will make working with The GIMP much easier:

Create a desktop in KDE or Gnome and name it GIMP. Only open The GIMP in that desktop, and open nothing else in there. This way, all the GIMP windows are managable by clicking onto another desktop.

You'll also want to make the wallpaper backdrop in that desktop a solid color that is easy on the eyes and not distracting so that you can focus on your graphics work.
Reply With Quote
  #6  
Old July 10th, 2003, 12:36 AM
smurfy's Avatar
smurfy smurfy is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: Linux
Location: Christchurch New Zealand
Posts: 9,538
Good tip, but tell me, is there a way to force any application to always open in a designated desktop?
e.g. any time I launch Opera, I want it to load into "internet" desktop, any time I launch the Gimp, it should load into "graphics" desktop, if I launch XMMS I want it in "media" desktop etc...
Reply With Quote
  #7  
Old July 10th, 2003, 12:41 AM
twistedcranium's Avatar
twistedcranium twistedcranium is offline
CTH Subscriber
 
Join Date: May 2003
Posts: 1,133
Quote:
Originally posted by smurfy
Good tip, but tell me, is there a way to force any application to always open in a designated desktop?
e.g. any time I launch Opera, I want it to load into "internet" desktop, any time I launch the Gimp, it should load into "graphics" desktop, if I launch XMMS I want it in "media" desktop etc...
Hey...I've been wondering the same thing for a few weeks now. This is on my list of "Linux Things To Resolve", and as soon as I get it, I'm posting it here brotha!


*****EDIT: EUUUUUUUUURRRRREKA!!!

I got it! I'll post it in a few minutes when I explore all the tweaks.

Last edited by twistedcranium; July 10th, 2003 at 02:28 AM.
Reply With Quote
  #8  
Old July 10th, 2003, 03:01 AM
twistedcranium's Avatar
twistedcranium twistedcranium is offline
CTH Subscriber
 
Join Date: May 2003
Posts: 1,133
Autostart an application in a specific desktop in KDE

Neat little trick here....

KDE has an Autostart feature. Any application links that you place in the autostart directory will be started when you log in to KDE.

This directory exists at

/home/user/.kde/Autostart

So any applications that you place links to in this directory will autostart. The apps will start in the first desktop that opens.

If you're like me and have separate desktops for all the types of programs you run, then it would be much more convienient to have these programs start in the desktop that you would normally work on them in.

When you create the link, the 'Command' field on the 'Execute' tab of the 'Properties' form for this link can be edited to something like the following:

kstart --desktop 2 kdf

kstart is a program that you can use to start an application in a special way. The '--desktop' parameter tells kstart to start the application on the 2nd desktop, this must be a number in the desktop order and not the desktop name. The name of the application is the next parameter.

Enjoy!

**note, as I write this, I am unable to get 'The GIMP' to start in the specified window in the kstart command. It is being the exception to this rule I suppose.

Last edited by twistedcranium; July 10th, 2003 at 05:10 AM.
Reply With Quote
  #9  
Old July 11th, 2003, 02:17 AM
smurfy's Avatar
smurfy smurfy is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: Linux
Location: Christchurch New Zealand
Posts: 9,538
will try to fiddle with this tonight. IF this only works in "Autostart" it may not be what I'm looking for (don't want it to run on boot which is what I thought Autostart did with all it's links) but it sure gives me a starting point.
Then I have to make it work in ICEWM.
Reply With Quote
  #10  
Old July 11th, 2003, 12:29 PM
smurfy's Avatar
smurfy smurfy is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: Linux
Location: Christchurch New Zealand
Posts: 9,538
WoooHooo!

Well that is way cool!

It works everywhere, not just in Autostart.
Created new Desktop links - you can include the "kstart --desktop" parameter there.
Edited menu item using MenuDrake (this is on mandrake) and can include the parameters there as well.

Re: the Gimp.
Same behaviour here BUT I noticed (this may be because my machine is a little slower than yours tc) the startup (loading) screen for the Gimp loaded in the correct destination desktop but then the application windows loaded into the active desktop. So if I was in desktop 1, and told Gimp to load in Desktop 2, I'd see the window appear in the desktop preview on desktop 2 but the Gimp windows still appeared in front of me on Desktop 1. Possibly a setting that can be changed within the Gimp (did some fiddling with the "interface" settings under preferences to no avail).

About to see if my menu changes had any affect in ICEWM (my preferred desktop environment at the moment). I'm picking they don't since this is a "K" command....?
Reply With Quote
  #11  
Old July 11th, 2003, 12:41 PM
smurfy's Avatar
smurfy smurfy is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: Linux
Location: Christchurch New Zealand
Posts: 9,538
nope, only works in KDE
Reply With Quote
  #12  
Old July 11th, 2003, 02:12 PM
twistedcranium's Avatar
twistedcranium twistedcranium is offline
CTH Subscriber
 
Join Date: May 2003
Posts: 1,133
Quote:
Originally posted by smurfy
nope, only works in KDE
Would be sweet if they (IceWM) have a similar feature.

I'm dreaming up a bunch of ways to set this up. The neatest one that I have so far is having the Firestarter Firewall GUI open through kstart, with sudo so that it runs as root, and goes to a desktop that I have named "System".
Reply With Quote
  #13  
Old July 11th, 2003, 02:52 PM
smurfy's Avatar
smurfy smurfy is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: Linux
Location: Christchurch New Zealand
Posts: 9,538
Nearest I've found so far is the "workspace" option in winoptions file
http://www.icewm.org/manual/icewm-12.html

May have a play later today - it's 1:47am here and I'm outta here.

**edit - just found this**
http://www.icewm.org/FAQ/IceWM-FAQ-6.html#ss6.1

Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Topic Topic Starter Forum Replies Last Post
Anybody use Minitube. Any tips and tricks craisin Linux 33 June 4th, 2012 01:50 AM
IE7 tips & tricks zipulrich Internet / Browsers 4 October 30th, 2006 02:28 AM
Tips & Tricks drumstik Windows XP 4 October 23rd, 2004 04:11 PM
tips and tricks RichardJones Windows NT, 2000, 2003, 2008, 2012 4 February 11th, 2004 01:02 PM
Tips and Tricks..... Dodge Windows 98 2 January 12th, 2002 06:37 AM


All times are GMT +1. The time now is 11:34 AM.