Thursday, March 27, 2014

perintah dasar linux dalam struktur dan detail refrence

networkFun : 

perintah linux terkadang membuat sebagian orang bingung akan fungsi dan cara pakainya , dalam systemnya perintah linux ini mempunyai struktur yang telah di tentukan dengan di sorting bisa dengn mudah kita menghapal sesuai dengan kebutuhan nya 

anda bisa download katalognya disini


$ uname –a                       => menampilakan system linux yang di gunakan
$ uname –r                       => menampilkan informasi kernel (refer uname command in detail)
$ cat /etc/redhat_release        => menampilkan version of redhat installed 
$ uptime                         => menampilakan berapa lama system running + load (learn uptime command)
$ hostname                       => menampilkan system host name
$ hostname -i                    => menunjunjukan ip adress host  (all options hostname)
$ last reboot                    => menampilkan system reboot history (more examples last command)
$ date                           => menampilkan tanggal dan waktu sekarang (options of date command)
$ cal                            => menampilkan kalender bulan (what more in cal)
$ w                              => menampilakan siapa yang online (learn more about w command)
$ whoami                         => sebagai apa kamu masuk/ login (example + sreenshots)
$ finger user                    => inforamsi tentang user  (many options of finger command)

2. file

$ dmesg                          => deteksi hardware dan pesan booting(dmesg many more options)
$ cat /proc/cpuinfo              => CPU model
$ cat /proc/meminfo              => Hardware memory
$ cat /proc/interrupts           => Lists the number of interrupts per CPU per I/O device
$ lshw                           => menampilkan informasi konfigurasi sistem hardware 
$ lsblk                          => menampilkan block device related information in Linux (sudo yum install util-linux-ng)
$ free -m                        => Used and free memory (-m for MB) (free command in detail)
$ lspci -tv                      => menapilkan PCI devices (very useful to find vendor ids)
$ lsusb -tv                      => menapilkan USB devices (read more lsusb options)$ lshal                          => menapilkan a list of all devices with their properties $ dmidecode                      => menapilkan info hardware dari BIOS (vendor details)$ hdparm -i /dev/sda           # menapilkan info tentnag disk sda $ hdparm -tT /dev/sda          # memebaca speed tes disk SDA
$ badblocks -s /dev/sda          # Test for unreadable blocks on disk sda

3. statistic

$ top                              => menampilakan service yang sedang berjalan di CPU  (30 example options)
$ mpstat 1                         => Display processors related statistics (learn mpstat command)
$ vmstat 2                         => Display virtual memory statistics (very useful performance tool)
$ iostat 2                         => Display I/O statistics (2sec Intervals) (more examples)
$ tail -n 500 /var/log/messages    => Last 10 kernel/syslog messages (everyday use tail options)
$ tcpdump -i eth1                  => Capture all packets flows on interface eth1 (useful to sort network issue)
$ tcpdump -i eth0 'port 80'        => Monitor all traffic on port 80 ( HTTP )
$ lsof                             => List all open files belonging to all active processes.(sysadmin favorite command)
$ lsof -u testuser                 => List files opened by specific user
$ free –m                          => Show amount of RAM (daily usage command)
$ watch df –h                      => Watch changeable data continuously(interesting linux command)

4. User 

$ id                                  => menapilkan id user yang aktif data login$ last                                => menampilkan user yang terakhir login (few more examples)
$ who                                 => menampilkan siapa yang login(real user who logged in)
$ groupadd   admin                    => Add group "admin" (force add existing group)
$ useradd -c  "Sam Tomshi" -g admin -m sam  => Create user "sam" and add to group "admin"(here read all parameter)
$ userdel sam                         => Delete user sam (force,file removal)
$ adduser sam                         => Add user "sam" 
$ usermod                             => Modify user information(mostly useful for linux system admins)

5. file command

$ ls –al                                => menampilakan seluruh informasi tentnag file / direktoeri(20 examples)
$ pwd                                   => Show current directory path(simple but need every day)
$ mkdir directory-name                  => membuat folder (create mutiple directory)
$ rm file-name                          => hapus file(be careful of using rm command)
$ rm -r directory-name                  => hapus directory recursively 
$ rm -f file-name                       => Forcefully  hapus file
$ rm -rf directory-name                 => Forcefully hapus directory recursively
$ cp file1 file2                        => Copy file1 to file2 (15 cd command examples)
$ cp -r dir1 dir2                       => Copy dir1 to dir2, create dir2 if it doesn’t  exist
$ mv file1 file2                        => memindahkan files dari file 1 ke file2(with 10 examples)
$ ln –s  /path/to/file-name  link-name  => membuat symbolic link to file-name (examples)
$ touch file                            => Create or update file (timestamp change)
$ cat > file                            => Place standard input into file (15 cat command examples)
$ more file                             => Output the contents of file (help display long tail files)
$ head file                             => Output the first 10 lines of file (with different parameters)
$ tail file                             => Output the last 10 lines of file (detailed article with tail options)
$ tail -f file                          => Output the contents of file as it grows starting with the last 10 lines
$ gpg -c file                           => Encrypt file (how to use gpg)
$ gpg file.gpg                          => Decrypt file

