I see this question a lot in search engines requests which point to this blog. And if you're so interested how this is done, I'm happy to explain.
Entries Tagged 'Basic stuff' ↓
How To Find Your UID From Bash
March 28th, 2008 — Basic stuff
How To Find What Symlink Points To
March 26th, 2008 — Basic stuff
To some this may seem like a trivial task, but I see great interest from Unix/Linux beginners arriving to this blog: how exactly does one confirm what a symlink points to?
First of all, if you haven't already done so – read my Unix Symlink Example post to learn what a symlink is and to refresh your mind about creating symlinks.
How To Find the Largest Files in your Unix system
March 24th, 2008 — Basic stuff, Linux, Ubuntu
I see that my Finding Large Files and Directories post is quite popular, yet there are a few more ways to simplify your search for the largest disk space consumers in your Unix system.
Make find command show file sizes
If you remember, the default way a find command reports results includes only the fully qualified (that means including the full path) filenames.
Now, if you look at a task of identifying the largest files, it's great if you can get a list of all the files bigger than some figure your specify, but what would be even better is to include the exact size of each file right into the output of the find command.
Continue reading →
How to Find the Owner of a File in Unix
March 20th, 2008 — Basic stuff
Surprisingly, I see quite a few questions around file ownership asked all the time. And one of the first questions asked concerns the Unix user who owns a particular file.
It's very easy to confirm who the owner of a file is, and you can do it using the ls command.
Continue reading →
Unix filesystem basics: symlink example
February 14th, 2008 — Basic stuff, Unix
I can see some of you have arrived to my Unix file types post looking for an example of using symlinks in Unix. Today I would like to give you a quick introduction into Unix symlinks.
What is symlink?
Symlink is a short name for symbolic link (sometimes also referred as soft link) is a special type of file in Unix, which references another file or directory. Symlink contains the name for another file and contains no actual data. To most commands, symlinks look like a regular file, but all the operations (like reading from a file) are referred to the file the symlink points to.
Continue reading →
How To Find Out Which Group a Unix User Belongs To
January 30th, 2008 — Basic stuff
If you know the name of a particular user on your Unix system and just want to confirm the primary Unix group (gid) of this individual, just use the id command:
$ id -g greys 115
bash: Find Out the Version of Your Unix Shell
January 21st, 2008 — Basic stuff
bash (Bourne Again SHell) comes with pretty much every Unix-like OS these days. If you ever wonder what exact version of bash shell you have on your system, here's how you find out: just use the –version parameter in the command line.
Using /bin/bash to tell its version
On RedHat Linux, this is how it might look:
bash-2.05b$ /bin/bash --version GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu) Copyright (C) 2002 Free Software Foundation, Inc.
Unix Sockets Tutorial
January 15th, 2008 — Basic stuff, Unix
I've noticed how many people found other pages of this blog trying to find more information about Unix sockets, and so I thought it's about time we shed some light on this seeming mysterious, but really simple concept.
What is a Unix socket?
A Unix socket (the technically correct name for it is Unix domain socket, UDS) is a way of inter-process communication (IPC) in Unix. Like almost everything in Unix, a socket is a file. It's a special file, to be precise. Unix processes which want to communicate between each other use special set of functions to access the special file of a Unix socket, and easily exchange data in both directions.
In very simple terms, a Unix socket is nothing but a byte steam – a data transfer between processes running locally or on networked Unix systems.
Continue reading →
sudo tutorial
January 11th, 2008 — Basic stuff
sudo allows you to run a Unix command as a different user. Using /etc/sudoers file to confirm what privileges are available to you, this command effectively elevates your access rights, thus allowing you to run commands and access files which would otherwise be not available to you.
How sudo command works
The real and effective user id (uid) and group id (gid) are set to match those of the target user as specified in /etc/sudoers file (the safest way to change this file is to use the visudo command - check out the visudo tutorial). The way you use sudo is simple enough: you run this command and specify a command line you'd like to run with the privileges of a different user. Before the requested command is run, you are asked to confirm your identify by providing your user password.
Find Compiler Version in Unix
January 2nd, 2008 — Basic stuff, Unix
Finding the compiler version in your Unix system should be the first step before you attempt to compile any package from its source codes. In fact, if you're familiar with the common compilation routine, the configure script which you run to generate the Makefile before compiling anything does exactly that – it finds out which compilers (if any) you have installed on your system, and confirms their versions and capabilities.


