Categories
Linux

Detach script/command in Linux – Easy Way !

Hot to start and detach bash script (or command) in linux from the command line: setsid nohup monitor.sh & detach script/command with custom log: setsid nohup monitor.sh &>/tmp/monitor.log & And to check the result, use a linux command that shows the process hierarchy: root@byrev:/usr/local/bin# ps -efj –forest

Categories
Linux

Kill Process in Linux by PID, Name or Group

Kill a Process in Linux from command line using kill command: kill process by name: kill $(ps aux | grep ‘process_name’ | awk ‘{print $2}’) kill process by ID kill -9 PID Kill all descendant/recursively processes The easy way to do this in a shell script is using pkill command: pkill -TERM -P 123456 where […]

Categories
Linux Networks Useful

Find Available Network Interfaces On Linux/Ubuntu – 6 Quick Solutions

If you need a solution for quickly finding information about the network interfaces attached to the server or computer, then choose one of the solutions below, any of which is useful for certain technical situations. 1) using lshw , a small tool to extract detailed information on the hardware configuration of the machine: root@byrev:/# sudo […]

Categories
Linux

Reload fstab (/etc/fstab) – dynamic loading without restart – Linux

When we make a change in the /etc/fstab file in order to be active (ie taken into account) we need to notify the operating system to refresh the commands in fstab or to restart the system, which is not mandatory! So, to reload the commands from fstab, in linux we have the mount command, which […]

Categories
Linux Servers

How to Change Partition Label Names on Linux: EXT4 / EXT3 / EXT2

The most popular options are to use commands e2label or tune2fs used for changing label of ext4, ext3 or ext2 type partitions: # e2label /dev/sdf1 EXTLABEL and/or # tune2fs –L EXTLABEL /dev/sdf1 For other file filesystem, some less used in the linux environment: NTFS ntfslabel /dev/sdf1 NTFSLABEL SWAP mkswap -L SWAPLABEL /dev/sdf1 exFAT exfatlabel /dev/sdf1 […]

Categories
Linux Servers Useful

Reload new entry in fstab – fast and easy way – Linux

A fast and easy way to reload new entries in /etc/fstab is to use the linux mount command: @ sudo mount -a or with verbose mode: @ sudo mount -av / : ignored /boot : already mounted /boot/efi : already mounted //srv/TOSHIBA-3T-V300 : already mounted //srv/WD-2T-USB : already mounted //srv/TOSHIBA-3T-ENTERPRISE: already mounted //srv/SAMSUNG-850-PRO : already […]

Categories
Linux Useful

View the file size of a directory in LINUX – Folders and Subfolders

If we want to see what is the size occupied by folders or subfolders in linux, we can use the du command, that is a command line utility for reporting file system disk space usage. It can be used to find out disk usage for files or folders and to show what is taking up […]

Categories
Linux Servers Useful

How long a process has been running on linux server ? by PID or Name

If you want to see how long a process has been running on linux, all you have to do is find on its PID and use the following command: @ ps -o etime= -p “530” 9-18:53:38 but if you want the result in seconds, not in D-H:M:S / timestamp format, use the command like this: […]

Categories
Linux PHP Servers Useful

Get PHP MAJOR,MINOR and RELEASE Version Number – Linux Server

To find out the current version of php active on the server, there are basically two simple solutions and both use the php command with additional parameters. 1. php + grep + cut @ php -v | grep ^PHP | cut -d’ ‘ -f2 7.4.13 2. php +  internal constant from php itself @ php […]

Categories
Linux PHP Servers Useful

PHP-FPM Service – How to start,stop,reload – Ubuntu Linux Severs

Used with many web servers like Apache, Nginx, and other, PHP-FPM is a FastCGI process manager for PHP. Sometimes we need to restart the server for various reasons: changing settings for example, and depending on what linux we have on the server there are some variations in the commands used. Ubuntu/Debian Linux (Ubuntu Linux 16.04+; 18.04; […]