Linux flock Command

In this tutorial we learn how to use flock commmand in Linux. flock command is flock - manage locks from shell scripts

What is Linux flock Command?

In this tutorial we learn how to use flock command in Linux. flock command is flock - manage locks from shell scripts

flock Syntax

       flock [options] file|directory command [arguments]
       flock [options] file|directory -c command
       flock [options] number

flock Examples

flock Command Manual / Help

We can use man and info command to see the manual page of flock command.

flock command also have --help option to show list of options.

To open man page for flock command we can use command below. To exit man or info page you can press q.

man flock

To open info page for flock command we can use command below.

info flock

To open help page from flock command we can run command below.

flock --help

Linux flock Command Source Code

You can find flock command source code from the folowing repositories:

You can read tutorials of related Linux commands below:

Summary

In this tutorial we learn how to use flock in Linux with practical examples. Visit our Linux Commands guide to learn more about using command line interface in Linux.