PERINTAH DASAR LINUX File & Directory Command man [nama perintah] apropos [suatu yang berhubungan dengan perintah] ls mkdir [nama direktori] cd [/direktori/lokasi] cp [nama file atau direktori] [ke direktori atau nama file] cp -r rm [nama file atau direktori] rm -Rf rmdir mv [nama file atau direktori] locate [nama file atau direktori] cat [nama file] more [nama file] less [nama file] pipeline/vertical bar clear [nama file] which [nama file] Command # cd /home # cd .. # cd ../.. # cd # cd ~user1 # cd # cp file1 file2 # cp dir/* .
Description melihat manual perintah mencari perintah berdasarkan suatu Melihat daftar direktori Membuat direktori Mengubah lokasi direktori Menyalin file/Direktori akan menyalin setiap file dalam direktori yang Anda tentukan. Menghapus file/Direktori akan menghapus setiap direktori yang Anda tentukan. menghapus direktori Ganti Name file/Direktori Mencari file/Direktori melihat isi file melihat isi file layar per layar melihat isi file baris per baris menggabungkan dua perintah membersihkan terminal menjalankan file mencari file
Description enter to directory '/ home' go back one level go back two levels go to home directory go to home directory go to previous directory copying a file copy all files of a directory within the current work
directory copy a directory within the current work directory copy a directory outputs the mime type of the file as text lists known encodings
# cp -a /tmp/dir1 . # cp -a dir1 dir2 # cp file file1 # iconv -l # iconv -f fromEncoding -t toEncoding inputFile > outputFile
converting the coding of characters from one format to another
# find . -maxdepth 1 -name *.jpg -print -exec convert # ln -s file1 lnk1 # ln file1 lnk1 # ls # ls -F # ls -l # ls -a # ls *[0-9]* # lstree # mkdir dir1 # mkdir dir1 dir2 # mkdir -p /tmp/dir1/dir2 # mv dir1 new_dir # pwd # rm -f file1 # rm -rf dir1 # rm -rf dir1 dir2 # rmdir dir1 # touch -t 0712250000 file1 # tree
batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick) create a symbolic link to file or directory create a physical link to file or directory view files of directory view files of directory show details of files and directory show hidden files show files and directory containing numbers show files and directories in a tree starting from root(2) create a directory called 'dir1' create two directories simultaneously create a directory tree rename / move a file or directory show the path of work directory delete file called 'file1' remove a directory called 'dir1' and contents recursively remove two directories and their contents recursively delete directory called 'dir1' modify timestamp of a file or directory - (YYMMDDhhmm) show files and directories in a tree starting from root(1)
Penyuntingan Text Perintah untuk penyuntingan text pada terminal : Command wc [nama file] sort [nama file] grep [text dicari] [nama
Description menghitung baris, kata, karakter dalam file mensortir urutan isi file berdasarkan karakter mencari text dalam suatu file
file] nano [nama file] pico [nama file] vi [nama file] vim [nama file] mcedit [nama file]
membuat file txt baru pakai editor nano membuat file txt baru pakai editor pico membuat file txt baru pakai editor vi membuat file txt baru pakai editor vim membuat file txt baru pakai editor mcedit
cat [nama file] [pipeline] print file lpr
User dan Group Cara text pada terminal, dalam kondisi administrasi superuser (sudo su), administrasi user : Command useradd [nama user] passwd [nama user] chmod 755 [nama file atau dirctory] chgrp [nama grup] [nama file] chown [user] [nama file]
Description menambah user mengganti pasword user mengubah mode user file mnjadi 755 (rwx-rx-r-x) mengubah grup file mengubah user pemilik file
Administrasi Proses Perintah administrasi pada terminal yaitu: Command Description alias [nama pengganti]=[nama mengubah nama file jadi pengganti file] unalias [nama penganti] mengembalikan alias memaksa suspend proses file agar berjalan di bg [nama file] background fg [nama file] mengembalikan proses file berjalan di foreground find [nama file] mencari lokasi file login sementara sebagai superuser atau root (ubuntu sudo -s dan debian) login sementara sebagai superuser atau root (ubuntu sudo su dan debian) login sementara sebagai superuser atau root (semua su linux) startx menjalankan X-Window bila dalam kondisi single mode hostname menampilkan nama host dari mesin
Manajemen proses Command ps ax kill [signal] [pid] top dmesg tail [namafile] df du free uname -a ifconfig iwconfig
Description melihat seluruh proses yang berjalan, ax = all perintah menghentikan proses PID (nomor proses) melihat aktifitas proses melihat 10 proses terakhir melihat proses tertentu melihat pembagian partisi harddsik melihat volume disk yang digunakan melihat disk yang kosong melihat informasi sistem, arsitektur mesin, kernel sistem operasi digunakan, versi, dan detail lain melihat semua interface network (antarmuka jaringan) melihat inteface jaringan nirkabel (wireless LAN)
System information Command # arch # cal 2007 # cat /proc/cpuinfo # cat /proc/interrupts # cat /proc/meminfo # cat /proc/swaps # cat /proc/version # cat /proc/net/dev # cat /proc/mounts # clock -w # date # date 041217002007.00
Description show architecture of machine(1) show the timetable of 2007 show information CPU info show interrupts verify memory use show file(s) swap show version of the kernel show network adpters and statistics show mounted file system(s) save date changes on BIOS show system date set date and time MonthDayhoursMinutesYear.Seconds show hardware system components - (SMBIOS / # dmidecode -q DMI) # hdparm -i /dev/hda displays the characteristics of a hard-disk # hdparm -tT /dev/sda perform test reading on a hard-disk # lspci -tv display PCI devices
# lsusb -tv # uname -m # uname -r
show USB devices show architecture of machine(2) show used kernel version
Shutdown, Restart and Logout of a system Command # init 0 # logout # reboot # shutdown -h now # shutdown -h 16:30 & # shutdown -c # shutdown -r now # telinit 0
Description shutdown system(2) leaving session reboot(2) shutdown system(1) planned shutdown of the system at 16:30 cancel a planned shutdown of the system reboot(1) shutdown system(3)