Powered by Blogger.

DO YOU WANT MONEY DAILY


EASY TO EARN DAILY 25$ TO 35$.FOR MORE DETAILS
CALL +919487747807

RSS FEED

Total Pageviews

Blog Archive

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, 2 March 2012

Knowing Your Linux System Via the Command Line

By Adrien | February 23, 2012 | 6 Comments

system_command_line-topEvery Linux user will tell you the same thing: know your computer. Mine always works not because there are no bugs, but because I know enough to identify their sources every time and correct them. And one of the best ways to monitor your system is through the command line. There are some great GUI for this, but the command line has the advantage of working on every computer, and it can easily be put into a script.

I propose to you five great commands for:

Knowing your kernelFinding hidden processesListing running modulesChecking disk usageLocating binaries and configuration files1. Knowing your kernel

The kernel is the core of your Linux system. It is frequently updated, and knowing its version may be important for compatibility reasons. Certain programs may require a certain version in order to work properly. It may also be important for some peripherals and modules. As an example, my Ubuntu is based on the official kernel 3.0.0. So far, the latest version is 3.2.5.

To know exactly what kernel you are using, its version, and your computer architecture, use the command:

uname -mrs

system_command_line-uname_mrs

With this example, we can clearly see that I am using the official kernel, version 3.0.0. The i686 stands for my computer architecture. Here it means that I am using a 32-bit computer. On the other hand, x86_64 would have indicated a 64-bit architecture.

2. Finding hidden processes

To know what processes are currently running on your machine, most people would recommend the command “top“. Joshua wrote a very good article about it last year at Linux Running Too Slow? Here’s How to Find the Cause. Personally, I find this command very useful, and as Joshua explains, it can even be used to monitor the RAM usage.

However, I am sometimes too lazy to search in the list provided by “top“, and if I already know the name of the program running, I recommend the combination:

ps aux | grep [name of the program]

This will have the effect of listing all the current processes, even the smallest ones that will not be picked up immediately by “top“, and then filtering them according to your keywords.

system_command_line-ps_aux_grep

This method will instantly give you the name of the user responsible for this process, the PID number, the CPU usage percentage, the memory usage, the name of the process, etc.

As a side note, if you don’t know how to kill a running process:

kill [PID number]

OR

killall [name of the process]3. Listing running modules

Modules appeared in version 2.0 of the Linux kernel. They are very useful, and you can consider them as drivers that you can load and remove from the memory. As an example, if you are using a laptop, you probably have a WiFi card. The corresponding modules for that card are probably loaded automatically at start up. If you want to save some battery, you may want to stop the card when you are not using the Internet. Removing the corresponding driver from the memory will then give you a little bit more memory (and you will also be sure that your card is disabled).

But first you need to know which modules are currently running. The command for that is

lsmod

This command is simply the combination of “ls” for listing files in a directory and “mod ” for module (I know, what a surprise).

system_command_line-lsmod

As a complement to your knowledge, you can add modules with the command

modprobe [name of the module]

and remove them via

rmmod [name of the module]

These two commands have to be launched by a super-user.

4. Checking disk usage

Keeping an eye on your system’s volumes can save you a lot of trouble. You may want to be sure that there is always enough room in /root, and remember to periodically clean your /tmp. For that purpose, there are two great commands:

lsblk

and

df -h

lsblk displays a tree representation of the partitions of your computer. It also gives you some useful information about the size of these partitions, their type, and their mountpoint.

system_command_line-lsblk

However, even if lsblk is more visual, I still prefer to use df -h. The latter gives you more information about the remaining space, the size of the partitions, and the percentage of memory in use.

system_command_line-dfh

You may have noticed that the command df alone will give you the size in bytes, which might be very hard to interpret. The option -h stands for human readable and gives you the amount of data in gigabytes, megabytes, or whatever is the easiest for a human to understand.

5. Locating binaries and configuration files

