Found 1437 Articles for Linux

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

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

1K+ 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

18K+ 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

11K+ 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

36K+ 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

3K+ 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

How to create a new directory in Linux using the terminal?

Shilpa S
Updated on 30-Jun-2021 15:04:43

3K+ Views

The mkdir command is used to create a new directory in the Linux/Unix operating system. It is also used to create more than one directory at a time and set the permission for the directories just like the chmod command in the Linux system.SyntaxThe general syntax of the mkdir command is as follows −$ mkdir [OPTION]... [DIRECTORIES]...Brief description of options available in the mkdir command.Sr.No.Option & Description1-m, --mode=MODESet the mode of file as the time of directory creation just like the chmod command2-p, --parentsNo message prompt if existing and make parent directories as needed3-v, --verbosePrint what is being done4-ZBy default, ... Read More

How to copy a file, group of files, or directory in Linux?

Shilpa S
Updated on 30-Jun-2021 15:02:46

2K+ Views

In this article, we will learn to copy a file or directory in the Linux/Unix operating system using terminal, we use the cp command to copy a file or directory in the Linux system.cp (copy) - The cp command is used to copy files or directories in the Linux system. If we want to copy a file from a source directory and paste it into another destination directory then we have to use the cp command. By default, the cp command will not copy directories to copy directories we have to use -R option with cp command otherwise error will be ... Read More

How to converts tabs to spaces in the Linux system?

Shilpa S
Updated on 30-Jun-2021 15:01:57

3K+ Views

While working with files, sometimes a situation occurs that a file contains many tabs and the requirement is a file in which no tabs but with space. In this case, if a file is quite simple then work is easy but if we are dealing with a long file then it’s very tough work.To convert tabs to spaces, we use the expand command in the Linux system. If file is not given then the expand command read standard input.SyntaxThe general syntax of the expand command as follows −expand [OPTION]... [FILE]...Brief description of options available in the expand command.Sr.No.Option & Description1-i, ... Read More

Advertisements