Ticker

6/recent/ticker-posts

Ad Code

Responsive Advertisement

Unix Commands by Pranay Tiwari

List the files under the directories

 find . -type f -printf "%T@ %p\n" | sort -nr | cut -d\  -f2-


How to Create file in Unix Directory

cat > file1.txt


How to copy output in unix to out file 

SomeCommand > file1.txt 

Or if you want to append data:

SomeCommand >> file1.txt

How to find file count in each folder sub folder in unix


find . -type d -print0 | while read -d '' -r dir; do
files=("$dir"/*)
printf "%5d files in directory %s\n" "${#files[@]}" "$dir"
done


Enregistrer un commentaire

0 Commentaires