Operating System Articles

Page 81 of 171

How to join lines of two files on a common field in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 1K+ Views

To join lines of two files on a common field, we use the join command in the Linux system. The join command is used to merge lines from two sorted files based on a common field. Instead of physically combining files, the join command creates output by matching corresponding fields from both files. By default, the join field is the first field, delimited by whitespace. Syntax The general syntax of the join command is as follows − join [OPTION]... FILE1 FILE2 Note − If FILE1 or FILE2 is not specified, the join command reads ...

Read More

How to list the directory content in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 19K+ Views

In the Linux operating system, there are two primary commands available to list directory contents: ls (list) and dir (directory). Both commands serve similar purposes but differ in their output formatting and default behavior. The ls Command ls (list) is the most commonly used command to list directory contents in Linux systems. By default, it displays the contents of the current directory with colored output for better readability. The ls command is also available in EFI (Extensible Firmware Interface) shell environments. Syntax $ ls [OPTION]... [FILE]... Common ls Options ...

Read More

How to move a file, group of files, and directories in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 18K+ Views

The mv (move) command is used to move one or more files or directories from one location to another in Linux/Unix systems. Unlike copying, the mv command transfers files by removing them from the source and placing them at the destination. The mv command also serves as a rename tool when moving files within the same directory. Syntax The general syntax of the mv command follows these patterns − mv [OPTION]... [-T] SOURCE DESTINATION mv [OPTION]... SOURCE... DIRECTORY mv [OPTION]... -t DIRECTORY SOURCE... Command Options Option Description ...

Read More

How to move jobs to the background in the Linux system?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 3K+ Views

To move foreground jobs to the background in a Linux system, we use the bg command. This is particularly useful when you have a running process that you want to continue executing without blocking your terminal. bg (background) − The bg command resumes execution of a suspended process in the background. When a job is moved to the background, it continues running but no longer occupies the foreground of your terminal session. If no job is specified, the bg command works on the most recently suspended job. Syntax The general syntax of the bg command is as ...

Read More

How to overwrite a file to hide file contents, and make original contents unrecoverable in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 4K+ Views

To overwrite file contents and make them unrecoverable in the Linux system, we use the shred command through the terminal. Unlike the standard rm command which only removes file entries from the filesystem, shred performs secure deletion by overwriting the actual data multiple times. shred − The shred command is used to securely delete files and devices. This command overwrites a file to hide its contents and optionally deletes the file, making it extremely difficult to recover using any software recovery tools in Linux/Unix systems. When we remove files using the rm command, the file data remains on ...

Read More

How to remove sections from each line of files in the Linux system?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 2K+ Views

In this article, we will learn to remove sections from each line of files in the Linux/Unix operating system using the cut command. The cut command is used to extract and print selected portions of each line from files. It allows you to cut specific sections of a line by byte position, character position, or field delimiters. This makes it particularly useful for processing structured text data, CSV files, and extracting specific columns from formatted output. Syntax The general syntax of the cut command is as follows − cut OPTION... [FILE]... Options ...

Read More

How to removes duplicate lines from a sorted file in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 7K+ Views

To remove duplicate lines from a sorted file and make it unique, we use the uniq command in the Linux system. The uniq command works as a filter program that reports and removes duplicate lines in a file. It filters adjacent matching lines from the input and gives a unique output. This command is also available in Windows and IBM i operating systems. Syntax The general syntax of the uniq command is as follows − uniq [OPTION]... [INPUT [OUTPUT]] Options Brief description of options available in the uniq command − ...

Read More

How to shrink or extend the size of a file in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 17K+ Views

The truncate command is used to shrink or extend the size of a file to a specified size in Linux. Unlike deletion commands, truncate cannot remove files but can modify their contents and size. When reducing file size, if the specified size is smaller than the actual size, the extra data will be permanently lost. Syntax The general syntax of the truncate command is as follows: truncate OPTION... FILE... Options Brief description of options available in the truncate command: Option Description -c, --no-create Do not ...

Read More

How to sort lines of text files in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 15K+ Views

The sort command in Linux is used to arrange lines of text files in a specified order. By default, it sorts lines alphabetically in ascending order, but it offers numerous options to customize the sorting behavior based on different criteria such as numeric values, months, or reverse order. Syntax The general syntax of the sort command is as follows: sort [OPTION]... [FILE]... sort [OPTION]... --files0-from=F Common Sort Options Option Description -b, --ignore-leading-blanks Ignore leading blanks when sorting -d, --dictionary-order Consider only blanks and alphanumeric ...

Read More

How to split or break large files into pieces in Linux?

Shilpa S
Shilpa S
Updated on 17-Mar-2026 12K+ Views

The split command is used to divide large files into smaller, more manageable pieces in Linux systems. By default, it creates output files with 1000 lines each and uses 'x' as the filename prefix. For example, if no output filename is specified, the split files will be named xaa, xab, etc. When a hyphen (-) is used instead of an input file, the command reads data from standard input. Syntax The general syntax of the split command is as follows: split [OPTION]... [FILE [PREFIX]] Command Options Option Description ...

Read More
Showing 801–810 of 1,707 articles
« Prev 1 79 80 81 82 83 171 Next »
Advertisements