This is an interesting command. Have you ever wanted to be sure that just one instance of your app/script is running at the same time? Then, flock is your tool. The sintax is as follows: flock [options] file|directory command [arguments] Lets see an example: flock /home/user/lockfile htop This runs htop and uses a generated file […]
Categoría: gnu
Gnu – Timeout
This is one of those extremely useful commands that not many people know. Basically runs a shell command and exits when the time runs out. The format is as follows: timeout [OPTION] DURATION COMMAND [ARG]… Lets see an example: timeout 10s top : This starts the top utility waits for 10 seconds and quit. Simple. […]
Gnu – w
Have you ever wonder who is in your system? and doing what? Well, beauty always comes in small packages and today it is not an exception, the only thing you need is: w .This small tool comes to the rescue. The format is as follows: w [options] user […] Lets see some examples: w -> […]
Gnu – ls
This command allows you to list files and directories (dir in Ms-dos world). Lets see how this works. The format is as follows: ls [OPTION]… [FILE]… You can type ls as is to show a barebones listing of files and directories. Lets see more possibilities: ls -l -> this shows the long listing format (its […]