All Go Rust Python PHP JavaScript
Chrome Dev Summit to secure your spot in workshops, office hours and learning lounges!

How to Extract All the Numbers Contained in a String in Python

In Python, there are 2 ways to extract all the numbers contained in a string. Using List Comprehension List comprehensions provide a concise way to create lists. If you only want to extract only positive integers, try the following: #!/usr/bin/...
Sambhav Khandelwal

How to Pipe Several Commands in Go

In Golang, there are 2 ways to pipe several commands. Using piped commands For example, this function retrieves the CPU model name using piped commands: package main import ( "fmt" "os/exec" ) func main() { cmd := "cat /proc/cpuinfo | eg...
Patcher56

How to Check If an Object Is of a Given Type in Python

In Python, there are 2 ways to check if an object is of a given type. Using isinstance Method The isinstance(object, classinfo) method returns True if the object argument is an instance of the classinfo argument, or of a (direct, indirect, or virtua...
Unused

How to Execute a Program or Call a System Command in Python

In Python, there are 3 ways to execute a program or call a system command. Using subprocess Module The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. See the following e...
Patcher56

How to use the kill command in Linux

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...

How to use the head command in Linux

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...

How to use the find command in Linux

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 ...

How to use the curl command in Linux

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 ...

How to use the cat command in Linux

Concatenate FILE(s), or standard input, to standard output. The cat command (short for “concatenate”) lists the contents of files to the terminal window. This is faster than opening the file in an editor, and there’s no chance you can accidentally a...

How to use the Angular CLI generate command line

Generates and/or modifies files based on a schematic.Creates a new, generic NgModule definition in the given or default project. NgModule ng generate module page/edit ng g m page/edit CREATE src/app/page/edit/edit.module.ts (19...