Description The acos() function calculates the arc cosine value of the number provided as its only parameter, essentially reversing the operation of cos(). The return value is in radians—you should use the rad2deg() to convert radians to degrees. $acos1 = acos(0.4346); $acos2 = acos(cos(80)); Syntax: acos(float $num): float Parameters Parameter Description num The argument to […]
Archives for April 2022
PHP function abs – Absolute value
Description Returns the absolute value of the number in the same type (float or integer) as the argument. Syntax: int abs(int number) float abs(float number) The abs() function returns the absolute value of the parameter you pass to it. By absolute, I mean that it leaves positive values untouched, and converts negative values into positive […]
sudo Command Examples in Linux
The sudo command allows an administrator to set up a configuration file called /etc/sudoers and define specific commands that particular users are permitted to execute under an assumed identity. The sudo command is like su in many ways but has some important additional capabilities. The administrator can configure sudo to allow an ordinary user to […]
zcat Command Examples in Linux
The zcat command dumps uncompressed data from a .gz file to stdout without recreating the original file. The .gz file remains intact. Syntax: $ zcat [options] [files] Example: $ ls test.gz $ zcat test.gz A test file # file test contains a line “A test file” $ ls test.gz zcat Command Examples 1. To read […]
wget Command Examples in Linux
The wget command is one of the most popular non-interactive command-line file downloaders in Linux. It can download multiple files/directories and can work in the background as well. The downloaded web page can be opened with any graphical or non-graphical browser. Some of its popular features are as follows: Support of HTTP, HTTPS, and FTP […]
All Linux Compress/Decompress Commands
Linux contains several file compression/decompression utilities. Although this may sound great, it often leads to confusion and chaos when trying to download files. Below examples lists the compression/decompression utilities available in Linux along with an example. 1. zip – To compress a file: # zip file.txt 2. gzip – To compress or expand files: # […]
ac Command Examples in Linux
ac command prints out a report of connect time (in hours) based on the logins/logouts in the current wtmp file. A total is also printed out. Syntax: # ac [options] Example: $ ac total 1774.81 ac Command Examples 1. To get the connect time for a user: # ac root 2. To get the daily […]
adduser Command Examples in Linux
To add new users you can use the adduser command. With no options, adduser steps you through the information you need to enter to add a user account. Here’s an example of using adduser to add a user interactively: # adduser ### Start an interactive session to add a user Username: geek Full name: geek […]
cal Command Examples in Linux
The wonderful cal command can tell you a lot. Entered without any arguments, it shows you a calendar for the current month that looks like this: $ cal April 2022 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 […]
chacl Command Examples in Linux
The chacl command is used to modify the ACL for a file. ACLs can be specified to chacl in two distinct forms: as a list of entries or with a chmod-like syntax. By default, chacl adds entries to the current ACL. It also provides a bit more information about how ACLs really work than the […]