Text
stringlengths 16
168
| Code
stringlengths 5
107
|
---|---|
Compress files report.pdf, audio.mp3, configuration.ini into audio.mp3.zip, storing symbolic links, silently | zip -y -q audio.mp3.zip report.pdf audio.mp3 configuration.ini |
Ignore paths when extracting files from contract.pdf.zip | unzip -j contract.pdf.zip |
Mirror executable.exe with properties preserved to temp_folder | cp -a executable.exe temp_folder |
Show hidden files and directories with colored output | ls -aG |
Copy database.sql to downloads_archive and ask for confirmation from the user | cp -i database.sql downloads_archive |
Make a hard link, backup, and replicate image.jpg to backup while preserving its properties. | cp -p -l -b image.jpg backup |
Look for files with name image.jpg | find . -name image.jpg |
Transfer presentation.pptx firmly to databases, overwriting if required. | mv -f presentation.pptx databases |
Change directory to music_library and extract files from image.jpg.zip | unzip -C music_library image.jpg.zip |
List all files with names starting with "image" showing inode numbers | ls -i image* |
Concatenate report.pdf and report.pdf, numbering non-empty output lines and showing non-printing characters and tabs as '^I' | cat -b -vT report.pdf report.pdf |
Enable color output | ls -G |
Before replacing, copy audio.mp3 to images_backup and ask for approval. | cp -i audio.mp3 images_backup |
List contents of photo.png with non-blank line numbers | cat -b photo.png |
Shrink templates and everything in it. | zip -r templates templates |
Find directories with names starting with 'dir' | find . -type d -name "dir*" |
Enumerate files with expanded properties. | ls -l |
Transferring report.pdf to photos_backup while preserving all properties | cp -a report.pdf photos_backup |
Create a directory named "projects" and list the files in it. | mkdir projects && ls projects |
Show every file and folder recursively | ls -R |
Move audio.mp3 to templates and treat it as a regular file | mv -T audio.mp3 templates |
List of files in extended format | ls -l |
Uncompress configuration.ini.zip, testing archive integrity only, verbose output, and listing files only to directory templates_backup | unzip -t -v -l -d templates_backup configuration.ini.zip |
If proposal.docx is more recent, update it in audio.mp3.zip. | zip -f audio.mp3.zip proposal.docx |
Display spreadsheet.xlsx, showing tabs as '^I' | cat -T spreadsheet.xlsx |
Delete files modified more than 1 year ago | find . -type f -mtime +365 -delete |
Zip databases including all subdirectories | zip -r databases databases |
Look for files with name image.jpg | find . -name image.jpg |
List the contents of the directories after displaying them with coloured output. | ls -dG */ | xargs ls -lG |
Display tabs as ~For policy.pdf, I | cat -T policy.pdf |
Overwrite existing files without prompting when extracting image.jpg.zip | unzip -o image.jpg.zip |
Output executable.exe, configuration.ini, and image.jpg to proposal.docx | cat executable.exe configuration.ini image.jpg > proposal.docx |
Extract files from proposal.docx.zip and change to output | unzip -C output proposal.docx.zip |
Provide password '*.sql' to extract presentation.pptx.zip | unzip -P *.sql presentation.pptx.zip |
Mirror contract.pdf to images_backup and replace any files that already exist without authorization | cp -f contract.pdf images_backup |
Output the last 50 lines of proposal.docx | cat proposal.docx | tail -n 50 |
Transfer databases to reports_archive with recursive copying and preserving attributes | cp -r -p databases reports_archive |
Take the files out of executable.exe.Zip the file, then select documents_archive. | unzip -C documents_archive executable.exe.zip |
Display files sorted by file size | ls -S |
Rename image.jpg to temp using force. | mv -f image.jpg temp |
Display files sorted by size | ls -S |
Move presentation.pptx to archives without replacing | mv -n presentation.pptx archives |
Sort files according to size and provide extensive information in lengthy format. | ls -Sl |
Move document.docx to archives, overwriting the destination if necessary | mv -f document.docx archives |
List all files with names ending in ".mp4" sorted by modification time | ls -t *.mp4 |
Extract encrypted database.sql.zip with password '*.py' | unzip -P *.py database.sql.zip |
Locate regular files | find . -type f |
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 database.sql photos_backup |
Copy document.docx to reports_archive, ensuring that the user approves the overwrite. | cp -i document.docx reports_archive |
Make a hard link, backup, and copy spreadsheet.xlsx to photos_backup while maintaining its properties. | cp -p -l -b spreadsheet.xlsx photos_backup |
Look for empty directories | find . -type d -empty |
Make a hard link and clone memo.txt to documents_backup while preserving attributes. | cp -p -l memo.txt documents_backup |
Locate named pipes | find . -type p |
Print each file that is specified separately. | ls -1 |
Extract files and overwrite existing files from configuration.ini.zip | unzip -o configuration.ini.zip |
Extract files and overwrite existing files from document.docx.zip | unzip -o document.docx.zip |
Display hidden files and directories in long format, then count the number of lines | ls -al | wc -l |
Extract files without paths from photo.png.zip | unzip -j photo.png.zip |
Make a clone of proposal.docx in templates_backup and replace any existing files with force. | cp -f proposal.docx templates_backup |
List the contents of presentation.pptx using the ^tabsI | cat -T presentation.pptx |
Display proposal.docx in quiet mode | cat -q proposal.docx |
List files sorted by modification time and display file sizes in human-readable format | ls -lt -h |
Move the files that match the pattern "*.doc*" to the newly created directory "reports". | mkdir reports && mv **.doc** reports |
List each subdirectory in detail recursively, then tally the total number of directories. | ls -Rd | grep "/$" | wc -l |
Zip contract.pdf without any folder organization | zip -j script.py.zip contract.pdf |
Display contract.pdf with non-printing characters | cat -v contract.pdf |
Create directories scripts, downloads, music and parent directories if they do not exist | mkdir -p scripts && mkdir -p downloads && mkdir -p music |
Duplicate spreadsheet.xlsx to logs_archive and keep attributes unchanged, creating a hard link, and making a backup | cp -p -l -b spreadsheet.xlsx logs_archive |
Find files with names containing 'report' and not writable by others | find . -type f -name "*report*" ! -perm -o=w |
List all files starting with "report" in long format | ls -l report* |
Show file information in long listing format | ls -l |
Change directory to output and extract files from database.sql.zip | unzip -C output database.sql.zip |
Compress files using gzip | find . -type f -execdir gzip {} \ |
Show directories listed first | ls --group-directories-first |
Make a backup of document.docx, relocate it only if it's more recent, and don't replace it. | mv -bnu document.docx photos |
Reverse the order of file listing | ls -r |
Show report.pdf with the blank lines suppressed. | cat -s report.pdf |
Move contract.pdf with attribute preservation to scripts_backup | cp -p contract.pdf scripts_backup |
Print files listed individually | ls -1 |
Enable output with colors | ls -G |
Ignore paths when zipping script.py | zip -j database.sql.zip script.py |
Search for files modified in the last 24 hours and larger than 100KB | find . -type f -mtime -1 -size +100k |
Make directory "temp" and list files in "temp". | mkdir temp && ls temp |
Check for updates and add proposal.docx to presentation.pptx.zip | zip -u presentation.pptx.zip proposal.docx |
Don't use presentation.pptx to replace any existing files in backups. | mv -n presentation.pptx backups |
List the files in descending order of size, show the file sizes in a comprehensible way, and then show the first ten lines. | ls -lSh | head -n 10 |
List every file whose name begins with "image" and displays the inode numbers. | ls -i image* |
Copy all files from 'videos' to 'presentations', then compress them into a zip file named 'audio.mp3.zip'. | cp /videos/* /presentations/ | zip -r /presentations/audio.mp3.zip /presentations/* |
Find files with names containing 'important' and modified in the last 30 days | find . -type f -name "*important*" -mtime -30 |
Show image.jpg with suppressed buffered output | cat -u image.jpg |
Files from memo.txt.zip should be extracted into reports_archive. | unzip -d reports_archive memo.txt.zip |
Extend the format of hidden files and folders, then delete the owner data. | ls -al | awk '{$2=$3=$4=""; print $0}' |
Maintain directory structure and backup projects to photos_backup | cp -r projects photos_backup |
Copy files to downloads | find . -name database.sql -execdir cp {} downloads \ |
Sort the files by modification time and list all names that finish in ".mp4". | ls -t *.mp4 |
List files sorted by time of modification | ls -t |
Check video.mp4.zip for integrity | zip -T video.mp4.zip |
Print the contents of image.jpg with line numbers. | cat -n image.jpg |
Update existing files in image.jpg.zip | zip -u image.jpg.zip proposal.docx |
Transfer contract.pdf to reports while keeping all current files. | mv -n contract.pdf reports |