Sysadmin

Recent in Sysadmin

Howto: Find the uptime and system load of a Linux machine using uptime command

Uptime is the amount of time a machine has been up and running, providing all its services without any downtime. For a linux machine, this information can be found out using the “uptime” command. Along with the uptime, this command also tells you how many users are currently logged in and the load on the system in the past 1, 5 and 15 minutes.

How to exclude a set of files from disk space usage calculation using du

We have already discussed the most common options used with du - a tool to check/calculate file space usage. In its most basic form, du tells you the size of all the files in a given directory. Using -s option it sums up the total size of a directory, but what if we don’t want to include a set of files while calculating the utilized space.

Fun with Linux - Changing the root user name

So, here is the crazy thing that I have been doing lately - changing the root username! It may seem absurd to some and simple/straightforward to others, but it was one of the most fun and learning times I had with Linux for a long time. In this post, I’ll tell you how I approached the issue and screwed up badly multiple times until I finally got it right.

Before we start, I want you to keep a few things in mind.

The history of /etc/passwd and /etc/shadow files

So, I learned something important today. When you don't have an Internet access but have still got work to do, may be with a heavy heart, but you eventually end up in a library. As it turns out, reading a howto from a book is fun too. I was looking to do a crazy thing on my system(lets leave that story for some other day ) and while I was looking for something related, I came across a wonderful write up on /etc/passwd and /etc/shadow files.

Differences between su and su -

When you use Debian/Ubuntu for a long time, you tend to forget about su and gradually you both grow apart. I witnessed the same thing yesterday. I was working in a lab and my friend asked me, “Why’d you use su -. Why not a simple su!”. I replied, "Duh!" and then sat silently the rest of the time wondering why I couldn't remember a thing about the command which has been hard-coded in my brain all this time while my friend enjoyed the blackout.

Use the lscpu command to get CPU/Processor information on Linux

There are a lot of ways to get information about your system’s cpu. You can either dump the contents of /proc/cpuinfo file, lshw or my recent discovery "lscpu". This utility gathers all the data from sysfs, /proc/cpuinfo file as well and shows it in a human readable format.

How to: Get the Inode utilization data of a filesystem using df command

When we talk about a file in ex2/3/4 filesystems, it consists of two kinds of information - filename and inode. The latter is a special data structure to store information about the file - file type, size, ownership, access information(read,write,execute bits), location of the file content etc. Such type of information is also known as metadata.

Sudo Logging Feature - helps in multi-admin Linux environments

I have been using sudo for more than two years and recently when I started working on RedHat based systems, I realized that I actually prefer a root shell(don't confuse with gui login) while performing administrative tasks. I am more careful - thinking twice before running a command, here than with sudo. But there is something about sudo that makes it a fantastic tool for multi-admin environments. I am talking about its logging capability.

Script - A command line tool to record/save your terminal activity

You may know about a lot of cool softwares but they become cooler when you find a use for them. Recently, someone told me about this brilliant command line tool - "script". It saves a session of your terminal. No! Its not like history. In spite of saving each command per line in a text file, script makes a typescript of everything that happens on the terminal. Screencasting tools to a desktop session(GUI) is what script is to a terminal.

How To - Set the default content of a new user's home directory using /etc/skel

When you create a user account on a Linux system and ask it to create a home directory, some files are automatically added to it e.g. - .bashrc, .bash_history etc. How does that happen or how can I add/remove files to a user's home during the creation of his account? This is all taken care of by the /etc/skel directory.

Syndicate content