Read IT Engineer's Blog in your own language
English flagKorean flagChinese (Simplified) flagPortuguese flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flagAlbanian flagEstonian flagGalician flagMaltese flagThai flagTurkish flagHungarian flag  
By N2H
Feb
22nd

Introduction to Linux processes [Part 2]

Files under Linux | 1 Comment | 110 views

Last month was mention about the Linux Processes on PIDs , parent and child processes and using the ps command. In this part 2, let see how the background and foreground background process work.

Background and foreground processes
An interactive process can run in the foreground or background. To place a process in the background, you use the command bg or the ampersand symbol (&). This lets you do other jobs while waiting for the command to finish. Let’s say you use the syntax

$ find / filename 2 > /dev/null | grep filename | tee result

A command using this syntax could take a long time to execute, especially if you have a lot of files and are listing several network drives. Only one job at a time can run in the foreground, so no further commands can be issued until the prompt returns. To continue working on the command line while it processes, you can execute the same command in the background, using the ampersand. For example, you could enter the command using the following syntax:

$ find / filename 2 > /dev/null | grep filename | >result &

After the command has been issued, the shell displays a message, which looks similar to the following: (more…)

Jan
31st

Introduction to Linux processes [Part 1]

Files under Linux | 3 Comments | 301 views

After read some linux article, and having some basic knowledge, now can have basic understanding on linux processes, a process is a single program that is executed within its own virtual address space. For example, a shell is a process that is created each time a user logs in to the system. It creates a new process every time it implements a program such as a system command. A system command is an example of a collection of related commands called a job. Jobs create a series of separate processes from a single command line. So, in fact, every program running under Linux is a process.

The following table shows the three main categories of processes.

linux processes

Linux can share its processing power, storage capabilities, and input and output mechanisms with several users, or with several processes created by one user. Processes such as user jobs, operating system tasks, mail, and background jobs like printing need to be monitored simultaneously by Linux. (more…)

Sep
8th

Text-processing utilities in Linux

Files under Linux, Operating System | 2 Comments | 481 views

Text processing is different than word processing. In word processing, text is edited and manipulated in a “What-You-See-Is-What-You-Get” (WYSIWYG) environment. This enables you to produce printed copies of the text, complete with features such as graphics and tables.

Linux stores files in plain-text format. This allows you to use different processing, or filtering, utilities on the text. These utilities let you format, analyze, and manipulate text in many different ways. For example, you can format pages and paragraphs, check spelling, add page numbers and headers, and count the lines, words, and characters that a file contains.

Text-processing utilities

text processing utilities
text processing utilities

The general command syntax used for text-processing commands is

command [option ] filename(s)

Reading files
To work with files, you need to know what information they contain. One way of doing this is to use the cat command to display the contents of a file on your terminal screen. This command provides a number of options.

Options for the cat command

text-processing utilities

Viewer commands
A quicker way of viewing the contents of a file is by using viewer commands, which display the information at the start or end of a file. Examples of viewer commands include head and tail.

By default, the head command displays the first 10 lines of a file, and the tail command displays the last 10 lines of a file. Additional options can be used with these commands to view more specific areas of a file. For example, you can use the -n option with the commands to specify the number of lines they must display.

Pager commands
If a particular file is longer than one screen, it may scroll past too quickly for you to read it. You can scroll through documents at your own pace by using pager commands, which display documents one screen at a time. Examples of pager commands include less and more.

The more command is the original pager command and derives from the Berkeley version of UNIX. It enables you to move through a document in a forward direction only.

The less command was developed to replace the more command and provides a wider range of options for viewing files.

Pager command options

pager command option

Jul
30th

Understanding disk quotas in Linux

Files under Linux, Operating System | 1 Comment | 669 views

After talk about special character on linux command last week, now let understand on disk quota here. In Linux, a system of disk quotas enables the system administrator to restrict disk usage by individuals and groups.

linux

Quotas can specify

  • the maximum amount of total disk space allotted to a user or group
  • The maximum number of files a user or group can create

You assign quotas by partition, so an individual or group who creates files on two partitions may have a different quota for each partition, or a quota for only one of the two partitions.

User and group quotas
User quotas and group quotas are independent of each other – so the value of the group quota is not the sum of the values of the users’ quotas in a group. When a user attempts to create a file, Linux first checks if there is a group quota for the user’s group. If a group quota for the group to which the user belongs has already been filled, the user can’t create the file, regardless of the status of the user’s quota. To create the file, the user must change groups. Every file that an individual user creates counts towards the quota of the user’s group. If the user isn’t part of a quota-restricted group, or if group quotas aren’t switched on for a partition, the user can create files on the partition as long as the user’s quota isn’t filled. (more…)

Jul
16th

Special characters on the Linux command line

Files under Linux, Operating System | 4 Comments | 1,207 views

Specially defined characters are essential for many of the Linux shell’s powerful features, such as filename completion and command substitution. The shell interprets these characters in a different way from other, regular characters on the command line. However, if you want to disable these characters, you can use a process called quoting.

Filename completion characters

Filename completion characters are metacharacters that enable you to abbreviate filenames or directory names. This saves time and lets you process files selectively, even if you don’t know their full names or locations.

Commonly used filename completion characters are included in the table below.

Filename completion characters
special characters on linux command line

The * character (asterisk) is the most frequently used file completion character. You can use the string b*, for example, to match all the filenames beginning with the letter “b”. You can also use multiple asterisks to define a file. For example, *xx*.gif retrieves any filename that contains “xx” anywhere in its name and that has the .gif extension. (more…)

<