Found 2003 Articles for Operating System

How to list the directory content in Linux?

Shilpa S
Updated on 01-Jul-2021 14:36:48

19K+ Views

In the Linux operating system, there are two commands available to list the directory contents.ls (list) commanddir (directory) commandListing the contents of the file using ls command.ls (list) – the ls command is used to list the directory contents in the Linux system. By default, the ls command displays the content of the current directory. The ls command is also available in EFI (Extensible Firmware Interface) shell.SyntaxThe general syntax of the ls command is as follow −$ ls [OPTION]... [FILE]...Brief description of option available in the ls command.Sr.No.Option & Description1-a, --allDisplay all files including hidden files2--authorDisplay author of each file ... Read More

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

Shilpa S
Updated on 01-Jul-2021 14:33:38

1K+ Views

To join lines of two files on a command field, we use the join command in the Linux system. The join command is used to join lines of two files on a common field in the Linux system. If we have two files and we want to join lines of files then no need to combine both files. We can join lines without combining files using the join command. By default, the join field is the first, delimited by blanks.SyntaxThe general syntax of the join command is as follows −join [OPTION]... FILE1 FILE2Note – If FILE1 or FILE2 or both ... Read More

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

Shilpa S
Updated on 01-Jul-2021 14:31:13

3K+ Views

Sometimes our text files are not well format to represent. This work can be done manually for small file, but if the file is too large then manually formatting is so tough work. In such a case to format the contents of a text file in the Linux operating system, we use the fmt command.The fmt command is used to format, simplifying, and optimizing text files in the Linux system. If the file is not specified then the fmt command reads input from standard input. By default, the fmt command creates text to a width of 75 characters wide.SyntaxThe general ... Read More

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

Shilpa S
Updated on 01-Jul-2021 14:29:19

2K+ Views

To synchronize cached writes to persistent storage, we use the sync command in the Linux operating system.The sync command is used to synchronize corresponding file data in volatile memory and persistent storage.SyntaxThe general syntax of the sync command is as follows −sync [OPTION] [FILE]...A brief description of options available in the sync commandSr.No.Option & Description1-d, --dataSynchronize only file data, no unneeded metadata.2-f, --file-systemSynchronize the file systems that contain files.3--helpDisplays a help message and then exits.4--versionIt gives info about the version and then exits.Note - If one or more files are specified, synchronize only them, or their containing file systems.To synchronize ... Read More

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

Shilpa S
Updated on 01-Jul-2021 14:27:09

21K+ Views

To display the last part of the 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 also complementary of the head command.SyntaxThe general syntax of the tail command is as follow −tail [OPTION]... [FILE]...Brief description of options available in the tail command.Sr.No.Option & Description1-c, --byte = [-]NUMDisplay the last NUM bytes of each file. Or -c +NUM to display starting with byte ... Read More

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

Shilpa S
Updated on 01-Jul-2021 14:23:54

12K+ Views

To display the first part of the file, we use the head command in the Linux system.The head command is used to display the beginning of a text file or piped data. By default, it displays the first ten lines of the specified files. The tail command is also used to display the ending part of the file.SyntaxThe general syntax of the head command is as follow −head [OPTION]... [FILE]...Brief description of options available in the head command.Sr.No.Option & Description1-c, --byte = [-]NUMDisplay the first NUM bytes of each file. With the leading ‘-‘, print all but the last NUM ... Read More

How to display the current working directory in the Linux system?

Shilpa S
Updated on 06-Sep-2023 13:20:03

38K+ Views

To print the current working directory, we use the pwd command in the Linux system.pwd (print working directory) – The pwd command is used to display the name of the current working directory in the Linux system using the terminal. This is a shell building command that is available in most Unix shells such as Bourne shell, ash, bash, kash, and zsh.SyntaxThe general syntax of the pwd command is as follows −pwd [-LP]A brief description of options available in the pwd command.Sr.No.Option & Description1-L (logical) Display the value of $pwd if it names the current working directory2-P (physical) Display the physical directory, ... Read More

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

Shilpa S
Updated on 01-Jul-2021 14:18:31

4K+ Views

To check information about users who are currently logged into the system, we use the who command in the Linux system.The who command is used to display the users logged into the system. The who command related to the w command that is used to display information about the users currently on the machine and their processes.SyntaxThe general syntax of the who command is as follows −who [OPTION]... [ FILE | ARGUMENT1 ARGUMENT2 ]Brief description of options available in the who command.Sr.No.Option & Description1-a, --allSame as -b -d --login -p -r -t -T -u2-b, --bootDisplay last rebooted time of system3-d, ... Read More

How to create links between files in the Linux?

Shilpa S
Updated on 01-Jul-2021 14:16:18

3K+ Views

Before creating links, we need to understand what is link and how many types of link in the Linux system.LinkLinks are shortcuts to access a file. It is a connection between file name and actual data in the system. We can say that a link is a pointer to a file.Types of linksThere are two types of links in the Linux system.Hard LinksSoft Links or Symbolic linksHard Links -The hard link points to the index node of a file, the data of which is stored on the system and the size of link is equal to actual file size.Soft Links ... Read More

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

Shilpa S
Updated on 01-Jul-2021 14:11:39

2K+ Views

To set Readline key bindings and variables in the Linux system, we use the bind command.The bind is used to assign functions and macros to a key. It allows to create hotkeys instead of typing the entire command. The bind command available in the shell built-in command.SyntaxThe syntax of the bind command is as follows.bind [-lpsvPSVX] [-m KEYMAP] [-f FILENAME] [-q NAME] [-u NAME] [-r KEYSEQ] [-x KEYSEQ:shell-command]The general syntax of the bind command seems so complicated, but the bind command is simple to use and we can easily create macros.Brief description of options available in the bind command.Sr.No.Option & ... Read More

Advertisements