Category: Docker

Fuser Command in Linux - Explained with examples

This article covers how to find processes by using the fuser command in Linux. In fact, the fuser command is primarily used to identify processes using files, directories, or sockets.

fuser command Options includes:

  • -a, --all: Show all files specified on the command line. By default, only files that are accessed by at least one process are shown.
  • -c: Same as -m option, used for POSIX compatibility.
  • -f: Silently ignored, used for POSIX compatibility.
  • -k, --kill: Kill processes accessing the file. Unless changed with -SIGNAL, SIGKILL is sent. An fuser process never kills itself, but may kill other fuser processes. The effective user ID of the process executing fuser is set to its real user ID before attempting to kill.
  • -i, --interactive: Ask the user for confirmation before killing a process. This option is silently ignored if -k is not also present.
  • -l, --list-signals: List all known signal names.
  • -m NAME,
  • --mount NAME NAME: specifies a file on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed. If a directory file is specified, it is automatically changed to NAME/. to use any file system that might be mounted on that directory.
  • -M, --ismountpoint: Request is fulfilled only if NAME specifies a mountpoint. This is an invaluable seatbelt which prevents you from killing the machine if NAME happens to not be a filesystem.
  • -w: Kill only processes which have write access. This option is silently ignored if -k is not also present.
  • -n: SPACE,
  • --namespace SPACE: Select a different name space. The name spaces file (file names, the default), udp (local UDP ports), and tcp (local TCP ports) are supported. For ports, either the port number or the symbolic name can be specified. If there is no ambiguity, the shortcut notation name/space (e.g., 80/tcp) can be used.
  • -s, --silent: Silent operation. -u and -v are ignored in this mode. -a must not be used with -s.
  • -SIGNAL: Use the specified signal instead of SIGKILL when killing processes. Signals can be specified either by name (e.g., -HUP) or by number (e.g., -1). This option is silently ignored if the -k option is not also present.
  • -u, --user: Append the username of the process owner to each PID.
  • -v, --verbose: Verbose mode. Processes are shown in a ps-like style. The fields PID, USER, and COMMAND are similar to ps. ACCESS shows how the process accesses the file. Verbose mode also shows when a particular file is being access as a mount point, knfs export or swap file. In this case, kernel is shown instead of the PID.
  • -V, --version: Display version information.
  • -4, --ipv4: Search only for IPv4 sockets. This option must not be used with the -6 option and only has an effect with the tcp and udp namespaces.
  • -6, --ipv6: Search only for IPv6 sockets. This option must not be used with the -4 option and only has an effect with the tcp and udp namespaces.
  • - : Reset all options and set the signal back to SIGKILL.

Mail Command in Linux - Explained with examples

This article covers the Complete guide for setting up a mail server using Postfix, Dovecot & SquirrelMail. 

Linux mail command Options:

  • -a, --append=HEADER: VALUE: Append given header to the message being sent.
  • -e, --exist: Return true if mail exists.
  • -E, --exec=COMMAND: Execute COMMAND.
  • -f, --file[=URL]: Operate on given mailbox URL. The default mailbox is ~/mbox.
  • -F, --byname: Save messages according to sender.
  • -H, --headers: Write a header summary and exit.
  • -i, --ignore: Ignore interrupts.
  • -n, --norc: Do not read the system mailrc file.
  • -N, --nosum: Do not display initial header summary.
  • -p, --print: Print all mail to standard output.
  • -q, --quit: Cause interrupts to terminate program.
  • -r, --read: Same as -p
  • -s, --subject=SUBJ: Send a message with a subject of SUBJ.
  • -t, --to: Precede message by a list of addresses.
  • -u, --user=USER: Operate on USER's mailbox.
  • --license: Print license and exit.
  • --external-locker=PATH: Set full path of the external locker program
  • --lock-expire-timeout=SECONDS: Number of seconds after which the lock expires.
  • --lock-flags=FLAGS: Default locker flags (E=external, R=retry, T=time, P=pid)
  • --lock-retry-count=NUMBER: Set the maximum number of times to retry acquiring the lockfile.
  • --lock-retry-timeout=SECONDS: Set timeout for acquiring the lockfile.
  • -m, --mail-spool=URL: Use specified URL as a mailspool directory.
  • --mailbox-type=PROTO: Default mailbox type to use.
  • --tls[=BOOL]: Enable TLS support.
  • -?, --help: Display a help message and exit.
  • --usage: Display a short usage message and exit.
  • -V, --version: Display program version and exit.

Mv Command in Linux - Explained with Examples

This article covers how to use the mv command in Linux.

mv command Options

  • --backup[=vcm]: Make a backup of each existing destination file, using the version control method vcm. If vcm is omitted, --backup behaves the same as -b (backups are created, using the default version control method). See backing up files for details.
  • -b: Like --backup, but does not accept a backup method. Instead, the method specified by the VERSION_CONTROL environment variable is used. Simple backups are created if the variable is not set. See version control methods for details.
  • -f, --force: Always overwrite existing files without prompting. This can be useful if you need to overwrite multiple files whose permissions are read-only; if you don't specify -f, you are prompted for every file.
  • -i, --interactive: Prompt before overwriting an existing file, regardless of the file's permissions.
  • -n, --no-clobber: Never overwrite any existing file.
  • --strip-trailing-slashes: Remove any trailing slashes from each source argument.
  • -S, --suffix=suffix: Specify the file name suffix to be used for all backup files. The default is "~".
  • -t,
  • --target-directory=destination: Move all sources into the directory destination.
  • -T, --no-target-directory: Treat destination as a normal file, not as a directory.
  • -u, --update: Don't overwrite files if they're newer. A move only happens if the destination file is older than the source file, or the destination file does not already exist.
  • -v, --verbose: Provide verbose output. Print the name of every file moved.
  • --help: Display a help message, and exit.
  • --version: Display version information, and exit.

Update Google Chrome - Step by step guide ?

This article covers how to check for recent chrome updates and how to install them. In fact, Chrome updates happen in the background automatically — keeping you running smoothly and securely with the latest features.

lsblk Command in Linux - Explained with examples

This article covers how to use the lsblk command in Linux. In fact, lsblk prints all block devices (except RAM disks) in a  tree-like format  by  default.   Use  lsblk --help to get a list of all available columns.

The lsblk command in Linux lists block devices. 

Following is Lsblk's syntax:

$ lsblk [options] [device...]

Lsblk can be used to retrieve a vast range of information about all the block devices attached to the system.

How to make lsblk display info about device owner, group, and mode ?

This can be achieved using the -m command line option:

$ lsblk -m

Methods to List All Available Commands and Aliases in Linux

This article covers how to list all the available commands and aliases that we can run on Linux. In fact, The compgen is bash built-in command and it will show all available commands, aliases, and functions for you. This command works under Linux, macOS, *BSD and Unix-like system when Bash shell is installed.