Dzubayyan Ahmad
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Perintah Linux yang Sering Digunakan oleh Sysadmin - Part 1 ###### tags: `Tag(Tulisan Mas Dzub!)` Terkadang beberapa orang selalu mengatakan bahwa Linux adalah sebuah system operasi yang susah. Namun bagi sebagian orang sangatlah mudah dan malah menantang. Selain itu Linux juga seringkali diartikan hanya untuk orang yang sudah ahli atau expert dibidang tersebut. Namun pernyataan tersebut salah, karena linux dapat digunakan oleh siapapun, baik user biasa maupun seorang sysadmin. Dalam artikel ini akan saya bahas mengenai perintah linux yang biasa di gunakan oleh keduanya, baik dari seorang user biasa maupun seorang administrator atau sysadmin. Perintah linux yang dimaksudkan disini adalah sebuah perintah linux yang berbasis CLI(Command Line Interface) yang biasa digunakan untuk memudahkan navigasi, mengoperasikan maupun mencari sebuah system linux yang ada didalamnya. Perintah linux yang membantu sekali dalam banyak hal, apalagi digunakan untuk melakukan troubleshooting, Dan berikut ini adalah beberapa perintah linux yang sering saya sendiri pakai di terminal : **1. Mengecheck IP local pada linux** Untuk melakukan pengecekan IP, Mac address dan lain sebagainya terdapat beberapa cara, yaitu bisa menggunakan perintah `ip` atau `ifconfig` Untuk beberapa distro tidak mengikutkan perintah `ifconfig` namun biasanya dengan menyertakan command `IP` secara bawaan. Untuk contoh dari penggunaan perintah `IP` sebagai berikut : ``` # ip a ``` Dan akan menghasilkan kuranglebih seperti berikut ini : ``` 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 80:c5:f2:5c:a1:2b brd ff:ff:ff:ff:ff:ff inet 10.203.221.186/18 brd 10.203.255.255 scope global dynamic noprefixroute wlp1s0 valid_lft 133sec preferred_lft 133sec inet6 fe80::fcb0:5450:960d:8aea/64 scope link noprefixroute valid_lft forever preferred_lft forever ``` Dan untuk contoh penggunaan dari `ifconfig` sebagai berikut : ``` # ifconfig lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 228 bytes 19578 (19.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 228 bytes 19578 (19.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.203.221.186 netmask 255.255.192.0 broadcast 10.203.255.255 inet6 fe80::fcb0:5450:960d:8aea prefixlen 64 scopeid 0x20<link> ether 80:c5:f2:5c:a1:2b txqueuelen 1000 (Ethernet) RX packets 616930 bytes 745120749 (710.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 255825 bytes 166130844 (158.4 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` **2. Melihat daftar file dengan `ls`** Dalam menggunakan CLI tidak akan muncul sebuah thumbail pada terminal, sehingga terkadang kesulitan untuk melakukan sebuah pencarian file maupun sebuah folder, dengan menggunakan perintah `ls` maka dengan ini akan membuat sebuah list file maupun folder yang ada pada directory tersebut. Untuk cara penggunaan seperti berikut ini : ``` ❰masdzub❙~❱✔≻ ls aaa Desktop/ Music/ Templates/ ansibl Documents/ Pictures/ Videos/ 'ansible rapidplex'/ Downloads/ Postman/ xiaomi.eu_multi_HMNote8_20.8.13_v12-10.zip 'ansible rapidplex.zip' __MACOSX/ Public/ ``` Dan untuk menampilkan file maupun folder yang tersembunyi dapat menambahkan option `-a`, dan seperti ini contohnya : ``` ❰masdzub❙~❱✔≻ ls -a ./ .bashrc .gnupg/ Postman/ ../ .cache/ .gtkrc-2.0 Public/ aaa .config/ .gtkrc-2.0-kde4 .ssh/ ansibl Desktop/ .icons/ Templates/ .ansible/ .digrc .kde/ .thunderbird/ .ansible.cfg Documents/ .local/ Videos/ 'ansible rapidplex'/ Downloads/ __MACOSX/ .viminfo 'ansible rapidplex.zip' .esd_auth .mozilla/ .wget-hsts .bash_history .face Music/ .Xauthority .bash_logout .face.icon@ Pictures/ xiaomi.eu_multi_HMNote8_20.8.13_v12-10.zip .bash_profile .gitconfig .pki/ .xsession-errors ``` Dan untuk menampilakn file secara baris dan lebih detail dapat menambahkan option `-l`, dan seperti berikut unntuk contohnya : ``` ❰masdzub❙~❱✔≻ ls -l total 2179768 -rw-r--r--. 1 masdzub masdzub 73 Aug 18 11:39 aaa -rw-r--r--. 1 masdzub masdzub 19424 Jul 30 01:05 ansibl drwxr-xr-x. 3 masdzub masdzub 4096 Aug 9 20:41 'ansible rapidplex'/ -rw-r--r--. 1 masdzub masdzub 1831 Jul 30 00:12 'ansible rapidplex.zip' drwxr-xr-x. 2 masdzub masdzub 4096 Jul 28 05:45 Desktop/ drwxr-xr-x. 2 masdzub masdzub 4096 Jul 28 05:45 Documents/ drwxr-xr-x. 3 masdzub masdzub 4096 Aug 16 15:57 Downloads/ drwxrwxr-x. 3 masdzub masdzub 4096 Jul 30 00:12 __MACOSX/ drwxr-xr-x. 2 masdzub masdzub 4096 Jul 28 05:45 Music/ drwxr-xr-x. 2 masdzub masdzub 4096 Aug 18 09:35 Pictures/ drwxr-xr-x. 4 masdzub masdzub 4096 Aug 9 20:09 Postman/ drwxr-xr-x. 2 masdzub masdzub 4096 Jul 28 05:45 Public/ drwxr-xr-x. 2 masdzub masdzub 4096 Jul 28 05:45 Templates/ drwxr-xr-x. 2 masdzub masdzub 4096 Jul 28 05:45 Videos/ ``` Teman-teman sebuah bisa mengkombinasikan antara kedua option tersebut menjadi option `-la`. Untuk hasilnya seperti campuran dari keduanya. **3. Melihat penggunaan Disk dengan `df`** Untuk mengecheck disk pada linux dengan CLI salah satunya yang populer dan sering digunakan oleh orang dengan menggunakan `df`. Dan untuk perinnya contohnya seperti berikut ini : ``` ❰masdzub❙~❱✔≻ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 3.6G 0 3.6G 0% /dev tmpfs 3.7G 135M 3.5G 4% /dev/shm tmpfs 3.7G 1.6M 3.7G 1% /run /dev/sda8 39G 7.5G 29G 21% / tmpfs 3.7G 156K 3.7G 1% /tmp /dev/sda7 500M 21M 480M 5% /boot/efi /dev/sdb1 396G 7.9G 368G 3% /home tmpfs 740M 44K 740M 1% /run/user/1000 ``` Dan jika ingin melakukan pengecekan pada spesifik mountpoint semisal `/` dapat menjalankan seperti berikut ini : ``` ❰masdzub❙~❱✔≻ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 3.6G 0 3.6G 0% /dev tmpfs 3.7G 135M 3.5G 4% /dev/shm tmpfs 3.7G 1.6M 3.7G 1% /run /dev/sda8 39G 7.5G 29G 21% / tmpfs 3.7G 156K 3.7G 1% /tmp /dev/sda7 500M 21M 480M 5% /boot/efi /dev/sdb1 396G 7.9G 368G 3% /home tmpfs 740M 44K 740M 1% /run/user/1000 ``` Dan jika ingin melakukan pengecekan inodes bisa menjalankan seperti berikut ini : ``` ❰masdzub❙~❱✔≻ df -hi Filesystem Inodes IUsed IFree IUse% Mounted on devtmpfs 920K 605 919K 1% /dev tmpfs 925K 898 925K 1% /dev/shm tmpfs 925K 1.1K 924K 1% /run /dev/sda8 2.5M 210K 2.3M 9% / tmpfs 925K 50 925K 1% /tmp /dev/sda7 0 0 0 - /boot/efi /dev/sdb1 26M 145K 26M 1% /home tmpfs 925K 51 925K 1% /run/user/1000 ``` **4. Melihat penggunaan RAM** Untuk melakukan pengecekan penggunaan ram pada linux bisa menggunakan perintah `free` pada linux dengan menggunakan beberapa option. Untuk hal yang seringkali dipakai adalah `free -m`, Untuk contoh penggunaan seperti berikut ini : ``` ❰masdzub❙~❱✔≻ free -m total used free shared buff/cache available Mem: 7399 2366 2385 167 2647 4585 Swap: 8191 0 8191 ``` Dan jika ingin menampilkan yang mudah dibaca dengan menambahkan option `-h`. dan akan menjadi kurang lebih seperti berikut ini : ``` ❰masdzub❙~❱✔≻ free -mh total used free shared buff/cache available Mem: 7.2Gi 2.2Gi 2.5Gi 167Mi 2.6Gi 4.6Gi Swap: 8.0Gi 0B 8.0Gi ``` **5. Menampilkan prosess dengan akar berakar seperti `tree`** Untuk menampilkan processnya bisa menggunakan `pstree` dan jika ingin menambahkan PID pada process bisa menambahkan `-p` untuk optionnya. Untuk contohnya seperti berikut ini : ``` ❰masdzub❙~❱✔≻ pstree systemd─┬─ModemManager───3*[{ModemManager}] ├─NetworkManager───2*[{NetworkManager}] ├─abrt-applet───3*[{abrt-applet}] ├─abrt-dbus───2*[{abrt-dbus}] ├─3*[abrt-dump-journ] ├─abrtd───2*[{abrtd}] ├─accounts-daemon───3*[{accounts-daemon}] ├─agent───2*[{agent}] ... ├─systemd-homed ├─systemd-journal ├─systemd-logind ├─systemd-udevd ├─systemd-userdbd───3*[systemd-userwor] ├─udisksd───4*[{udisksd}] ├─upowerd───2*[{upowerd}] ├─wpa_supplicant └─xembedsniproxy───2*[{xembedsniproxy}] ``` Dan jika ingin menampilkan PID nya bisa juga menggunakan option `-p`, dan kurang lebih seperti ini : ``` masdzub❙~❱✔≻ pstree -p systemd(1)─┬─ModemManager(608)─┬─{ModemManager}(624) │ ├─{ModemManager}(629) │ └─{ModemManager}(667) ├─NetworkManager(721)─┬─{NetworkManager}(730) │ ├─{NetworkManager}(732) │ └─{NetworkManager}(24160) ├─abrt-applet(1114)─┬─{abrt-applet}(1148) │ ├─{abrt-applet}(1149) │ └─{abrt-applet}(1207) ├─abrt-dbus(1178)─┬─{abrt-dbus}(1193) │ └─{abrt-dbus}(1196) ├─abrt-dump-journ(678) ... │ └─{pcscd}(2916) ├─plasmashell(1088)─┬─chrome(2784)─┬─cat(2790) │ │ ├─cat(2791) │ │ ├─chrome(2794)─┬─chrome(2818)─┬─{chrome}(2833) │ │ │ │ ├─{chrome}(2834) │ │ │ │ ├─{chrome}(2835) │ │ │ │ ├─{chrome}(2836) │ │ │ │ ├─{chrome}(2837) │ │ │ │ ├─{chrome}(2838) │ │ │ │ ├─{chrome}(2839) │ │ │ │ ├─{chrome}(2842) │ │ │ │ ├─{chrome}(2843) │ │ │ │ ├─{chrome}(2844) │ │ │ │ ├─{chrome}(2845) ... ├─udisksd(633)─┬─{udisksd}(640) │ ├─{udisksd}(670) │ ├─{udisksd}(694) │ └─{udisksd}(709) ├─upowerd(634)─┬─{upowerd}(666) │ └─{upowerd}(675) ├─wpa_supplicant(771) └─xembedsniproxy(1090)─┬─{xembedsniproxy}(1103) └─{xembedsniproxy}(1116) ``` ## Kesimpulan Untuk perintah linux yang biasa digunakan oleh sysadmin part 1 sudah selesai, dan sangat mudah kan untuk menggunakannya ? Sehingga dari pengguna baru pun juga tidak mengalami kesulitan selama mengetahui dari fungsinya. Dan sampai jumpa di artikel yang lain.

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully