Review Materi Management File dan Linux File Permissions

Halo kawan-kawan semua, disini saya akan berbagi materi mengenai Management File dan Linux File Permissions, semoga bermanfaat :).

Manajemen File dan Direktori di Linux

Perintah  Linux dasar untuk memanipulasi file dan direktori, antara lain:

a. Melihat daftar konten direktori

Untuk melihat nama direktori dimana anda sedang berada, command yang digunakan adalah pwd. jika anda ingin melihat isi direktori , maka ketikan command ls. Jika yang anda ingin menampilkan daftar direktori dengan format panjang, maka ketikan ls-al.

Contoh :

$ ls -al

total 24

drwxrwxr-x. 2 user group 4096 2009-08-11 21:21 .

drwx——   . 35 user group 4096 2009-08-12 10:55 ..

Kolom pertama menunjukan jenis file dan perizinan, kolom kedua menunjukan jumlah link, kolom ketiga menunjukan pemilik file, dan kolom ke empat menunjukan kelompok pemilik file. Kolom lain untuk menunjukan ukuran file.

Karakter pertama menunjukkan :

  • d = directory
  • –  = regular file
  • l = symbolic link
  • s = Unix domain socket
  • p = named pipe
  • c = character device file
  • b = block device file

9 karakter berikutnya menyatakan perizinan. Dibagi menjadi 3 grup, tiap grup 3 karakter mewakili: read, write, dan execute. Karakter tersebut mudah untuk diingat, diantaranya :

  • r = read permission
  • w = write permission
  • x = execute permission
  • –  = no permission

b. Menyalin, memindahkan, atau menghapus file dan direktori

  • cp->           Untuk menyalin file atau copy.

Misalnya untuk menyalin file1 menjadi file2: $ cp <file1> <file2>

  • mv

Untuk memindahkan file dari satu lokasi ke lokasi yang lain. Bila argumen yang kedua berupa sebuah direktori maka mv akan memindahkan file ke direktori tersebut.

  • rm

Untuk menghapus file dan secara default rm tidak menghapus direktori. Gunakan secara hati-hati perintah ini terutama dengan option -r yang secara rekursif dapat mengapus seluruh file.

Ada beberapa pilihan yang berguna untuk perintah cp dan mv:

  • -f atau –force àMemungkinkan cp untuk mencoba menghapus file yang sudah ada walaupun file tidak dapat ditulis.
  • -i atau –interactive àAkan meminta konfirmasi sebelum mencoba untuk mengganti file yang ada.
  • -b atau –backup àAkan membuat cadangan dari file yang akan diganti

c. Manipulasi banyak file dan direktori secara rekursif

Menghapus file atau direktori secara rekursif

Jika terdapat banyak file atau direktori yang ingin kita hapus, kita bisa menggunakan perintah rm dengan tambahan -r (atau -R atau –recursive)

$ rm -r d1

 d. Menggunakan perintah find untuk mencari berdasarkan file

  • find

Untuk menemukan dimana letak sebuah file. Perintah ini akan mencari file sesuai dengan kriteria yang Anda tentukan. Sintaksnya adalah perintah itu sendiri diikuti dengan nama direktori awal pencarian, kemudian nama file (bisa menggunakan wildcard, metacharacters) dan terakhir menentukan bagaimana hasil pencarian itu akan ditampilkan.

e. Kompresi dan dekompresi file menggunakan gzip dan bzip2

  • gzip

Ini adalah software kompresi zip versi GNU, fungsinya untuk mengkompresi sebuah file. Sintaksnya sangat sederhana:  $ gzip <namafile> . Tambahkan -d untuk dekompresi , $ gzip -d <namafile>.gz

  • bzip2

Untuk  mengkompresi file :  $ bzip2 <namafile>, sedangkan untuk dekompresi file $ bunzip2 <namafile>.bz2

Berikut daftar command dasar manajemen file :

Capture

Linux File Permission  

Sistem Operasi Linux bekerja secara multiuser. Untuk mencegah terjadinya akses-akses ilegal terhadap file yang dimiliki oleh user tertentu, maka pada linux dibuat status izin akses file dimana setiap file memiliki informasi untuk mengatur siapa saja yang berhak untuk membaca, menjalankan atau mengubah file tersebut. Ketika sebuah file atau direktori dibuat, maka file atau direktori tersebut kepemilikikannya akan melekat pada suatu user dan group tertentu. Hak akses tersebut menjamin tidak semua user dapat mengakses file dan direktori secara bebas.

