Linux command lines and administration


Mempraktekan tutorial dari Udemy

Linux command lines and administration

Download PuTTY untuk remote SSHs

1. ls

ls atau list directory contents, atau bisa diartikan ls adalah perintah untuk menampilkan isi daftar file dan direktori yang berada di dalam suatu direktori.

Informasi tentang file dan folder akan ditampilkan secara urut berdasarkan abjad jika tidak ada option spesifik -cftuvSUX atau –sort

Dengan perintah ls kita juga bisa melihat atribut apa saja terkait dengan file tersebut.

Contoh Penggunaan perintah ls

ls -lah akan menampilkan daftar panjang, termasuk file yang tersembunyi dan ukuran file yang dapat mudah dibaca dalam satuan KB, MB dan GB.

Opsi ls yang sering digunakan

OptionLong OptionDescription
-a–allMenampilkan semua file, termasuk file yang diawali dengan period (titik), jika dalam normalnya perintah ls tidak menampilkannya (misalnya, file yang tersembunyi).
-A–almost-allSeperti opsi -a, tapi tidak menampilkan . (current directory) dan .. (parent directory).
-d–directoryGunakan opsi ini bersama dengan opsi -l untuk melihat detail tentang direktori, hanya menampilkan daftar tipe direktori
-F–classifyOpsi ini akan menambahkan karakter indikator ke akhir setiap nama yang terdaftar. Misalnya, / jika namanya adalah direktori.
-h–human-readableMenampilkan format ukuran file yang dapat dibaca dengan mudah daripada byte, gunakan bersama dengan -l
-lMenampilkan hasil dalam satu format panjang kebawah
-r–reverseMenampilkan dalam urutan terbalik dari normalnya ls menampilkan urutan abjad a-z
-SUrutkan hasil berdasarkan ukuran file.
-tUrutkan hasil berdasarkan waktu modifikasi

Sumber :

https://idnetter.com/ls/

2. DATE

melihat tanggal

3. fILE sYSTEM

Perintah :

ade@ade _server:$ /var/www# ls

ade@ade _server:$ /var/www# cd /

ade@ade _server:$ # ls

ade@ade _server:$ /# cd bin

ade@ade _server:$ /bin# ls

ade@ade _server:$ /bin# cd /dev

ade@ade _server:$ /dev# ls

ade@ade _server:$ /dev# cd /etc

ade@ade _server:$ /etc# ls

ade@ade _server:$ /etc# cat host.conf

ade@ade _server:$ /etc# vi host.conf

ade@ade _server:$ /etc# vi host

ade@ade _server:$ /etc# vi group

ade@ade _server:$ /etc# cd /lib

ade@ade _server:$ /lib# ls

ade@ade _server:$ /lib# cd modules

ade@ade _server:$ /lib/modules# ls

ade@ade _server:$ /lib/modules# clear

ade@ade _server:$ /lib/modules# clear

ade@ade _server:$ /lib/modules# cd /boot

ade@ade _server:$ /boot# cd /home

ade@ade _server:$ /home# ls

ade@ade _server:$ /home# cd alaa

ade@ade _server:$ /home/alaa# ls

ade@ade _server:$ /home/alaa# cd /mnt

ade@ade _server:$ /mnt# ls

ade@ade _server:$ /mnt# cd /usr

ade@ade _server:$ /usr# cd sbin

ade@ade _server:$ /usr/sbin# ls

ade@ade _server:$ /usr/sbin# cd /var

ade@ade _server:$ /var# ls

ade@ade _server:$ /var# cd www

ade@ade _server:$ /var/www# ls

ade@ade _server:$ /var/www# cd public_html

ade@ade _server:$ /var/www/public_html# ls

6 . FILE command

ade@ade _server:$ /var/www/public_html# ls

ade@ade _server:$ /var/www/public_html# cd jalboosh.com

ade@ade _server:$ /var/www/public_html/ jalboosh.com# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com# cat index.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com# cd /view

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view # cd . ./

ade@ade _server:$ /var/www/public_html/ jalboosh.com# cp index.php view

