About UsContact Us

The job posting issue has been fixed, sorry for inconvenience caused.

You can now post jobs without registering, however, all job posts will subject to review before publishing.

 

CMCommunity Team

 


Users: If you have a Gmail account, you do not need to register; you may login using your full Gmail account username and password.

Home Article Index UNIX Tips Useful UNIX Commands
English French German Italian Portuguese Russian Spanish

Member Login

Welcome
Users: If you have a Gmail account,you can use full GMail emaill address as user id and your GMail password.

If you do not wish to use GMail account, please register a new CMCommunity account.



Related Items

Statistics

Members : 21880
Content : 785
Web Links : 8
Content View Hits : 638292

Stats: Our Visitors

Top 10:
Russian Federation flag 21%Russian Federation
United States flag 18%United States
Unknown flag 17%Unknown
Ukraine flag 9%Ukraine
Latvia flag 5%Latvia
Germany flag 5%Germany
Netherlands flag 3%Netherlands
United Kingdom flag 3%United Kingdom
Japan flag 2%Japan
Luxembourg flag 2%Luxembourg
Visits from 145 countries
| Online Users: 8  |
Hello Guest! If you wish to submit any contents, please login or register.
Useful UNIX Commands PDF Print E-mail
Monday, 09 November 2009 20:28

 

Check disk space usage and sort by size

du -ksl * | sort -nr

 

Remove recursively all files with wiliecard on AIX

find /home/pvcs/cassad/a \( -name '*.txt' \) -exec \rm {} \;

 

For example to find file in last 2 months (60 days) you need to use -mtime +60 option.

* -mtime +60 means you are looking for a file modified 60 days ago.

* -mtime -60 means less than 60 days.

* -mtime 60 If you skip + or - it means exactly 60 days.


Find text files that were last modified 60 days ago, use

$ find /home/you -iname "*.txt" -mtime -60 -print

 

Display content of file on screen that were last modified 60 days ago, use

$ find /kunden/homepages/htdocs -iname "*.txt" -mtime -2 -exec cat {} \;

 

Count total number of files using wc command

$ find /home/you -iname "*.txt" -mtime -60 | wc -l

 

You can also use access time to find out pdf files. Following command will print the list of all pdf file that were accessed in last 60 days:

$ find /home/you -iname "*.pdf" -atime -60 -type -f

 

List all mp3s that were accessed exactly 10 days ago:

$ find /home/you -iname "*.mp3" -atime 10 -type -f

 

There is also an option called -daystart. It measure times from the beginning of today rather than from 24 hours ago. So, to list the all mp3s in your home directory that were accessed yesterday, type the command

$ find /home/you -iname "*.mp3" -daystart -type f -mtime 1

 

REMOVE ^M CHARACTERS

using VI Editor USE : %s/.$// command in vi editor to delete ^M characters)

For example, ^C is represented by ?\003?, and ^M is represented by ?\015?.

Use the following command to remove ^M characters:

tr -d "\015" newfile

Example: tr ?d ?\015? goodfile.txt

 

 

Last Updated on Monday, 09 November 2009 20:34