Secara garis besar file permission dibagi menjadi tiga yaitu:

  • User
  • Group
  • Other

Setiap file atau folder di system file memiliki tiga atribut yaitu owner, group, dan mode. Owner adalah id dari user pemilik file atau folder tersebut. Group adalah gid dari grup dimana user pemilik file atau folder tersebut terdaftar. Mode adalah sederetan angka 0 dan 1 untuk menyatakan flags akses terhadap suatu file atau folder.

Dalam Linux ada 3 Hak Akses atau perizinan File dan Direktori, yaitu :

  • r untuk read

Berkas  dapat ditampilkan/dibuka isi direktori dari ditampilkan

  • w untuk write

Berkas dapat disunting atau dihapus isi direktori dari dimodifikasi

  • x untuk execute

Berkas eksekusi dapat dijalankan sebagai program direktori dapat dimasuki file management.

Berikut merupakan penjelasan dari properti sebuah file
m
Untuk melihat sebuah permission settings sebuah file gunakan perintah berikut ini :

1 -rw-rw-r– 1 user user 5 2011-10-02 12:03 nama_file

2 -rw-rw-r– 1 user user 5 2011-10-02 12:03 nama_file

Kita dapat mendefinisikan dari properti dari hasil perintah di atas :

  • file “nama_file” merupakan sebuah file milik user
  • user memiliki hak akses untuk membaca dan menulis / mengedit file
  • file ini juga merupakan milik dari group user
  • anggota dari group user juga dapat membaca dan mengedit file ini
  • selain user dan gruop hanya bisa membaca dan tidak dapat melakukan editing terhadap file ini.

chmod
perintah chmod digunakan untuk mengubah properti sebuah file atau folder, untuk menggunakan kita harus memastikan secara tepat setting file permission yang akan diberikan. ada 2 cara untuk melakukan settingan file permision :

  • Modus Symbolic

modus symbolic ini cukup mudah diingat. karena dapat menentukan hak akses untuk user (u), group (g), others (o) dan untuk ketiganya (a). kemudian dapat menambahkan permission (+), hapus permission (-), atau menghapus hak akses sebelumnya dan menambahkan yang baru (=). berikutnya untuk permission read (r), perizinan write (w), dan untuk execute (x).Contoh untuk menghapus semua permission tapi menambahkan read untuk semuanya:

1 user@kpli_palu:~$chmod a=r nama_file

2 user@kpli_palu:~$ls -l nama_file

3 -r–r–r– 1 user user 5 2011-10-02 12:03 nama_file

Contoh untuk menambahkan execute permission untuk group :

1 user@kpli_palu:~$chmod g+x nama_file

2 user@kpli_palu:~$ls -l nama_file

3 -r–r-xr– 1 user user 5 2011-10-02 12:03 nama_file

Contoh untuk menambahkan write dan execute permission secara bersamaan untuk user:

1 user@kpli_palu:~$chmod u+wx nama_file

2 user@kpli_palu:~$ls -l nama_file

3 -rwxr-xr– 1 user user 5 2011-10-02 12:03 nama_file

  • Modus Numeric

Modus  lain dimana chmod bisa digunakan ialah dengan modus numerik. dalam modus numeric ini permission file bukanlah huruf, melainkan tiga digit oktal.

4 = read (r)
2 = write (w)
1 = execute (x)
0 = no permission (-)

Untuk menambahkan permission, kita tinggal menambahkan angka yang sesuai dengan angka yang di atas. sebagai contoh, hak akses rwx maka 4+2+1 = 7, rx maka 4+1 = 5 dan rw maka 4+2 = 6. untuk pengaturan user, group, dan others, tinggal menomorkan tiga digit yang mewakili hak akses kelompok.contoh menambahkan read dan write pada user dan read pada group :

1 user@kpli_palu:~$chmod 640 nama_file

2 user@kpli_palu:~$ls -l nama_file

3 -rw-r—– 1 user user 5 2011-10-02 12:03 nama_file

  • Contoh menambahkan read,write dan execute pada user sedangkan group dan others hanya bisa read dan execute :

1 user@kpli_palu:~$chmod 755 nama_file

2 user@kpli_palu:~$ls -l nama_file

3 -rwxr-xr-x 1 wawan wawan 5 2011-10-02 12:03 nama_file

  • Keterangan modus numberic :

