Linux Articles

Page 48 of 134

How to create key binds in the Linux system using the terminal?

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

To set Readline key bindings and variables in the Linux system, we use the bind command. The bind command is used to assign functions and macros to keys, allowing you to create hotkeys instead of typing entire commands. It is a shell built-in command available in bash. Syntax The syntax of the bind command is as follows − bind [-lpsvPSVX] [-m KEYMAP] [-f FILENAME] [-q NAME] [-u NAME] [-r KEYSEQ] [-x KEYSEQ:shell-command] While the general syntax appears complex, the bind command is simple to use and allows you to easily create custom key bindings ...

Read More

How to list all users who are currently logged into the Linux system?

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

The who command is a fundamental Linux utility used to display information about users who are currently logged into the system. It shows details such as login names, terminal lines, login times, and remote hostnames. The who command is closely related to the w command, which displays additional information about user processes. Syntax The general syntax of the who command is − who [OPTION]... [ FILE | ARGUMENT1 ARGUMENT2 ] Common Options Option Description -a, --all Same as -b -d --login -p -r -t -T -u ...

Read More

How to display the first part of the file in the Linux system?

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

The head command in Linux is used to display the first part of a file or piped data. By default, it shows the first 10 lines of the specified file, making it useful for quickly previewing file contents without opening the entire file. Syntax The general syntax of the head command is − head [OPTION]... [FILE]... Common Options Option Description -n NUM Display the first NUM lines instead of the default 10 -c NUM Display the first NUM bytes of each file ...

Read More

How to display the last part of the file in the Linux system?

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

To display the last part of a file, we use the tail command in the Linux system. The tail command is used to display the end of a text file or piped data in the Linux operating system. By default, it displays the last 10 lines of its input to the standard output. It is the complement of the head command. Syntax The general syntax of the tail command is as follows − tail [OPTION]... [FILE]... Options Brief description of options available in the tail command: Option Description ...

Read More

How to flushes file system buffers in the Linux operating system?

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

To synchronize cached writes to persistent storage, we use the sync command in the Linux operating system. This command ensures that data stored in memory buffers is written to disk, preventing data loss during unexpected shutdowns or system crashes. The sync command synchronizes file data between volatile memory (RAM) and persistent storage devices like hard drives or SSDs. When applications write data, it is initially stored in kernel buffers for performance reasons. The sync command forces these buffers to be written to disk immediately. How File System Buffers Work Linux uses a write-back caching strategy where data ...

Read More

How to format contents of a text file in the Linux system?

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

Sometimes text files are not well formatted for presentation. While manual formatting works for small files, it becomes impractical for large files. In Linux, we use the fmt command to format the contents of text files efficiently. The fmt command is used to format, simplify, and optimize text files in the Linux system. If no file is specified, fmt reads input from standard input. By default, it creates text lines that are 75 characters wide. Syntax The general syntax of the fmt command is as follows − fmt [-WIDTH] [OPTION]... [FILE]... Options ...

Read More

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
Showing 471–480 of 1,337 articles
« Prev 1 46 47 48 49 50 134 Next »
Advertisements