62bashThis script moves the file sales.csv to the data directory and renames it to sales-2023.csv without overwriting an existing file.mv -n sales.csv data/sales-2023.csvexternal toolsmvfile move and rename with overwrite protection
63bashThis script moves all .csv files in the current directory to the data/ directory.mv *.csv data/external toolsmv
64bashThis script renames the file sales.csv to sales-2023.csv.mv sales.csv sales-2023.csvexternal toolsmv
65bashThis demonstrates file renaming and moving in Bash.mv sales.csv data/sales-2023.csvexternal toolsmv
66bashThis script copies all .csv files from the current directory to the data/ directory.cp *.csv data/external toolscp
67bashThis script counts the number of lines, words, and bytes in the README.txt file.wc README.txtexternal toolswc
68bashThis demonstrates how to select and display specific fields from a file.cut -d , -f 2-5, 8 sales.csvexternal toolscut
69bashThis demonstrates searching for specific file types recursively.find . -type f -name *.ipynbexternal toolsfind
70bashThis demonstrates recursively listing all files and directories from the current directory.ls -Rexternal toolslsrecursive listing
71bashThis demonstrates listing files and directories with detailed, human-readable information using the ls command.ls -lhexternal toolslsdetailed and human-readable listing
72bashThis demonstrates listing all files and directories, including hidden ones, in the current directory using the ls command with the -a option.ls -aexternal toolslslisting files and directories
73bashThis snippet lists all directories in the PATH environment variable by splitting it into individual paths and using find to locate directories within those paths.find ${PATH//:/ } -type dexternal toolsfind
74bashThis demonstrates using fgrep to search for a fixed string in a file.fgrep "foobar" file.txtexternal toolsgrepfixed string search
75bashThis script searches for lines in file.txt that start with foo and end with bar, then excludes any lines containing baz.grep "^foo.*bar$" file.txt | grep -v "baz"external toolsgrep
76bashThis demonstrates advanced usage of the grep command, including recursive search, line number inclusion, and binary file exclusion.grep -r "^foo.*bar$" someDir/ # recursively `grep` grep -n "^foo.*bar$" file.txt # give line numbers grep -rI "^foo.*bar$" someDir/ # recursively `grep`, but ignore binary filesexternal toolsgreprecursive search
77bashCount the number of lines in file.txt that match the regex pattern ^foo.*bar$. The -c option in grep is used to print the count of matching lines instead of the lines themselves. This demonstrates how to count occurrences of a specific pattern in a file.grep -c "^foo.*bar$" file.txtexternal toolsgrep
78bashThis demonstrates using grep to filter lines based on a regular expression.grep "^foo.*bar$" file.txtexternal toolsgrepregex filter (regular expression filter)
79bashThis script replaces every occurrence of the string okay with great in file.txt using sed, with the -i flag modifying the file in place.sed -i 's/okay/great/g' file.txt # be aware that this -i flag means that file.txt will be changed # -i or --in-place erase the input file (use --in-place=.backup to keep a back-up)external toolssed
80bashThis script extracts and prints only the first column from a CSV file, where columns are separated by a comma (,).cut -d ',' -f 1 file.txtexternal toolscut