When we work with the nice command, it’s clear that it can’t change the scheduling priority of running processes. As we’ve just seen, we would need to stop and then start the process in this case. This is where the renice command shines. We can leverage the renice command to change the niceness while the […]
Archives for March 2022
restorecon Command Examples in Linux
Using restorecon is easy. Just type restorecon, followed by the name of the file that you need to change. Once again, I’ve changed the context of the index.html file back to the home directory type. This time, though, I’m using restorecon to set the correct type: $ ls -Z -rw-rw-r–. web web unconfined_u:object_r:user_home_t:s0 index.html $ […]
runlevel Command Examples in Linux
The output of the runlevel command will indicate your previous and current runlevel separated by a single space. If there was no previous runlevel ‘N’ will be used as a placeholder. For example: # runlevel N 5 The output above indicates that the current runlevel is 5 and there was no previous runlevel. Below is […]
sa Command Examples in Linux
Process accounting allows you to keep detailed logs of every command a user runs, including CPU time and memory used. From a security standpoint, this means the system administrator can gather information about what user ran which command and at what time. This is not only very useful in assessing a break-in or local root […]
scsi_id Command Examples in Linux
scsi_id is the command used for finding out the WWN numbers for the external LUNS attached to the host via a FC cable and can’t be used for finding out UUID of devices. scsi_id is primarily for use by other utilities such as udev that require a unique SCSI identifier. By default all devices are […]
sftp Command Examples in Linux
SFTP is a file transfer system that runs on top of an SSH connection and emulates an FTP interface. It requires an SSH server on the remote system instead of an FTP server. It provides an interactive session with an sftp prompt. Sftp supports the same commands as ftp and lftp. To start an sftp […]
ufw Command Options
The Uncomplicated Firewall (UFW) is a firewall management tool that makes it easier to configure the iptables service. UFW originated with Ubuntu® but can be downloaded and installed on other distributions. It is primarily useful for home users who don’t have experience with the intricacies of firewall configuration. The ufw command enables you to work […]
Introduction to Array in C Programming
An array is a collection of similar data elements. These data elements have the same data type. The elements of the array are stored in consecutive memory locations and are referenced by an index (also known as the subscript). If one subscript, then we call a one-dimensional array. Memory representation in an array The array […]
C Programming Basics – Interview Questions
1. What is Token? A token is a building block of a program. A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. 2. What is Keyword? Keywords are special reserved words associated with some meaning. 3. What is keyword auto […]
Basics of C programming
Structure of C Program A C program is divided into different sections. There are six main sections to a basic c program. The six sections are: Documentation Link Definition Global Declarations Main functions Sub programs The whole code follows this outline. Each code has a similar outline. Now let us learn about each of these […]