Jun 09

1 To get hard disk information.
hdparm -I /dev/sda

2 Search and replace option in vi.
:%s/old/new/g

3 To make an icon.
convert -size 900×120 xc:black -font Times-Roman -pointsize 100 -fill green -annotate +20+80 ‘Linux is the Best’ -fill green -annotate +25+90 ‘Linux is the Best’ -trim +repage logo1.png

4 To replace one word with another with the backup of the original one.
sed -ibackup s/orange/grapes/g sedd

5 To search for a particular word and delete it.
find / -name aaa* -delete

6 To delete the last 30 days files. For files before 30 days +30.
find /root/wallpapers/ -mtime -30 | xargs /bin/rm -f

7 Command to dump partitions, directory etc..
dump -0aj -f /back/mydump /dev/sda2

8 Command to restore the dumped partition.
restore -rf mydump /back

9 To convert all jpeg files in the current directory to avi.
mencoder “mf://*.jpg” -mf fps=1 -o outputs.avi -ovc lavc -lavcopts vcodec=mpeg4

10 To convert avi to mpeg-2
mencoder /root/ItalianJob.avi -mf fps=1 -o /opt/ItalianJob.mpg -ovc lavc -oac pcm -lavcopts vcodec=mpeg2video

11 To convert mpg to avi.
mencoder /editor/Seval.mpg -ovc xvid -oac mp3lame -xvidencopts bitrate=800 -o /opt/Seval.avi

12 To delete lines 23-47 using vim or vi.
:23,47 d

13 Command to display the installed fonts.
fc-list

14 To check the CD/DVD drive/eject.
fuser /media/cdrom [eject]/[eject -p]

15 To kill the process.
fuser -k /media/cdrom

16 Find all files that have the .exe extension in the current directory.
find . -name \*.exe

17 Lists all of the files in the queue, as well as the user, the job number, the size and the root directories from which the print jobs originate.
lpq

18 To free memory when memory is in short.
memhog 500m

19 Cron to shutdown machine.
55 23 * * * /sbin/shutdown -h now

20 To password protect a zip file.
zip -e -r /root/Desktop/new /root/Desktop/old

21 To delete all hidden files from current directory.
rm -rf .*

22 Extracting files to a specific directory
unzip Commonly\ Used\ Malayalam\ Fonts.zip -d /usr/share/X11/fonts/TTF/ -(Sorry! I’m a Malayali)

23 To format CD-RW
cdrecord blank=fast dev=1,0,0

24 To stop all process except your shell.
kill 0

25 To disable usb in linux, eg. fedora 8.
mv /lib/modules/2.6.23.1-42.fc8/kernel/drivers/usb/storage/usb-storage.ko /opt/

written by admin


19 Responses to “25 Useful Linux Commands”

  1. 1. Binny V A Says:

    Nice collection. Here is my command collection. Btw, the first comment in this post is spam.

  2. 2. imvezolb Says:

    D8Fvz0 bvkximzvscvj, [url=http://ykdkvoriyrjs.com/]ykdkvoriyrjs[/url], [link=http://jznycyzrodmg.com/]jznycyzrodmg[/link], http://vosbicxemekr.com/

  3. 3. lhcephqy Says:

    CoB4Hp gtvkjayadlql, [url=http://gdhtpswshhka.com/]gdhtpswshhka[/url], [link=http://edufuwwonzvs.com/]edufuwwonzvs[/link], http://euajbkvjdspa.com/

  4. 4. fqqeaodfnnc Says:

    l7qQJ7 mqluavxrdkuk, [url=http://kmgjqsyjmxpc.com/]kmgjqsyjmxpc[/url], [link=http://mhynwwbbsodr.com/]mhynwwbbsodr[/link], http://bnqtposvoevo.com/

  5. 5. martina Says:

    life insurance quotes %[ home insurance 205237 cheap life insurance %-]]] cheap health insurance >:P

  6. 6. lubov Says:

    cheap car insurance 8DDD life insurance quotes 8-(( cheap auto insurance quotes %O life insurance 8[

  7. 7. orthoticworks Says:

    life insurance quotes 8-(( cheap home insurance %-( life insurance 6799

  8. 8. replace Says:

    cheap auto insurance %-]] homeowners insurance :[[[ life insurance mreopo

  9. 9. broedtekst Says:

    health insurance quotes uftm cheap auto insurance aknf homeowners insurance >:-[ life quotes usczio

  10. 10. stephen Says:

    xanax online najlfn prednisone vrijv pain pill ultram 509186 discount cialis 225373 cialis 058

  11. 11. antonina Says:

    discount viagra 835 ultram >:OOO buy xanax =(( buy cialis =))

  12. 12. forrest Says:

    discount xanax 72206 ultram :-]] depakote 01823 phentermine no prescription 1024

  13. 13. cognent Says:

    tramadol hci hjdrh cialis :-) ) tramadol hcl-acetaminophen jsgkxc buy cialis viagra :-]]] cialis jrkezt

  14. 14. chorten Says:

    viagra 8-DD xanax without a prescription 60126 buy viagra hzn buy depakote erbw cialis qqv

  15. 15. diego Says:

    buy 150 tramadol :-O xanax inyq valium %O tramadol agaqml

  16. 16. picrorhiza Says:

    in home health care insurance neukba slots 57909 cheap auto insurance 8-)) health insurance coverage %(( life insurance quotes 8-[[ buy car insurance online 090

  17. 17. fat loss Says:

    I was wondering this myself, Great comment #3

  18. 18. Victoria Beckham hair extensions Says:

    I was wondering this myself, Great comment #3

  19. 19. how much should i weigh Says:

    hey whats your myspace page.

Leave a Reply