How to change filename case of all files in a directory
Answer:
If you want to change the case of filename of all files in a directory, e.g. change to all UPPER case, you can use:
# rename 'y/a-z/A-Z/' *
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to change filename case of all files in a directory
Answer:
If you want to change the case of filename of all files in a directory, e.g. change to all UPPER case, you can use:
# rename 'y/a-z/A-Z/' *
Use Perl to split string instead of awk
Answer:
If you know Perl well, there is no need to use awk to do string processing such as string splitting, it is easy with Perl also, e.g.
# echo "foo,bar,k3" | perl -F',' -lane 'print $F[1]'
bar
How to get file name only with find command?
Answer:
To show only the filename of Linux command, you can use
# find /dir -type f -printf "%f\n"
file1
file2
file3
...
Replace newline by comma
Answer:
To replace all newline in a file by command, you can use the command
# tr '\n' ',' < input.txt > output.txt
How to check the SSL cert expiration date using command?
Answer:
To check the SSL cert expiration date of a domain, you can use the following command:
# echo | openssl s_client -connect www.google.com:443 2>/dev/null | openssl x509 -noout -dates
notBefore=Dec 11 12:02:58 2013 GMT
notAfter=Apr 10 00:00:00 2014 GMT