One of the first things that confused me when I left Windows a few years ago was that the file system was completely different on Linux. There is no such thing as Program Files, or a single directory for all the configuration files. But it may be very useful to know where these binaries are. For that purpose, the command:

whereis

is among the best. Similarly to

whoami

which gives you the name of the current user, or

whatis

which explains a command quickly, whereis can locate binaries, manual entries, and various configuration files. Its syntax is also very simple:

whereis [name]

system_command_line-whereis

In the example above, I asked where Firefox was, and the command returned the location for its binary and various directories, as well as the manual page.

But one of the greatest strengths of whereis is its ability to locate standalone configuration files. Here is another example, where I was searching for rc configuration files:

system_command_line-whereis_config

Such options can become very useful, especially if you are not using Ubuntu but another distribution like Archlinux which requires a serious amount of time to edit these files.

Conclusion

With these commands in your pocket, you will be able to see a little more of what is going on in your system. If you still prefer to have a GUI for that, I would still recommend things like Baobab for the files and Gnome System Monitor in general.

Are you using other commands? Other GUIs? Let us know in the comments.



Print this pageSave as PDF

Adrien is a young but passionate Linux aficionado. Command line, encryption, obscure distributions... you name it, he tried it. Always improving his system, he encountered multiple tricks and hacks and is ready to share them. Best things in the world? Math, computers and peanut butter!4 Must Have Browser Addons To Protect Your Online PrivacyRandom PostSchedule Your Emails to Send Later With RightInbox Alaric

Nice post…I didn’t know about some of these.

http://www.tahutek.net/ Damar Riyadi

Great post! Thanks for the info :)

Anonymous

Adrien, when I attempt to run «lsblk» on my 64-bit Ubuntu Natty box, I get the following :

mhenriday@mhenriday-GA-990FXA-UD3:~$ lsblk
Kommandot “lsblk” hittades inte. [The command "lsblk" was not found.] Menade du [Did you mean]:
 Kommandot “lslk” från paketet “lslk” (universe) [The command "lslk" from the "lslk" package (universe)]

which, of course, is another thing entirely. Any idea why I’m getting this response ?…

Henri

Adrien

Hello Henri,
I tried the same thing on an Ubuntu 11.04 in 64-bit and I got the same error message.
However, there was no problem on a version 11.10. lsblk is part of the util-linux package and as you can see, this package is present on 11.04:
http://manpages.ubuntu.com/manpages/precise/en/man8/lsblk.8.html
http://packages.ubuntu.com/natty/util-linux
I searched a little and so far I can guess that it is related to the Natty. lsblk seems only to work on 11.10 and higher.
Strange but you still have df -h that I recommend.
Adrien

Mr. M2M

hi, Adrien. Good post,. We re using Openwrt as the basis for a new product and would welcome any comment as to what commands ar eparticularly useful in that type of distribution? 

Adrien

Hello Mr. M2M.
To be perfectly frank, I know very little about Openwrt. But as far as I understand, it can really depend on the type of product that you want. Without any specifications, I can assume that your product will be closely linked to routers and other devices related to the internet. In that case, useful commands can be for firewall, like Iptable, or network scan, like iwlist scan. You can also think of ssh and scp for file tranfers. Finally, I know that a main command for Openwrt is uci, for Unified Configuration Interface. It is responsible for making changes to the filesystem located under/etc/config/.
I hope this helped you at least a little.

Advertise hereRecommendationsTake Our PollFollow Us On Facebook About Make Tech Easier

Make Tech Easier is a tutorial blog to help you solve your daily technology woes. One of the top 100 Info Tech blog in Technorati, Make Tech Easier is the place to go for hardware and software tutorials, reviews, tips and tricks.

The topics we covered here include Windows, Linux, Mac, iPhone, Android, Google, Firefox and many other tech related stuff. We do what we believe: Uncomplicating the complicated, making life easier!

