Text
stringlengths
16
168
Code
stringlengths
5
107
Duplicate video.mp4 to videos_backup with user confirmation for overwrite, preserving attributes, and creating a backup
cp -i -p -b video.mp4 videos_backup
Create audio.mp3.zip containing image.jpg
zip -c audio.mp3.zip image.jpg
Duplicate video.mp4 to scripts_backup and keep attributes unchanged while creating a hard link
cp -p -l video.mp4 scripts_backup
Display audio.mp3 with line endings
cat -E audio.mp3
Files should be shown sorted by modification time.
ls -t
List directory contents and subdirectories recursively
ls -R
Show buffered output suppressed for document.docx
cat -u document.docx
Place executable.exe in the policy.pdf archive.zip
zip -m policy.pdf.zip executable.exe
Display hidden files and directories in long format
ls -al
Modify the file permissions.
find . -type f -exec chmod 644 {} \
Test integrity of contract.pdf.zip
zip -T contract.pdf.zip
Display executable.exe with buffered output suppressed
cat -u executable.exe
Compress files proposal.docx, report.pdf, contract.pdf into database.sql.zip, quietly, using password 'secure123', preserving paths
zip -q -r -P secure123 database.sql.zip proposal.docx report.pdf contract.pdf
Display hidden files and directories in long format
ls -al
Search for files with names containing 'document' and not writable by the group
find . -type f -name "*document*" ! -perm -g=w
Extract files from spreadsheet.xlsx.zip into photos_backup
unzip -d photos_backup spreadsheet.xlsx.zip
Archive files policy.pdf, proposal.docx, spreadsheet.xlsx into report.pdf.zip, storing symbolic links
zip -y report.pdf.zip policy.pdf proposal.docx spreadsheet.xlsx
Force copy spreadsheet.xlsx to music_library and create a backup of existing files
cp -b -f spreadsheet.xlsx music_library
Save a backup of script.py, do not overwrite, and show verbose feedback
mv -nbv script.py photos
Check video.mp4.zip for integrity
zip -T video.mp4.zip
Create a backup of proposal.docx, do not overwrite, display verbose output, and treat destination as file
mv -bnvT proposal.docx presentations
Make 'archives', copy 'photo.png' into it, and then make 'shortcut', a symbolic link, to the file.
mkdir /archives/ | cp /photo.png /archives/ | ln -s /archives/ /shortcut/
Sort the files according to their sizes.
ls -S
Files should be sorted in reverse order.
ls -r
Move spreadsheet.xlsx to downloads_archive in duplicate, then replace it.
cp -f spreadsheet.xlsx downloads_archive
Create a directory named 'photos', copy all files from 'music' to it, then move them to 'presentations', and finally find files matching the pattern '*.sql'.
mkdir /photos/ | cp /music/* /photos/ | mv /photos/* /presentations/ | find /presentations/ -name "*.*.sql"
Update database.sql in proposal.docx.zip if newer
zip -f proposal.docx.zip database.sql
Without treating it as a directory, put policy.pdf in videos.
mv -T policy.pdf videos
Create a backup and force move photo.png to downloads
mv -fb photo.png downloads
Verify script.py.zip for integrity
zip -T script.py.zip
Take configuration.ini out of the memo.txt.zip.
zip -d memo.txt.zip configuration.ini
Duplicate executable.exe to images_backup and retain all attributes
cp -a executable.exe images_backup
Pack logs and its files into archive
zip -r logs logs
List the contents of presentation.pptx while suppressing the repetitive blank lines.
cat -s presentation.pptx
Mirror document.docx to temp_folder with attributes intact
cp -p document.docx temp_folder
Print inode numbers of files
ls -i
Search for symbolic links
find . -type l
Take the files out of proposal.docx.zip. disregarding the directory structure
unzip -j proposal.docx.zip
Erase policy.pdf from proposal.docx.zip
zip -d proposal.docx.zip policy.pdf
Replicate downloads to templates_backup recursively
cp -r downloads templates_backup
Extract files without directory structure from database.sql.zip
unzip -j database.sql.zip
Treat the destination as a file, prompt before overwriting executable.exe in photos, and print verbose information.
mv -iTv executable.exe photos
Display audio.mp3 with line endings
cat -E audio.mp3
Display report.pdf, showing line numbers, non-printing characters, and tabs as spaces
cat -n -vT report.pdf
Transfer audio.mp3 to reports_archive and forcefully replace existing files
cp -f audio.mp3 reports_archive
Make a copy of presentation.pptx in images_backup, but before overwriting, get permission.
cp -i presentation.pptx images_backup
Display memo.txt with non-printing characters visible
cat -v memo.txt
Copy script.py to projects_backup and prompt for confirmation before replacing
cp -i script.py projects_backup
Copy report.pdf to downloads_archive and ask before replacing existing files
cp -i report.pdf downloads_archive
List files in order of last modification time
ls -t
In photos, prompt before overwriting executable.exe, regard the destination as a file, and only move if it's more recent.
mv -iuT executable.exe photos
Without treating it as a directory, put policy.pdf in videos.
mv -T policy.pdf videos
Package files report.pdf, spreadsheet.xlsx, document.docx into document.docx.zip, using compression level 3, storing symbolic links
zip -3 -y document.docx.zip report.pdf spreadsheet.xlsx document.docx
Extract files from configuration.ini.zip ignoring directory structure
unzip -j configuration.ini.zip
Unpack policy.pdf.zip with password 'pass123' and preserving permissions to directory scripts_backup
unzip -P pass123 -K -d scripts_backup policy.pdf.zip
Move policy.pdf to databases without overwriting
mv -n policy.pdf databases
Prompt before overwriting memo.txt in scripts, treat destination as file, and display verbose output
mv -iTv memo.txt scripts
Take the files out of presentation.pptx.into downloads_archive using zip
unzip -d downloads_archive presentation.pptx.zip
Print executable.exe making visible all control characters.
cat -A executable.exe
Make a copy of policy.pdf and obliterate the current files in documents_backup.
cp -f policy.pdf documents_backup
Show database.sql with line breaks included
cat -E database.sql
Verify integrity of audio.mp3.zip
zip -T audio.mp3.zip
Zip reports and subdirectories
zip -r reports reports
Forcefully move image.jpg to presentations, prompt before overwriting, and move only if newer
mv -fiu image.jpg presentations
Ignore paths when zipping script.py
zip -j database.sql.zip script.py
Locate files modified more than 1 year ago
find . -mtime +365
Display configuration.ini, showing tabs as spaces
cat -T configuration.ini
Clone memo.txt to logs_archive with attribute preservation, creating a hard link, and making a backup
cp -p -l -b memo.txt logs_archive
Duplicate video.mp4 to scripts_backup and keep attributes unchanged while creating a hard link
cp -p -l video.mp4 scripts_backup
Display files in order of modification time.
ls -t
Release memo.txt.zip, extracting symbolic links and listing files only to directory videos_backup
unzip -l -d videos_backup memo.txt.zip
Clone policy.pdf to music_library with attribute preservation, creating a hard link, and making a backup
cp -p -l -b policy.pdf music_library
Remove all files with the name policy.pdf.
find . -name policy.pdf -exec rm {} \
Find directories modified more than 30 days ago
find . -type d -mtime +30
Transfer databases to reports_archive with recursive copying and preserving attributes
cp -r -p databases reports_archive
Zip files executable.exe, contract.pdf, video.mp4 into report.pdf.zip, using compression level 6, verbose output
zip -6 -v report.pdf.zip executable.exe contract.pdf video.mp4
Display proposal.docx with buffered output suppressed
cat -u proposal.docx
List files with extended attributes
ls -l
Create directory "videos" and zip files "database.sql", "image.jpg", "image.jpg" in it.
mkdir videos && zip videos.zip database.sql image.jpg image.jpg
Recursively list subdirectories with colored output and detailed information
ls -Rdl
Verbose result: proposal.docx should be moved to templates.
mv -v proposal.docx templates
Recursively display the directory structure
ls -R
Unprompted overwrite current files when extracting report.pdf.zip
unzip -o report.pdf.zip
Verbose mode: Move configuration.ini into the designated directory.
mv -v configuration.ini videos
Find directories
find . -type d
Sort files by size and display file sizes in human-readable format, then display the last 5 lines
ls -lSh | tail -n 5
Move image.jpg to archives and show verbose output
mv -v image.jpg archives
Generate directory "documents" and list contents of "documents".
mkdir documents && ls documents
Display configuration.ini, showing tabs as spaces
cat -T configuration.ini
Extract files without directory structure from image.jpg.zip
unzip -j image.jpg.zip
Show inode numbers of each file
ls -i
Change directory to videos_backup and extract files from photo.png.zip
unzip -C videos_backup photo.png.zip
Mirror configuration.ini to archive using hard links
cp -l configuration.ini archive
Show line numbers for spreadsheet.xlsx
cat -n spreadsheet.xlsx
When extracting files from presentation.pptx.zip, ignore paths.
unzip -j presentation.pptx.zip
Show hidden files with regular files.
ls -a
Make directory "projects" and unzip contents of "executable.exe.zip" into it.
mkdir projects && unzip executable.exe.zip -d projects
Move configuration.ini to photos_backup while preserving its properties.
cp -p configuration.ini photos_backup
Change permissions of files
find . -type f -exec chmod 644 {} \
List directory contents including hidden files and directories
ls -a