June 18th, 2009 — Basic stuff, Scripts, Unix
Hi! If you're new here, you may want to subscribe to the Unix Tutorial RSS feed to get regular tips & tricks for all flavors of Unix. You can follow me on Twitter, too! Thanks for visiting!
Although I've already shown you how to sum numbers up in bash, I only covered the bash way of doing it. I really like scripting with bash, but when it comes to calculations, there's quite a few important features missing from bash, and fixed point (thanks for the correction, Azrael Tod!) calculations is one of them. Fortunately, bc command comes as a standard in most Unix distros, and can be used for quite complex calculations.
Basic calculations with bc
bc is a very simple command. It takes standard input as an expression and then evaluates this, performing all the necessary calculations and showing you the result. Thus, to quickly sum numbers up or get a result of some other calculation, simply echo the expression and then pipe it out to the bc command:
ubuntu$ echo "1+2" | bc
3
Continue reading →
June 9th, 2009 — Basic stuff, Unix
One of the really useful features almost every Unix shell has is support for command aliases – a way to run a command or a series of Unix commands using a shorter name you get associated with such commands.
An example of a command alias in Unix shell
Here's one of the most useful aliases I have for Solaris systems:
solaris$ alias ls='/usr/local/gnu/bin/ls --color -F'
Continue reading →
May 15th, 2009 — Basic stuff, Linux, Ubuntu
SSH (Secure SHell) is possibly the best way to remotely access a Unix system – it's very secure thanks to automatic encryption of all the traffic, and it's also quite universal because you can do all sorts of things: access remote command line shell, forward graphics session output, establish network tunnels and set up port redirections. Today I'm going to show you how to get started with SSH in Ubuntu.
Installing SSH server in Ubuntu
By default, your system will have no SSH service enabled, which means you won't be able to connect to it remotely using SSH protocol (TCP port 22). This means that installing SSH server will be one of the first post-install steps on your system.
The most common SSH implementation is OpenSSH server, and that's exactly what you want to install.
Continue reading →
May 14th, 2009 — Advanced topics
As some of you may know already, I've recently restarted my activity on another technical blog of mine: Solaris blog.
Solaris blog: http://solaris.reys.net
Solaris blog is the very first blog I started, I was actively posting new material in 2006-2007. Since then my primary focus had shifted to Linux systems, but I realized that I miss Solaris so much that I still need to play with latest versions and features in Solaris 10 and OpenSolaris.
Today I'd like to offer you a few articles from Solaris blog, let me know if you find them useful:
Most of these topics are fairly technical and expect you to have previous knowledge of Solaris OS, but Unix Tutorial is here to take care of the basics – so ask away and I'll be glad to help you discover Solaris in my future posts.
May 11th, 2009 — Basic stuff
show disk size in Unix is a very popular request visitors use to arrive at my Unix Tutorial pages. Since I never addressed the question of confirming the number of hard drivers available on your system or the task of finding out a disk's capacity, I'd like to document a quick and easy way of doing just that.
I hope that when someone looks for a way to show disk size, what's really expected is a command to help you confirm the capacity of a disk in gigabytes.
Using fdisk command in Linux
One of the easiest ways to learn a lot about hard drives installed on your Linux system is to use the fdisk command: Continue reading →
May 8th, 2009 — Linux, RedHat, Ubuntu
I had to download a piece of software today for one of the servers which I haven't used in a while. A question of confirming the 64bit CPU capability came up, and I realized that I never mentioned it here on Unix Tutorial.
Some of you probably remember the uname command which also shows you similar information, but uname confirms the running kernel of your OS and not the CPU capability: if you're booted into 32bit mode, it will not help you to recognize the 64bit potential of your system.
Obtaining CPU information from /proc/cpuinfo
Most Linux distros will have the special /proc/cpuinfo file which contains a textual description of all the features your processors have. This is a very useful file – depending on your task it may help you identify any features of your processors, as well as confirm the overall number of CPUs your system has installed.
Most commonly, the following information is obtained from /proc/cpuinfo:
- processor model name and type
- processor speed in Mhz
- processor cache size
- instruction flags supported by CPU
Continue reading →
May 6th, 2009 — News
I'm finally getting ready to start publishing some tips with screenshots, so today it's just a humble screenshot tour of my fresh Ubuntu 9.04 install.
Let me know if you struggle with any graphics desktop functionality, and I'll try my best to help and show it with screenshots.
By the way: I really like one of the new community themes which come with Ubuntu 9.04, it's called the Dust theme.
May 5th, 2009 — News
Next batch of Unix-related news, this week it's just about announcing all the new releases of various distros.
Unix news
Unix-related releases
See also:
April 21st, 2009 — News
Hi all! New posts are coming, but you'll have to wait a bit longer. Here's a few interesting reads you might explore in the meantime:
Unix news
Unix-related releases
Useful Unix tips
See also:
April 9th, 2009 — Linux
Hi everyone, I'm finally back from my holidays, and simply cannot wait to share some more Unix tips with all of you!
Today I'll talk a bit more about yet another way of learning version information about your Linux OS: the /proc/version file. I mentioned it briefly in one of the previous posts, but would like to finish the explanations.
What you can learn from /proc/version
This file will not show you the name of the actual OS release, but will instead give you specifics about the version of Linux kernel used in your distribution, and confirm the version of a GCC compiler used to build it.
Continue reading →