In Golang, there are 2 ways to check if a file is a valid image.
Using DetectContentType Function
The http.DetectContentType() function implements the algorithm described at https://mimesniff.spec.whatwg.org/ to determine the Content-Type of the gi...
Reading from a url resource in Go.Fetching a URL
Go provides a collection of packages, grouped under net, that make it easy to send and receive information through the Internet. Package http provides HTTP client and server implementations.
packag...
user interface to the TELNET protocol.
Telnet is an application protocol used on the Internet or local area network to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. User data is interspe...
Create the DIRECTORY(ies), if they do not already exist.
mkdir command in Linux allows the user to create directories (also referred to as folders in some operating systems ). This command can create multiple directories at once as well as set the p...
history command is used to view the previously executed command.
The history command works with the command history list. When the command is issued with no options, it prints the history list.
The History library provides a history expansion featur...
terminate a process.
kill is a command that is used in several popular operating systems to send signals to running processes.
The command kill sends the specified signal to the specified process or process group. If no signal is specified, the TE...
Print the first 10 lines of each FILE to standard output.
head is a program on Unix and Unix-like operating systems used to display the beginning of a text file or piped data.
By default, head will print the first 10 lines of its input to the stand...
Compress or uncompress FILEs.
Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the same ownership modes, access and modi‐ficati...
Search for PATTERN in each FILE or standard input.
grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command g/re/p (globally search for a regular expression and p...
Display amount of free and used memory in the system.
free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. The information is gathered by parsing /proc/meminfo....
search for files and directories based on their permissions, type, date, ownership, size, and more.
find is a command-line utility that locates files based on some user-specified criteria and either prints the pathname of each matched object or, if ...
Compare FILES line by line.
You can use the diff command to show differences between two files, or each corresponding file in two directories. diff outputs differences between files line by line in any of several formats, selectable by command line o...
Show information about the file system on which each FILE resides, or all file systems by default.
df (abbreviation for disk free) is a standard Unix command used to display the amount of available disk space for file systems on which the invoking us...
command line tool and library for transferring data with URLs.
cURL (pronounced 'curl') is a computer software project providing a library (libcurl) and command-line tool (curl) for transferring data using various network protocols. The name ...
The chown command changes user ownership of a file, directory, or link in Linux.
The command chown, an abbreviation of change owner, is used on Unix and Unix-like operating systems to change the owner of file system files, directories.
cha...