Get Connected With Us


HomeAboutAdvertiseJobsPrivacyRSS Feed Terms© 2012 Make Tech Easier. All rights reserved Quantcast

Thursday, 29 December 2011

Opinion: How to make Linux the preferred desktop choice

Opinion: How to make Linux the preferred desktop choice

How to make Linux the preferred desktop choice

The fight for the desktop might be entering its final phase, but not in the way any of us could have imagined 10 years ago.

In an interview at www.derstandard.at, for example, KDE's Aaron Siego said that the desktop is losing importance in the same way as newspapers, and after a conversation with Miguel de Icaza, Tim Anderson posted on his blog that the former Gnome founder felt that many of the benefits in open source development had played against the success of Linux on the desktop.

According to Miguel, this was because of fragmentation (my word) in the number of times we break the APIs for developers, and the cycle of upgrades that cause incompatibility between distributions, and even different versions of the same distribution.

Even suggesting that there's too much choice is controversial, as I've found out in the past, and Miguel has brewed a small storm with his statements. But there are two elements in his argument that change the angle, and I think set a new challenge for both Linux and Windows for the next 10 years.

The first is connected to the idea that the desktop is beginning to matter less - a point also made by Rob Pike at Google and many others since the release of the iPad. But it's important to differentiate between what might be seen as a fad for tablet computing and the obvious target for any desktop growth, and the increased pervasiveness of all technology in our lives.

It's not just smartphones that replace PCs - you could just as easily accuse internet enabled televisions, games consoles and satellite receivers of stealing desktop market share. But what these devices have really done is take an application off the desktop and move it into a more convenient form factor - regardless of whether that's a TV for YouTube or a fridge for recipes.

The result is that we no longer have as much need to sit down formally at a desk and use the computer. That doesn't mean they're becoming redundant - they're just becoming more specialised, and that leads to another of Miguel's issues.

Not enough good apps

"When you count how many great desktop apps there are on Linux, you can probably name 10. [If] you work really hard, you can probably name 20," he's quoted as saying. There's a lack of killer applications for Linux.

I think he's right. If applications are becoming less PC-centric, we need better reasons for using a desktop. Linux faces an uncommon challenge when you need a solid excuse to use one particular system over another, especially when it requires more effort to configure and set up.

The challenge is that I don't think we'll see that killer application. Any application worth the effort will be ported to both Windows and OS X, as has happened with many of the most popular open source projects.

Major releases of software like Audacity, Inkscape, Scribus, LibreOffice and Ardour are almost certainly downloaded more hungrily for systems other than Linux, at least initially (and we won't go into why you can't just download a package and install it on any Linux system).

That's a good thing. Free software is about more than just an operating system, and the more that can be done to unshackle users from proprietary alternatives or pressure their developers to be more open, the happier we'll all be.

All about the desktop

For that reason, the killer application has to be the desktop. The desktop is the best expression of the freedom found within the kernel, as well as community user interface design. It's what makes Linux different from the alternatives, and it has to be the reason why you want to choose it over Windows or OS X.

And while freedom is obviously a big motivation, both in cost and in the availability of the source code, when you move away from software idealism, there needs to be something else.

The problem is that this 'something else' is missing. There is no single desktop you can point to and say 'look at Linux'. Which is a pity, because there's great potential in the Gnome and KDE desktops that will likely be the inspiration behind many new features in their competitors.

Look at the drag-down task switching in Plasma Active, for example, or the touch scrolling for desktop windows, and I bet you'll see replicas of these functions in future versions of either OS X or Windows.

The trick has to be getting people to the Linux desktop first, and making it their preferred environment for desktop tasks like office work and browsing. We shouldn't get distracted by tablets and iOS, and should instead use the genius of open source software to create a singularly awesome desktop that everyone wants to use.



Labels

Design by araba-cı | MoneyGenerator Blogger Template by GosuBlogger