Author: Kurt Hartman Jr
First off, let me say that I am not one of those terminal loving Linux fans. I think it is cool and all, but I tend to save the command line for things that either require doing a massive batch job, or when I need to do something really specific.
Other than that, I stick to the Gnome GUI, and work within the parameters that various menus offer me. That works for 99% of what I need done.
However, I have found a very few commands that I need on a reasonably regular basis. Since I tend to be somewhat command line averse, I figure I’ll throw them out there, for those of you who are new Ubuntu (or other type of Linux users).
Without further adieu, here they are, in order of usefulness to me:
1. ps -A : This will show you a list of all running processes, along with displaying a process id number. This command is helpful, because it is necessary when you run command #2.
2. kill -9 [insert process id number] : This tells the program associated with the process id number to die instantly. For instance, if Amarok was running with a process id number of 8077, and it was hung, or not responding, you would open up a terminal and type: kill -9 8077 . That means “Don’t ask me any questions, don’t ask if I want to save my work. Close immediately. Do not pass Go, do not collect $200.”
3. locate : locate is a very powerful search. Basically, open up a terminal, and issue the command: locate , along with any part of a filename you want to find. locate will give you a reading where any part of that text string appears, along with giving you the exact location of the file(s) in question.
4. lspci and lsusb : Okay, so there are really 8 commands, but these two are two sides of the same coing,so I am throwing them both in together, as a kind of bonus.
lspci , when issued, gives back a list of everything connected to the PCI bus, along with your graphics card, and some other fun stuff.
If you are having driver issues, many times, the first thing that a help forum will ask you to do, is give them what lspci prints out. lsusb does the same thing, but gives you a rundown of your USB devices. While it may seem rather redundant, especially since you can already see what is connected to your pc, I assure you, it is not. Many times, the manufacturer of the PC, will use one of the built in USB hubs to attach the webcam, a card reader, or some other piece of built-in hardware.
5. pstree : Ever accidentally kill off a process, not knowing that it was being used by a program you wanted to keep up and running? pstree can solve many of these problems. Issuing the pstree command, shows all your processes in a “treed” hierarchy, meaning you can see what process goes with what program. A must-have.
6. ifconfig : While ifconfig will let you actually configure a device, most of the time, you will be typing it to get basic feedback on your networking devices. It is especially helpful when troubleshooting your wireless ethernet. Issue the command, and it gives you back your current ip address, MAC address, and a ton of other useful information. Good stuff.
7. chown : chown , or “change ownership”, allows you to do exactly that, for any given file, at any given time. For instance, if you have a public computer, and you don’t want just anyone to be able to access your file (diary.txt), then you would issue the command: chown root diary.txt (assuming permissions to view or edit are only available to the owner of the file) . This would give control of the file over to root, and require a password to view.
The only exception would be if you are running your PC, under the root user, in which case, you have far greater problems than someone reading your diary.
There are many other useful Linux commands that you will learn. Hopefully, these make your day a little easier, and your time using Linux more productive.
About the Author
Kurt Hartman is a 3 1/2 year veteran of Linux usage, and Head of Web Development for a company that sells heavy equipment and haul truck tires, at http://www.otrtiresupply.com
- Linux Terminal: An lsof Primer
- How to check if you are vulnerable to shellshock
- Ripping DVD with Handbrake on Linux
- Linux: Timeouting commands in shell scripts
- Switching to Linux, Checklist
Find me on Google+