The Home of C&P Software on the Web

Home
Blogs
About us
Why Choose Us?
What Are People saying?
OneClickAway PC Support
Professional Profile
Free Software here!!!
Contact Us
Privacy Notice
Useful Links
NLP

Cool One-Liners

Here are some interesting one-line solutions for common linux/unix scripting problems:

  1. Convert a dos file to a unix file:
         - 'tr -d '\r' < dosfile > unixfile'
  2. Install opnssh server on ubuntu 7.04 (Feisty Fawn)
         - 'sudo apt-get install openssh-server'
  3. expire a user's password so they must change it at the next logon
         - 'chage -d 0 <username>'
  4. Delete a file type recursively
        -  'find . -type f -name "*.bak" -exec rm -f {} \;'
  5. Clean up files in a directory. This will delete files in the '/your_directory that are older than 7 days.
        -  'find /your_directory -mtime +7 -exec rm {}\;'
  6. This creates a file "/somedir/somefile" 3Gb in size
        -  'dd if=/dev/zero of=/somedir/somefile bs=1000k count=3000'