Skip to content

Instantly share code, notes, and snippets.

View suchoudh's full-sized avatar
💭
Applying Technology to real world problems.

Sunil Choudhary suchoudh

💭
Applying Technology to real world problems.
View GitHub Profile
ls * | sort -t . -k 2
t is for separator
k 2 is for sort by second field.
@suchoudh
suchoudh / mv.sh
Created April 14, 2020 03:30 — forked from premek/mv.sh
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
function mv() {
if [ "$#" -ne 1 ]; then
command mv "$@"
return
@suchoudh
suchoudh / pdf2images
Created March 30, 2020 07:44
remove spaces in filenames
for filename in *.pdf ; do pdftoppm -jpeg $filename Social$filename; done
find . -type d -exec touch {}/"${DT}.txt" \;
$DT is variable you have already defined.. my case Date and time
## Does not work for large folder may be taking up softlinks not helpful for me.
This one is more controlled.
for f in *; do if [ -d ${f} ]; then touch $f/_myProgress_$f.txt; fi; done

Keybase proof

I hereby claim:

  • I am suchoudh on github.
  • I am suchoudh (https://keybase.io/suchoudh) on keybase.
  • I have a public key whose fingerprint is CDA9 249A 9E45 E33B A392 7B3A 2226 EE91 5B2F 3CA0

To claim this, I am signing this object:

@suchoudh
suchoudh / test.java
Last active August 11, 2022 16:51
Recursive count of all files with differnt extensions
296 .o
322 .xls
352 .sample
357 .cpp
366 .gif
391 .jar
462 .a
632 .txt
673 .json
832 .js