FIND YOUR NEXT FEW LINES

Results for “required”

Small, practical examples. Search by task or narrow things down below.

81 snippets foundClear filters
Linux CommandsSystem information

Check available disk space

Show total, used, and available filesystem space for the current directory in human-readable units.

disk✓ Tested
JavaScriptStrings

Check for a substring

Perform a case-sensitive JavaScript substring check.

JavaScript✓ Tested
Linux CommandsSystem information

Check memory usage

Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.

memory✓ Tested
Linux CommandsSystem information

Check the size of a folder

Show a single total for the disk space used by a folder and its contents.

disk usage✓ Tested
Linux CommandsArchives & checksums

Compress a file and keep the original

Create a gzip-compressed copy of a file while leaving the uncompressed original in place.

gzip✓ Tested
Linux CommandsFiles & folders

Copy a file to a folder

Create a backup folder if needed, then copy a file into it while preserving its modification time and permission bits.

file✓ Tested
Linux CommandsText processing

Count lines in a file

Count newline characters in a text file, printing only the count without the filename.

lines✓ Tested
PythonCollections

Count occurrences in a list

Count how often each value appears using Counter from the standard library.

count✓ Tested
Linux CommandsArchives & checksums

Create a compressed tar archive

Bundle a directory into a gzip-compressed tar archive, preserving the directory structure.

tar✓ Tested
Linux CommandsFiles & folders

Create a directory tree

Create a directory and its missing parent directories. The -p option also succeeds when the directories already exist.

directory✓ Tested
Linux CommandsFiles & folders

Create a symbolic link

Create a relative symbolic link to a file and inspect its target with readlink.

symlink✓ Tested
PythonFiles & paths

Create nested folders

Create a folder and any missing parent folders in one call. Running the code again is safe when the folder already exists.

directory✓ Tested