Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# Print current directory pwd # Navigate to an absolute path cd /var/log # Navigate up two levels cd ../.. # Return to previous directory cd - # Push current dir onto stack and cd to /tmp pushd /tmp # List the directory stack dirs -v # Return to last pushed directory popd # ---- find examples ---- # Find files by name (case-insensitive) find /home -iname "*.txt" # Find files modified in the last 7 days find /var/log -mtime -7 # Find files larger than 100 MB find / -size +100M -type f 2>/dev/null # Find empty files find . -type f -empty # Find and delete .tmp files (with confirmation prompt removed) find /tmp -name "*.tmp" -type f -delete # Find files owned by a specific user find /home -user alice # Execute a command on each found file find . -name "*.log" -exec gzip {} \;
Result
Open