instruction
stringlengths
1
659
input
stringclasses
1 value
output
stringlengths
1
532
concatenate files matching '*.log' pattern
cat *.log
how do I add a file named 'newfile.txt' to an existing zip archive named 'archive.zip'?
zip -u archive.zip newfile.txt
concatenate files in a directory and save the output to a new file
cat directory/* > combined.txt
how can I remove a file named 'backup.zip'
rm backup.zip
what command creates a directory called 'pictures'
mkdir pictures
display the content of multiple files with a separator between them
cat file1.txt && echo '---' && cat file2.txt
how to create a file named 'newfile.txt'
touch newfile.txt
move all files and subdirectories from 'source' to 'destination', and suppress error messages
mv -f source/* destination/ 2>/dev/null
move file1.txt and file2.txt to the directory 'backup', and prompt before overwriting if necessary
mv -i file1.txt file2.txt backup/
copy all files from directory 'source' to directory 'destination'
cp source/* destination/
display content of files matching a pattern and sort the output
cat file*.txt | sort
what command should I use to search for symbolic links in the directory 'links'?
find links/ -type l
duplicate file.txt and name the copy 'file_copy.txt'
cp file.txt file_copy.txt
extract software.zip to the directory '/usr/local/bin'
unzip software.zip -d /usr/local/bin
display lines containing 'error' or 'warning' in a file
cat filename.txt | grep -E 'error|warning'
how do I compress all files in the directory 'documents' into a zip archive named 'documents.zip'?
zip -r documents.zip documents/
what command can I use to search for directories named 'backup' in the current directory and its subdirectories?
find . -type d -name 'backup'
display the content of a file with line numbers
cat -n filename.txt
how do I view contents of message.txt
cat message.txt
duplicate file.txt to the parent directory
cp file.txt ../
move file.txt to the parent directory, preserving its modification time
mv -u file.txt ../
how to check log.txt content in terminal
cat log.txt
how do I delete a directory called 'test'
rm -r test
what command deletes a file called 'report.txt'
rm report.txt
unzip backup.zip to the directory 'backup_directory'
unzip backup.zip -d backup_directory
duplicate directory 'images' and name the copy 'images_backup'
cp -r images/ images_backup/
concatenate files matching 'access_log.*' pattern
cat access_log.*
display lines not starting with '#' in a file
cat filename.txt | grep -v '^#'
how to create a directory named 'newdir'
mkdir newdir
move all files with the extension '.jpg' from directory 'photos' to directory 'backup', and display verbose output
mv -v photos/*.jpg backup/
move all files with the extension '.txt' from directory 'documents' to directory 'backup'
mv documents/*.txt backup/
extract contents of images.zip to the folder 'images_folder'
unzip images.zip -d images_folder
how do I print content of notes.txt
cat notes.txt
rename directory 'images' to 'backup/images_backup', and create intermediate directories as necessary
mv images/ backup/images_backup/
what command shows data in report.txt
cat report.txt
display content of files in a directory, but exclude files with a specific extension
cat directory/* | grep -v '.zip'
extract files from documents.zip excluding '*.doc' files
unzip documents.zip -x '*.doc'
how can I create a file named 'memo.txt'
touch memo.txt
how to make a folder named 'downloads'
mkdir downloads