When navigating the Linux file system you are sure to encounter different file types. The most used and obvious file types are regular files and directories. However, the Linux operating system has more to offer in terms of file types as it also includes another 5 file types. This short article will help you to recognize all the 7 different file types within the Linux operating system.
Identifying Linux File types
There is only 1 command you need to know, which will help you to identify and categorize all the seven different file types found on the Linux system.
$ ls -ld <file name>
Here is an example output of the above command.
$ ls -ld /etc/services
-rw-r--r-- 1 root root 19281 Feb 14 2012 /etc/services
ls command will show the file type as an encoded symbol found as the first character of the file permission part. In this case it is "-", which means "regular file". It is important to point out that Linux file types are not to be mistaken with file extensions. Let us have a look at a short summary of all the seven different types of Linux file types and ls command identifiers:
- - : regular file
- d : directory
- c : character device file
- b : block device file
- s : local socket file
- p : named pipe
- l : symbolic link
Read more ...
If you ask around about Gentoo, chances are you will get mixed reviews : some will say it's a waste of time, others will say it's only for ubergeeks, yet others will tell you it's the only way, but no one can deny the power that Gentoo offers in terms of choices and speed. Gentoo is a rolling release distribution, which means it has no release numbers and it's updated continuously.Gentoo is also a source-based distribution, which means that everything you install you must compile first. What Gentoo is not : it certainly isn't for everyone. If you prefer the comfort of binary package managers that install desired software on-the-fly, if you like to install your distro in an hour or so, then you might not like Gentoo. That being said, if you're curious, aren't afraid of the command line and some compilation, if you want to have your system just the way you want it or you just want to be more 1337, this article is just what you need. You will learn how to install, what to install, how to get the most out of your system and of course have some fun in the process. We must warn you before we start : Gentoo has some of the best written documentation of all the Linux distributions and this article cannot and does not want to take its place, by no means. Although you will have a working Gentoo system after going through our tutorial, you are advised to read the handbook and all other sections of general interest, like Portage (the software management tool), for example. That said, let's get ready and start installing Gentoo.
Read more ...
System monitoring is an important aspect of any more-or-less advanced Linux user, because there comes a time when you want to know what is taking precious resources or simply how much it does take. And despite what some people think, this is not applicable only to server systems. Desktop applications go haywire too, and you find your system slowed down to a crawl because some "rogue" app decided to eat up all your memory. For enterprise users there are lots of potent free or commercial solutions for monitoring, but for the old-school Linux user and/or someone that prefers to keep it simple, there is always top(1). If you're somewhat familiar with the command line, you will probably benefit more from this article, but that doesn't mean GUI-centric users won't.
Frequently used options
Command line options
- -d delay
This option specifies delay in seconds between top's updates
- -p pid
Monitoring a specific PID ( process ID )
- -b <number>
This is a batch mode usually used to log top's output.
- -n iter
Specifies a number of updates required. For example to log top's single output this option can be combined with -b top -n 1 -b > top.log
top's internal commands
- H or ?
Displays top's keystrokes help
Kill process. Top command will ask for a PID of a process to kill.
Change process priority same by functionality as renice command
Change update rate. This is in number of seconds: 1, 0.5 and etc.
This command sorts all displayed processes by CPU usage
Same as above but sorts by Memory usage
Quit from top
You might've noticed we said nothing about installing top. That's because it's usually already installed in your distribution, and it's even to be found in a Gentoo minimal install. If you remember, top is not strange to us, as we mentioned it before, except now it's gonna receive more attention and you will get more examples and real-life use cases. As before in our Linux commands series, our main inspiration source are the manual pages, and we recommend you take a look at'em too, as these series aren't a substitute.
Actually, top can do more than just display a table of running processes. We will first concentrate on the CLI options, then what keys and options you can use in conjunction with the existing fields top displays, then we'll go on with the other possible uses of top and, of course, examples.
Read more ...
User's ability to attach a priority value to its own process upon execution determines whether you are being nice to your fellow users on the same system. Are you being nice or you simply abuse system resources for no apparent reason? In this article you will learn how to manage your processes in terms of how much processing power they consume and how to change a priority value of your processes using nice & renice Linux command. We will start with some basic theory about what is process, process scheduling, how to fork new process and then we move to nice command and explain how to change process priority value.
What is process
In simple words a process is a naming convention used by Linux to assume role of a running program. A process is a collection of rules by which any particular program makes use of assigned processor time, memory and I/O resources. Each process running on a Linux system has its own Process ID ( PID ) by which it can be monitored and administered.
Linux kernel is designed to collect various information about each process. These include, but not limited to:
- process status ( runnable, sleeping, zombie or stopped )
- process execution priority ( niceness)
- information about used resources
- owner of the process
- what network ports and files had each particular process opened
- and more...
Now that we have some idea on what the process is we can go ahead and create some process. To do this simply open your terminal and execute yes command in background and redirecting its output to /dev/null:
$ yes > /dev/null &
Read more ...
In the previous article we have discussed how to install OpenJDK java on ubuntu from the standard Ubuntu repository or Oracle's Java JDK 7 using Personal Package Archives ( PPA ). This article will cover installation of Oracle Java JDK 7 from a source package or by converting RPM Java package to the Debian software package format.
Download Oracle Java JDK 7
First, we need to download Oracle Java JDK source package from the official Oracle website. Navigate to JDK Downloads, accept license terms and download jdk-7<version>-linux-<architecture>.tar.gz. Current version of this source package is jdk-7u11-linux-x64.tar.gz and this is also what we are going to use in this tutorial. Store this tarball source package into your home directory or some other arbitrary place.
Read more ...