ade@ade _server:$ /var/www/public_html/ jalboosh.com# cd view

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# file index.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# rm index.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# head newsletter.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# clear

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# less newsletter.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# cat vertical.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# head vertical.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# less vertical.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# more vertical.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# mkdir alaa

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# mv kgPager.php /var/www/public_html/ jalboosh.com

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# cd . . /

ade@ade _server:$ /var/www/public_html/ jalboosh.com/# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/# mv kgPager.php view

ade@ade _server:$ /var/www/public_html/ jalboosh.com/# cd view

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# rmdir alaa

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# clear

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# pwd /var/www/public_html/ jalboosh.com/view

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# touch a.php

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# ls

ade@ade _server:$ /var/www/public_html/ jalboosh.com/view# rm a.php

7. help

ade@ade _server:$ /var/www/public_html# clear

ade@ade _server:$ /var/www/public_html# wget -help

ade@ade _server:$ /var/www/public_html# whatis wget

ade@ade _server:$ /var/www/public_html# whatis date

8. combining commands

ade@ade _server:$ /var/www/public_html# ls

ade@ade _server:$ /var/www/public_html# cd jailboosh.com

ade@ade _server:$ /var/www/public_html/jailboosh.com# ls

ade@ade _server:$ /var/www/public_html/jailboosh.com# cd svn

ade@ade _server:$ /var/www/public_html/svn/jailboosh.com# ls

ade@ade _server:$ /var/www/public_html/svn/jailboosh.com# cd . ./

ade@ade _server:$ /var/www/public_html/jailboosh.com# cd svn && rm uploader.php

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# ls

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# touch alss.txt

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# ls

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# touch hree.txt

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# cd . ./

ade@ade _server:$ /var/www/public_html/jailboosh.com# cd svn && rm alss.txt && cp hree.php . ./

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# touch hree.txt

9. Alias

ade@ade _server:$ /var/www/public_html/jailboosh.com# date

ade@ade _server:$ /var/www/public_html/jailboosh.com # alias tarih=’date’

10. Match

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# touch file.txt;

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# touch file44.txt;

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# touch file34.txt;

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# touch file3.txt;

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# mkdir copied

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# ls

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# cp file* copied

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# cd copied

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn/cd copied# ls

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn/cd copied# rm file*

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn/cd copied# ls

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn/cd copied# cd . ./

ade@ade _server:$ /var/www/public_html/jailboosh.com/svn# ls

11. User

ade@ade _server:$ /# less /etc/passswd

ade@ade _server:$ /# ls

ade@ade _server:$ /# whoami

ade@ade _server:$ /# ls

ade@ade _server:$ /# cd var

ade@ade _server:$ /var# ls

ade@ade _server:$ /var# cd www

ade@ade _server:$ /var/www# ls

ade@ade _server:$ /var/www# cd public_html

ade@ade _server:$ /var/www# cd public_html

ade@ade _server:$ /var/www/public_html# cd 3lany.com

ade@ade _server:$ /var/www# cd public_html/3lany.com# ls – l

ade@ade _server:$ /var/www# cd public_html/3lany.com#

12. apache

ade@ade _server:$ /# apt-get install apache

ade@ade _server:$ /# /etc/init.d/apache2.service.

ade@ade _server:$ /# /etc/init.d/apache2 restart

ade@ade _server:$ /# /etc/init.d/apache2 stop

ade@ade _server:$ /# /etc/init.d/apache2 start

ade@ade _server:$ /# cd /etc

ade@ade _server:$ /etc# ls

ade@ade _server:$ /etc# cd apache2

ade@ade _server:$ /etc/apache2# ls

ade@ade _server:$ /etc/apache2# cd sites-available

ade@ade _server:$ /etc/apache2/sites-available# ls

ade@ade _server:$ /etc/apache2/sites-available# vi etechy.com.conf

ade@ade _server:$ /etc/apache2/sites-available# cd /

ade@ade _server:$ /# apt-get install -y nodejs

ade@ade _server:$ / # nodejs – v

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s