This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_rsa.pub | ssh user@host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -s <(sha1sum fileToCheck | cut -d " " -f1) <(echo "SHA1Hash") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in *.txt; | |
do | |
x=$(sed 's/^Foo\(Bar..*\)/\1/' <<< $i); | |
echo "$i renames to: $x"; | |
mv $i $x; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, argparse | |
parser = argparse.ArgumentParser(description="Remove spaces from file names and make them lowercase.") | |
parser.add_argument("file", nargs='+', help="The file to be renamed") | |
args = parser.parse_args() | |
for f in args.file: | |
print "Renaming {} to {}".format(f, f.replace(" ", "_").lower() ) | |
os.rename(f, f.replace(" ", "_").lower()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Lowercase a group of files | |
for i in "${1}"; do mv "$i" "$(echo $i|tr A-Z a-z)"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Replace spaces with underscores | |
for file in "${1}"; | |
do | |
echo Renaming "$file" to "${file// /_}" | |
mv "$file" "${file// /_}" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Renames a group of files | |
counter=0 | |
filename=$1 | |
context=$2 | |
ext=$3 | |
if [ $# -ne 0 ] | |
then | |
if [ -z "${ext}" ] |
NewerOlder