0 = —
1 = –x
2 = -w-
3 = -wx
4 = r–
5 = r-x
6 = rw-
7 = rwx

Referensi :

http://pemula.linux.or.id/pengguna/command.html

http://palu.linux.or.id/2013/02/permission-file-linux/#more-226

http://syntaxerror.web.id/perintah-dasar-linux.htm

Modul Praktikum Sistem Operasi  Materi Manajemen File dan Direktori , UPI
Modul Praktikum Sistem Operasi  Materi Linux File Permission , UPI

2,491 thoughts on “Review Materi Management File dan Linux File Permissions

      • It’s OK trustpharmacy.org The case of Gheorge, the Romanian immigrant, is also instructive. He immigrated to the United States in 1989. By the time Horowitz met him, he had built a database-marketing firm and a predictive-analytics firm, both later acquired; worked as chief technology officer at software company SAP; and served as an entrepreneur in residence at white-shoe venture firm Greylock.

        • It’s a bad line vigora 50 details “(The heads of state) ask (the force) to proceed with theimmediate disarmament and removal, voluntarily or by force, ofall foreign armed elements,” read a statement issued at the endof a regional summit in Chad’s capital, N’Djamena.

        • perfect design thanks fast shiiping on cialis “We plan to raise at least 70 billion baht ($2.25 billion) from the fund and sell noncore businesses for about 5 billionbaht. Most of the proceeds will be used to repay debt,” ChiefFinancial Officer Noppadol Dej-Udom said, adding that thelisting should be completed by the end of this year.

          • How much does the job pay? cheap prednisone When I arrived in Sleepy Hollow, I followed the signs to the center of town and figured I’d give Google Glass another try. This time, instead of asking for directions, I used the voice command to find nearby restaurants. Jackpot! I was actually surprised at how well the voice recognition software worked. I didn’t have to repeat myself and Glass gave me a list of choices within a few miles from where I was standing.

        • I’d like to take the job where to buy metformin uk They also ran the model with specified sea-surface temperature, but they held rising greenhouse gases to 1990 levels with no additional variations to the data. Under these conditions, the ups and downs in temperatures over time closely tracked the ups and downs in tropical eastern Pacific sea-surface temperatures – illustrating fairly tight control the eastern tropical Pacific holds over the climate system in the absence of rising greenhouse-gas levels.

          • This site is crazy 🙂 where to buy erythromycin eye ointment An Associated Press estimate of the train’s speed at the moment of impact using the time stamp of the video and the estimated distance between two pylons gives a range of 144-192 kph (89-119 mph). Another estimate calculated on the basis of the typical distance between railroad ties gives a range of 156-182 kph (96-112 mph).

          • Your account’s overdrawn order generic zithromax online no prescription The ousted president has been held at an undisclosed location and has not been charged with a crime, although the authorities have announced investigations into complaints of spying, inciting violence and wrecking the economy. Prosecutors have also reopened a 2011 jailbreaking case dating to Mursi’s escape from brief detention during protests against Mubarak.

          • Some First Class stamps vigora 50 mg price in india
            “It is not a full instrument landing. You have to visually fly into that runway. Sometimes it takes nuance to land there. You have to realize that hill is there or you could come in too low,” Hiatt told Reuters.

          • I love this site pristiq lawsuit canada Apple reported that it had sold $8.8bn (£5.8bn) of goods in China over the January-to-March quarter, with iPhones sold from its 11 stores in the country in addition to 19,000 other third-party retailers.

          • Your account’s overdrawn buy online kamagra pharmacy from japan McConaughey’s recent run of acclaimed, full-throttle turns in left-field indies (Mud, Killer Joe, Magic Mike) has finally culminated here in a role that Oscar voters will be powerless to keep off their shortlist. It feels at once crisply tailored to McConaughey’s established gifts, and unlike anything we’ve seen him do before. His air of physical decrepitude is totally convincing, but it’s the fear in his acting that counts – the film’s most striking effect is watching this legendarily blasé star face up to mortality.

          • A few months canadian pharmacy cialis brand The radical rigt wing cracked teanuts don’t really care about Obamacare because it will help the vast majority of people, and that means nothing to them. All these freaks care about is trying to defeat anything that Obama proposes.

          • Where’s the nearest cash machine? manfaat novamox 500 amoxicillin RB Matthew Tucker – Showed some potential in training camp and preseason but didn’t earn a roster spot. He’s a good practice squad candidate. I only saw the Eagles keeping three RBs but keeping one on the PS will mean they have 4 in practice.

      • Some First Class stamps paxil for sale online Each one-step INES increase represents a 10-fold increase inseverity, according to a factsheet on the IAEA website.(www.iaea.org/) A Level 3 rating is assigned when there isexposure of more than 10 times the limit for workers, accordingto the factsheet.

    • I sing in a choir buy retin a cream uk Of all the vulnerable Democratic Senate incumbents, Pryor has, arguably, distanced himself from President Obama the most, but it might not be enough to beat Cotton, who remains very popular in a state with thousands of active-duty military members.

        • Wonderfull great site viagra doc morris Collins though doesn’t want it to. He knows that the two errors the Mets committed behind Wheeler on the afternoon were largely a result of balls that were unluckily hit into a blinding sun. Second baseman Daniel Murphy lost one in the second inning, while right fielder Marlon Byrd lost two in the doomed fifth.

          • I came here to work testimonials on cialis That being said, if Belichick had any idea that Hernandez was capable of having such a dark side, he never would have drafted him. As much work and money as teams put into finding out everything they possibly can about a player before investing a dollar in him, it’s still hard to project how they will conduct themselves off the field, despite the incessant warnings and education the teams and the league provide.

    • I’ve been made redundant purmedica While calling the posting of the Social Security numbers “reckless,” Malamud said the IRS does make it clear that Social Security numbers should not be submitted on forms that will be put online and available for “public inspection.”

      • Free medical insurance generic viagra reviews canada GlobalPost health reporting fellow Harman Boparai travels to India, where he was once a physician, to take a deeper look at child health in his home country. This story is focused on twin girls born in India's Panna District, which has one of the nation's highest child mortality rates.

      • Have you got any ? eunisses hernandez la defensa
        The House would vote on food stamps before openingnegotiations with the Senate, probably in September, on a finalversion of the farm bill. Senate Agriculture chairwoman DebbieStabenow, Democrat of Michigan, said time was running short toenact a bill before the current law expires on Sept. 30.

      • I enjoy travelling anxiclear reviews
        Former colleagues said Fry, who joined Twitter earlier thisyear, fits the bill. The messaging service poached him fromsoftware giant Salesforce.com Inc, where Fry had workedin various positions since 2005, rising from engineering managerin the Web Services team to senior VP of development.

    • What’s the current interest rate for personal loans? sildenafil tablet fiyat&#305 Well, according to our system of jurisprudence, Zimmerman was found not guilty by a jury of his peers. Now Mr. President, we have all heard yo are a Constitutional Scholar, although you have yet to prove it, but that’s our system. You should really focus on running the country instead of running your mouth about 1 out of THOUSANDS of senseless deaths in the US annualy.

      • I’m doing a masters in law cephalexin mg Ciganda found a hazard with her second shot, incurring a penalty. After a lengthy discussion between officials, the Spaniard was wrongly allowed to take her fourth shot from a long way behind the correct spot.

      • I’m about to run out of credit discount card for evista The support of all of Alitalia’s domestic investors for thecapital increase is also uncertain. Its second biggestshareholder, the Riva family, has had its assets seized in ajudicial investigation, including its 11 percent stake inAlitalia.

        • Another service? combivent coupons Locket, which launched on Thursday for Android phones, turns the front of your phone into a billboard. You put in your age, gender and location and it feeds you relevant ads. Every time you swipe to see more information about the ad the company will pay you one penny.

      • I’m on holiday buy lisinopril canada “Yesterday was the biggest game of the season, today is the biggest game of the season, tomorrow will be the biggest game of the season. I don’t think it’s unfair to say that. We realize the performance we have to put together out there every night, and I think we’re up for it.”

    • I’m in a band viagra gel sachets uk Ryan said the whole team takes those predictions personally, and at least one Jet proved to be doing so on Thursday. “We just have to start winning, we have to shut our mouths, we have to grow closer as a team and we have to be as hard-nosed as we can be,” guard Willie Colon said. “I’m pretty sure a lot of teams already have us checked off on their schedule. That’s the bottom line. We have to show up on Sunday and punch a lot of people in the mouth and wake them up.”

    • I live in London generic name for propranolol “I think it makes it real,” Sarah Norris, the conservator for the Texas State Library and Archives Commission said of Connally’s clothing. “You can read about it and you can think about it, but to actually be in the room with it certainly gives you pause.”