In Python, there are 3 ways to get the system hostname.
Using gethostname Method
The socket.gethostname() method returns a string containing the hostname of the machine where the Python interpreter is currently executing. For example,
#!/usr/bin...
In Golang, there are 4 ways to generate a uuid.
Using uuid Package
install
Use the following command to download the repository to the local file system.
install
go mod tidy
go get github.com/google/uuid
go install github.com...
In Golang, there are 2 ways to install Go in Linux.Download Packages
Download packages for Windows 64-bit, macOS, Linux, and more.
Go install
Linux
Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extr...
In Rust, there are two ways to install rust in Linux.Running the following in your terminal
If you’re running macOS, Linux, or another Unix-like OS. To download Rustup and install Rust, run the following in your terminal, then follow the on-screen i...
Hello, World! is the first basic program in any programming language.Python Version
Print the Python version number and exit. Example output could be:
Python version
python -V
python --version
Python 3.9.1
Running Files with Command Lines
You c...
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...