|[Home] [Credit Search] [Category Browser] [Staff Roll Call]||The LINUX.COM Article Archive|
|Originally Published: Wednesday, 27 December 2000||Author: Trae McCombs|
|Published to: learn_articles_firststep/General||Page: 1/1 - [Std View]|
10 tweaks to your Linux boxen that will make your life muuuuch easier!
So you are a newbie user, and are finding this whole "command line" thing a bit too much of a cross to bear? Well, hopefully, here are a few tips to help ease your pain.
Yup, I know it may sound corny, but once you get used to it, you will love it! A terminal program in X is probably one of the most used programs. If you have quick easy access to it, then you can become more efficient. (BTW, I know you can do this with the following window managers: blackbox, enlightenment, sawfish, windowmaker.) You may have to do some research in order to get your window manager to perform this task.
This one most of you may know, but some of you don't know. Do you type "exit" all the time when trying to get out of a terminal program? Or do you look for the big X to close that term out? Well, simply hit the keyboard combinations of "ctrl + d" and it will log you out!
Another really cool useful tool while in an Xterm. Lets say you have tons of stuff on your screen and you want to work from a "blank palette". If you hit the following keyboard combinations: "ctrl + l", then it will clear your screen for you.
Ok, there are tons more, but this is the last one as far as a "command line" tip that I'll give you so we can move on into other things. If you are typing something on the command line, or even in Netscape or any X based utility, you can simply type: "ctrl + u" and it will erase every thing on that line. Quite handy, huh?
One of the worst things for me, is having tons of stuff in my home directory. One way to keep it clean and tidy is to keep your src's or various other things that you play with from time to time in a "test/" directory. I started doing this for one main reason; when someone tars up a file, and doesn't make it its own directory, then you wind up tossing TONS of stuff into your home dir. This makes for a nasty scene. If you simply mv that stuff to ~/test/ and use that, then its much easier to keep track of.
Tab what? This is something that a lot of you might not have heard of. It's a VERY handy tool that lets you negotiate your way around the command line quite efficiently. How does it work you ask? Well, lets say you are in your home dir, and you have a directory called: ~/foomonger. Well, one might be inclined to simply type: cd foomonger and spell the whole thing out right? What you want to do is this:
cd foo(tab) You'll notice that it completes the rest of the word.*note* if two things start with foo, you'll have to hit tab twice, and it will show you a listing of everything that has "foo" in it. Enjoy!
Ok, this is probably THE best tip you'll read about here. Everyone knows how nasty of an application Netscape is, right? Isn't it a pain to have to do the following by hand all the time:
# killall -9 netscapeIt gets to be a pain. So why don't you, as root, do the following:
# cd ~/.netscape
# rm -rf lock
cd /usr/local/binvi killnetscape (or use your favorite editor) [put in the following]
killall -9 netscapewrite that file, and then simply do this:
rm -rf ~/.netscape/lock
chmod 755 /usr/local/bin/killnetscape
Make a shortcut to this handy little script, and you are set!
(The mode has been changed, thanks goes to a reader who pointed out the error.)
Some people might not like this tip. And I'd like to warn you about using it because it can be a security hazard. But heck, if its just a personal desktop, or laptop, and you want to make your life easier, then this tip is for you. Install the application sudo.
sudo - execute a command as another user
One cool thing about this, is you can execute a command as root without being root. Here is the thing you can do to make your life easier after you have the sudo application installed:
vi /etc/sudoers (or your favorite text editor)Add this below: # User privilege specification
YOUR_USERNAME ALL=(ALL) NOPASSWD: ALLWrite that file, and then try and do something as root from that user, like
# sudo vi /etc/sudoersNotice how it worked while you weren't root? Pretty nifty, huh? The only thing I'd again like to warn you is not to use this in an area where you are worried that co-workers, or anyone may be able to physically have access to your machine. If you can type sudo "foo" then they can too.
One of the easiest and quickest ways to beef up security on your box is by turning things off in your /etc/inetd.conf file. It doesn't mean you will have things totally secure, but it will help. As an old friend of mine Todd Lewis, and security person at Mindspring used to say: "if you don't need it, turn it off!". Here is how you do it:
vi /etc/inetd.confThen, in front of anything you don't need or use, put the # symbol. like:
#telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetdAfter you have done that, simply type:
#ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.ftpd
# killall -HUP inetdThis will restart services, and make it so that things come back up. Notice though, that you won't be able to telnet or ftp to your machine. :) But who cares when you have ssh! You DO have ssh installed right?
Yes, I know this is something most people know about, but dang it, if you don't know about it, it will make your life difficult.
In your ~/.bashrc or ~/.bash_profile or maybe even ~/.profile (depends on your distro), put the following:
alias ls="ls --color=auto -F -s"Now, write-quit that file, and then either log out, or simply source the file to make the changes:
source ~/.bashrcNow, type ls
Look at the great pretty colors! Pretty nifty huh? This will help you while you navigate your system, and should seriously make using the command line that much more pleasant of an experience.