How to use the Linux Command Builder
- 1. Pick a commandfind to locate files, grep to search inside them, or tar for archives.
- 2. Fill in the optionsFolder, name pattern, age, size, search text or archive name.
- 3. Copy and runRead the explanation table, then paste the command in your terminal.
Worked example
The defaults ask for log files changed in the last week. The builder writes find . -type f -name '*.log' -mtime -7: start in the current folder, regular files only, names matching *.log, modified less than 7 days ago. The pattern is in single quotes so the shell passes it to find instead of expanding it to file names in the current folder, a mistake that gives confusing results.
Choose Show details and the command ends with -exec ls -lh {} +, which lists size and date for each match. Choose Delete them and it ends with -delete. Run it once without -delete first and check the list.
grep and tar options
- grep's preset options cover recursive search with line numbers, ignoring case, listing only file names, whole words, inverted matches and counts.
- Tick literal search to add
-F, so characters such as . and * are matched as plain text. - The builder puts
--before the pattern, so a search for text starting with a hyphen still works. - tar can create, extract or list, with gzip, bzip2 or xz compression, and can extract into a chosen folder with -C.
The syntax is for GNU tools on Linux. macOS ships BSD versions; most flags match but a few differ. Find more commands in the Linux commands cheat sheet and fix permissions with the chmod calculator.
Frequently asked questions
What does -mtime -7 mean exactly?
Modified less than 7 full days ago. +7 means more than 7 days ago, and 7 on its own means between 7 and 8 days ago.
Is the delete option safe?
It deletes every match without asking. Always run the same command without -delete first and read the list.
Is the Linux Command Builder free?
Yes, the Linux Command Builder is free. The first time you build your first command, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.