Posts Tagged With: file

Send One Line From a Text File as as SMS Every 10 Mins

Tagged with: , , , ,

This command will send a line from a given text file one every 10 mins as an SMS to a given number.


i=1; while [ 1 ]; do sms INSERT_PHONE_NUMBER "$(cat "/home/binnyva/sms.txt"|head -n$i|tail -n1)"; sleep 10m; i=$(expr $i + 1); done

Script calls the command ‘sms’ – you can define that command however you want. In my case, its a variation of this script.

2 Comments »

Install Package List

Tagged with: , , , , , ,

Install a list of packages from a text file.


cat packages.txt | xargs apt-get install
No Comments »

Rename Command

Tagged with: , , , ,

Different way to use the rename command.


rename 's/.html$/.php/' *.html
No Comments »

Move files from Folder 2 Levels Deep

Tagged with: , , , , , , , ,

Use this command to move files from folders two level deep to the current folder…


mv */*.* .
1 Comment »

Find Link Files

Tagged with: , , , ,

Use this command to find all the links in the current directory…


find . -lname "*"
No Comments »

Locate Files With Names Matching A Regexp

Tagged with: , , , , , , , , ,

You can use locate to find files with name that matches a said regexp…


locate -i -r '\.jpg$'
No Comments »

Double space a file using Ruby

Tagged with: , , , , , ,

Double space a file with Ruby using the command


ruby -pe 'puts' < file.txt
No Comments »

List Files Provided by Package

Tagged with: , , , , , ,

Show list of files provided by a rpm package installed


rpm -ql package_name
No Comments »

Important Logs

Tagged with: , , , , , , , , ,

First show system events. Second command show events inherent to the process of booting kernel.


tail /var/log/messages
tail /var/log/dmesg
2 Comments »

Use DD to Create File of any Size

Tagged with: , , , , ,

Use the DD command to create a 10 MB (10*1024*1024=10485760 bytes) size file named testfile_10MB


dd if=/dev/zero of=testfile_10MB bs=10485760 count=1

Original Article

4 Comments »