6. procces related

$ ps                               # Display your currently active processes (many parameters to learn)
$ ps aux | grep 'telnet'           # Find all process id related to telnet process
$ pmap                             # Memory map of process (kernel,user memory etc)
$ top                              # Display all running processes (30 examples)
$ kill pid                         # Kill process with mentioned pid id (types of signals)
$ killall proc                     # Kill all processes named proc
$ pkill processname                # Send signal to a process with its name
$ bg                               # Lists stopped or background jobs (bg and fg command)
$ fg                               # Brings the most recent job to foreground
$ fg n                             # Brings job n to the foreground


$ chmod octal file-name     # Change the permissions of file to octal , which can be found separately for user, group and world
octal value  (more examples)
4 - read
2 – write
1 – execute
$ chmod 777 /data/test.c                   # Set rwx permission for owner , rwx  permission for group, rwx permission for world
$ chmod 755 /data/test.c                   # Set rwx permission for owner,rw for group and world
$ chown owner-user file                    # Change owner of the file (chown more examples)
$ chown owner-user:owner-group  file-name  # Change owner and group owner of the file
$ chown owner-user:owner-group directory   # Change owner and group owner of the directory
$ chown bobbin:linoxide test.txt
$ ls -l test.txt
-rw-r--r-- 1 bobbin linoxide 0 Mar 04 08:56 test.txt


$ ifconfig –a                  # Display all network ports and ip address (set mtu and other all options)
$ ifconfig eth0                # Display specific  ethernet port ip address and details
$ ip addr show                 # Display all network interfaces and ip address(available in iproute2 package,powerful than ifconfig)
$ ip address add dev eth0      # Set ip address
$ ethtool eth0                 # Linux tool to show ethernet status (set full duplex , pause parameter)
$ mii-tool  eth0               # Linux tool to show  ethernet status (more or like ethtool)
$ ping host                    # Send echo request to test connection (learn sing enhanced ping tool)
$ whois domain                 # Get who is information for domain
$ dig domain                   # Get DNS information for domain (screenshots with other available parameters)
$ dig  -x host                 # Reverse lookup host 
$ host              # Lookup DNS ip address for the name (8 examples of host command)
$ hostname –i                  # Lookup local ip address (set hostname too)
$ wget file                    # Download file (very useful other option)
$ netstat  -tupl               # Listing all active listening ports(tcp,udp,pid) (13 examples)


$ tar cf home.tar  home              # Create tar named home.tar containing home/ (11 tar examples)
$ tar xf file.tar                    # Extract the files from file.tar
$ tar czf  file.tar.gz  files        # Create a tar with gzip compression
$ gzip file                          # Compress file and renames it to file.gz (untar gzip file)


$ rpm -i pkgname.rpm                         # Install rpm based package (Installing, Uninstalling, Updating, Querying ,Verifying)
$ rpm -e pkgname                             # Remove package
Install from source
make install (what it is)


$ ssh user@host                         # Connect to host as user (secure data communication command)
$ ssh  -p port user@host                # Connect to host using specific port
$ telnet host                           # Connect to the system using  telnet port


$ scp file.txt   server2:/tmp                   # Secure copy file.txt to remote host  /tmp folder
$ scp nixsavy@server2:/www/*.html   /www/tmp    # Copy *.html files from remote host to current system /www/tmp folder
$ scp -r nixsavy@server2:/www   /www/tmp        # Copy all files and folders recursively from remote server to the current system /www/tmp folder
$ rsync -a /home/apps /backup/                  # Synchronize source to destination
$ rsync -avz /home/apps linoxide@    # Synchronize files/directories between the local and remote system with compression enabled


$ df –h                         # Show free space on mounted filesystems(commonly used command)
$ df -i                         # Show free inodes on mounted filesystems
$ fdisk -l                 # Show disks partitions sizes and types(fdisk command output)
$ du -ah                        # Display disk usage in human readable form (command variations)
$ du -sh                        # Display total disk usage on the current directory
$ findmnt                        # Displays target mount point for all filesystem 
$ mount device-path mount-point  # Mount a device 

15. Directory Traverse

$ cd ..                              # To go up one level of the directory tree(simple & most needed)
$ cd                              # Go to $HOME directory
$ cd /test                           # Change to /test directory
- See more at:


Custom Search