Text
stringlengths
16
168
Code
stringlengths
5
107
Before transferring spreadsheet.xlsx to archives, ask for confirmation.
mv -i spreadsheet.xlsx archives
Display hidden files and folders in a lengthy format with detailed information and coloured output.
ls -alG
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
List the directories on their own.
ls -d
Treat the destination as a file, prompt before overwriting executable.exe in photos, and print verbose information.
mv -iTv executable.exe photos
Recursive copying is used to preserve the properties of reports after a backup to logs_archive.
cp -r -p reports logs_archive
Place all of scripts's files in an archive.s
zip -r scripts scripts
Recursively list folders and their contents
ls -R
Copy contract.pdf to logs_archive while preserving its attributes, creating a hard link, and making a backup
cp -p -l -b contract.pdf logs_archive
Place configuration.ini.zip inside database.sql.
zip -m configuration.ini.zip database.sql
Duplicate video.mp4 to scripts_backup and keep attributes unchanged
cp -p video.mp4 scripts_backup
Place the files in projects.
find . -name report.pdf -exec mv {} projects \
Sort the files according to their modification timestamp.
ls -t
Before changing policy.pdf to presentations, make sure.
mv -i policy.pdf presentations
Make "photos" and purge files that correspond to "*.png".
mkdir photos && rm **.png*
Copy memo.txt to backup and erasing any files that are already there.
cp -f memo.txt backup
Remove photo.png from proposal.docx.zip
zip -d proposal.docx.zip photo.png
Create directory reports with verbose output
mkdir -v reports
Replicate database.sql to documents_archive and ask before replacing existing files
cp -i database.sql documents_archive
Make new archive script.py.zip with spreadsheet.xlsx
zip -c script.py.zip spreadsheet.xlsx
Confirm before replacing contract.pdf with photos
mv -i contract.pdf photos
Files are shown in order of file size.
ls -S
Extract and update files with newer versions from presentation.pptx.zip
unzip -U presentation.pptx.zip
From memo.txt.zip, remove presentation.pptx.
zip -d memo.txt.zip presentation.pptx
Show files having output that is colourized.
ls -G
Forcefully move photo.png to photos, but ask for approval
mv -if photo.png photos
Find the specified pipes.
find . -type p
Display the contents of document.docx with the repeated blank lines disabled
cat -s document.docx
Make a hard link, backup, and replicate image.jpg to backup while preserving its properties.
cp -p -l -b image.jpg backup
Pack spreadsheet.xlsx without paths into archive
zip -j photo.png.zip spreadsheet.xlsx
If spreadsheet.xlsx is more recent or does not already exist in documents, move it there.
mv -u spreadsheet.xlsx documents
Locate files named photo.png
find . -name photo.png
Find files modified within the last 7 days
find . -mtime -7
Before replacing, copy audio.mp3 to images_backup and ask for approval.
cp -i audio.mp3 images_backup
List the contents of script.py using the ^tabsI
cat -T script.py
Create directory presentations with verbose output
mkdir -v presentations
Locate named pipes
find . -type p
Extraction of database.sql.zip in full
unzip -v database.sql.zip
Move image.jpg as a normal file to databases.
mv -T image.jpg databases
Extract files from database.sql.zip quietly
unzip -q database.sql.zip
Show comprehensive file information
ls -l
Uncompress proposal.docx.zip, extracting symbolic links, to directory downloads_archive
unzip -l -d downloads_archive proposal.docx.zip
Transfer report.pdf to downloads_archive and, if required, prompt before overwriting
cp --interactive report.pdf downloads_archive
Output the first 15 lines of report.pdf
cat report.pdf | head -n 15
Replicate contract.pdf to videos_backup while retaining its attributes, creating a hard link, and making a backup
cp -p -l -b contract.pdf videos_backup
Show report.pdf with characters that don't print
cat -v report.pdf
Change directory to projects_backup and extract files from script.py.zip
unzip -C projects_backup script.py.zip
Copy spreadsheet.xlsx to reports_archive and create a backup of existing files
cp -b spreadsheet.xlsx reports_archive
Show files listed in reverse order
ls -r
Display the contents of document.docx with the repeated blank lines disabled
cat -s document.docx
Mirror contract.pdf to images_backup and replace any files that already exist without authorization
cp -f contract.pdf images_backup
Display database.sql, showing line numbers, non-printing characters, and tabs as '^I'
cat -n -v -T database.sql
Show line numbers for contract.pdf
cat -n contract.pdf
Show files arranged by modification time
ls -t
List subdirectories recursively, providing coloured output and comprehensive details.
ls -Rdl
Show hidden files and directories in a lengthy format with sizes that are readable by humans and full information.
ls -alh
Look for files that have the name report.pdf.
find . -name report.pdf
Establish directory "scripts" and concatenate files "proposal.docx", "photo.png", "spreadsheet.xlsx" into it.
mkdir scripts && cat proposal.docx photo.png spreadsheet.xlsx > scripts/concatenated_file.txt
Move presentation.pptx to archives without replacing
mv -n presentation.pptx archives
First-listed show directories
ls --group-directories-first
Show file sizes in a readable manner
ls -h
For each file name, create a backup, a hard link, and mirror it to the destination directory while preserving its properties.
cp -p -l -b photo.png documents_backup
Sort the files according to their modification timestamp.
ls -t
Check integrity of audio.mp3.zip
zip -T audio.mp3.zip
Print the contents of database.sql with non-blank line numbering.
cat -b database.sql
Do not replace existing files in presentations with script.py
mv -n script.py presentations
File compression with gzip
find . -type f -execdir gzip {} \
Delete files with name database.sql
find . -name database.sql -delete
Search for files named script.py
find . -name script.py
Move the files from projects to downloads_archive after filtering them using *.txt.
grep -lR "*.txt" projects | xargs -I {} mv {} downloads_archive
Search for files modified more than 30 days ago and smaller than 10KB
find . -type f -mtime +30 -size -10k
List the contents of proposal.docx while displaying each control character.
cat -A proposal.docx
Backup current files and clone contract.pdf to photos_backup.
cp -b -p contract.pdf photos_backup
Find files with names containing 'report' and with permissions 644
find . -type f -name "*report*" -perm 644
Unarchive image.jpg.zip with password 'secure123' and overwriting existing files to directory videos_backup
unzip -P secure123 -o -d videos_backup image.jpg.zip
Silently unzip the files from image.jpg.zip.
unzip -q image.jpg.zip
Before transferring spreadsheet.xlsx to archives, ask for confirmation.
mv -i spreadsheet.xlsx archives
Unzip files from video.mp4.zip ignoring directory structure
unzip -j video.mp4.zip
Examine database.sql.zip for consistency.
zip -T database.sql.zip
Add and move document.docx to video.mp4.zip
zip -m video.mp4.zip document.docx
Recursively list subdirectories with detailed information and colors
ls -RdlG
Display files with extended information
ls -l
video.mp4 should be moved to photos. handling it like any other file
mv -T video.mp4 photos
Show directories without listing their contents
ls -d
Recursive copying is used to move music to documents_archive, maintaining attributes, and making a backup.
cp -r -p -b music documents_archive
Display spreadsheet.xlsx, showing tabs as '^I'
cat -T spreadsheet.xlsx
Show directories listed first
ls --group-directories-first
Display hidden files along with normal files
ls -a
List files with hidden files included
ls -a
Package files script.py, spreadsheet.xlsx, contract.pdf into proposal.docx.zip, saving extended attributes, storing file attributes
zip -X -X proposal.docx.zip script.py spreadsheet.xlsx contract.pdf
Provide a human-readable list of file sizes.
ls -h
Display memo.txt with non-printing characters visible
cat -v memo.txt
Copy contract.pdf to videos_backup; interactive confirmation is necessary.
cp -i contract.pdf videos_backup
Force copy spreadsheet.xlsx to archive without prompting and preserving attributes
cp -f -p spreadsheet.xlsx archive
Package files audio.mp3, photo.png, presentation.pptx into policy.pdf.zip, saving extended attributes
zip -X policy.pdf.zip audio.mp3 photo.png presentation.pptx
Show each file separately, one on a line.
ls -1
Display executable.exe with buffered output suppressed
cat -u executable.exe
Test integrity of executable.exe.zip
zip -T executable.exe.zip
Delete empty directories
find . -type d -empty -delete
Sort files according to size and provide extensive information in lengthy format.
ls -Sl