41bashExtract the word "lazy" from the sentence "The quick brown fox jumps over the lazy dog." using sed. This demonstrates how to use sed to capture and print a specific part of a string based on a pattern.echo "The quick brown fox jumps over the lazy dog." | sed -n "s|.*the \(.*\) dog.*|\1|p"external toolssed
42bashThis demonstrates using sed to find and replace patterns in a string using regular expressions.echo "abc123def456" | sed -E 's/[a-z]*/First letters ==> & <== /'external toolssedregex substitution (regular expression substitution)
43bashThis demonstrates basic string substitution using sed to replace the first occurrence of a pattern in a string.echo "Hello, hello, hello" | sed 's/hello/goodbye/' #Result: Hello, goodbye, helloexternal toolssedstring substitution
44bashThis demonstrates basic text substitution using sed.echo "The quick brown fox" | sed 's/brown/red/' #Result: The quick red foxexternal toolssedtext substitution (simple)
45bashThis demonstrates using the tr command to remove specific characters from a string.echo "Hello" | tr -d "el" #Result: Hoexternal toolstrcharacter deletion
46bashThis demonstrates using the tr command to transform text case between uppercase and lowercase.echo "Hello" | tr '[:lower:]' '[:upper:]' #Result: HELLO echo "Hello" | tr '[:upper:]' '[:lower:]' #Result: helloexternal toolstrtext transformationcase conversion
47bashThis demonstrates character translation using the tr command in Bash, replacing specified characters with others.echo "Hello" | tr 'el' 'x' #Result: Hxxxo echo "Hello" | tr 'el' 'ay' #Result: Hayyoexternal toolstrcharacter translation
48bashThis demonstrates using the cut command to extract specific fields from a string based on a specified delimiter.echo "Hello world and good day." | cut -d " " -f 1 #Result: Hello echo "Hello-world-and-good-day." | cut -d "-" -f 2 #Result: worldexternal toolscutfield extraction
49bashThis demonstrates using the find command to locate files with specific extensions (.swift or .m).find . -name "*.swift" -or -name "*.m"external toolsfindfile searchpattern matching
50bashThis demonstrates extracting the directory path from a file path using the dirname command.dirname "/My/path/to/file.txt"external toolsdirnamefile path manipulation
51bashThis demonstrates extracting the filename from a full path using the basename command.basename "/My/path/to/file.txt"external toolsbasenamepath manipulation
52bashThis script sorts the contents of random_order.txt and removes duplicate lines.sort random_order.txt | uniqexternal toolsuniq
53bashThis demonstrates using uniq -c to count occurrences of unique lines in a file.uniq -c sales.csvexternal toolsuniqcounting unique lines
54bashRemove duplicate lines from the sales.csv file using the uniq command. This demonstrates filtering unique lines from a file.uniq sales.csvexternal toolsuniq
55bashThis demonstrates extracting and sorting the second field from a comma-separated input using cut and sort.cut -d , -f 2 | sortexternal toolscutfield extraction
56bashThis demonstrates sorting a file in descending order.sort -r random_order.txtexternal toolssort
57bashThis demonstrates using the sort command to sort the contents of a file in ascending order.sort random_order.txtexternal toolssortbasic file content sorting
58bashThis demonstrates how to preview the first 5 lines of a file using the head command.head -n 5 < sales.csvexternal toolsheadfile preview
59bashExtract the first 5 lines from the sales.csv file and save them to a new file named top_sales.csv. This demonstrates how to use the head command to quickly extract a portion of a file.head -n 5 sales.csv > top_sales.csvexternal toolshead
60bashRemove the directory named temp_results using the rmdir command. This command is used to delete empty directories in Bash.rmdir temp_resultsexternal toolsrmdir