The ancient serial port which is no longer found on the latest motherboards and even the not so latest laptops is still used for connecting to the console of networking devices, headless computers and a lot other applications. On computers which do not have built-in serial ports USB-to-Serial adapters can be used. Linux identifies inbuilt serial ports as /dev/ttyS0, /dev/ttyS1,….. /dev/ttySn and USB-to-Serial adapters as /dev/ttyUSB0, …. /dev/ttyUSBn and they can be accessed using terminal emulator applications like PuTTY, minicom and screen.Continue Reading…
How to manage jobs in Linux – fg bg kill Ctrl+Z
How many times did you start something which is time consuming and waited for it to end until you could use the console again. We have all faced a situtation when we just stare at the screen for a process to get over after we have initiated it. It could be something as simple as copying a large file from a removable media or installing packages using yum/apt-get from online repositories over a slow internet connection (ouch!). Once started you will not get back the command shell until the process is done, so what do you do ? Hit Ctrl+C terminate it and hope to do it over the weekend ? Take a coffee break ? Count the number of keys on the keyboard ? Why not press Ctrl+Z and get the work done in background while you use the console to do something else. In this article I will cover how to suspend a process a.k.a. job, run it in the background, bring it to the foreground, terminate it if necessary.Continue Reading…
Linux ACL Tutorial
Access Control Lists( (ACLs) are a way to assign fine tuned permissions in Linux apart from using the chmod command. When the chmod command is used only one owner and one group can be assigned permissions on a file or directory. If multiple users need access to a resource we need to place them in a group and then give that group the necessary permissions. But with File ACLs in Linux we can assign fine grained permissions to each user and group on a file and even deny access to a particular user even if the file has world permissions. This tutorial on Linux File ACL will explain the usage of the commands getfacl and setfacl.Continue Reading…
How to make undeletable files and directories in Linux
A very useful Linux tip on how to make files and directories undeletable even by the root user. You can apply this tip on all important configuration files so that no one accidentally or intentionally deletes it. To achieve this the chattr (Change Attribute) command is used it Linux. The chattr command “immunizes” the file not only from deletion but also modification. The chattr command does care about chmod values, even if a file has 777 permissions immunizing the file will prevent it from being deleted or modified.Continue Reading…
Mount an ISO file in Linux
This tutorial shows how to mount an ISO file in Linux. In Windows third party tools are required to mount ISO images, but in Linux a simple command is enough to mount ISO images. Before editing the /etc/fstab file please take a backup by following the given instructions. To mount an ISO image use the following command
mount -o loop /location/of/file.iso /mnt/file
Replace /location/of/file.iso with the actual location. The “file” directory inside /mnt must exist. This will mount the iso file for that session. If you want to permanently mount the ISO file modify the /etc/fstab file. Before doing this please backup the fstab file.
cp /etc/fstab{,.bak}
Now edit the /etc/fstab file and add the following line
/location/of/file.iso /mnt/file iso9660 loop 0 0
Save the file and execute the following command to remount all enteries in /etc/fstab
mount -a
This way you can mount as many ISO images you want.
How to create a swap file in Linux
A swap file can be created while installing Linux operating system, if you forgot to do so you can read this tutorial and create one after installation. Even if you need additional swap memory this tutorial will be useful. I’ve only explained the command line way of creating a swap file which most administrators will use, its upto you to explore the GUI technique. For executing the commands in this tutorial you need to have root access or atleast sudo permissions for these commands and permissions to edit the fstab file.Continue Reading…