OpenVPN client connects to server. But no internet. Nevertheless I can ping from terminal 8.8.8.8 unless i open any web page in browser. After opening any web page i can not also ping Google Public DNS.
I have Ubuntu 18.04.
We have tried also public openvpn configs. They also do not work from Ubuntu. But same config works nicely from Mac.
What could be the issue? Bellow i have posted logs:
vlad#vlad-ThinkPad:~/keys/vpn$ sudo openvpn --config vladv.ovpn
Thu Mar 14 15:52:01 2019 us=645618 Current Parameter Settings:
Thu Mar 14 15:52:01 2019 us=645644 config = 'vladv.ovpn'
Thu Mar 14 15:52:01 2019 us=645649 mode = 0
Thu Mar 14 15:52:01 2019 us=645652 persist_config = DISABLED
Thu Mar 14 15:52:01 2019 us=645656 persist_mode = 1
Thu Mar 14 15:52:01 2019 us=645659 show_ciphers = DISABLED
Thu Mar 14 15:52:01 2019 us=645663 show_digests = DISABLED
Thu Mar 14 15:52:01 2019 us=645666 show_engines = DISABLED
Thu Mar 14 15:52:01 2019 us=645669 genkey = DISABLED
Thu Mar 14 15:52:01 2019 us=645672 key_pass_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645676 show_tls_ciphers = DISABLED
Thu Mar 14 15:52:01 2019 us=645680 connect_retry_max = 0
Thu Mar 14 15:52:01 2019 us=645687 Connection profiles [0]:
Thu Mar 14 15:52:01 2019 us=645691 proto = udp
Thu Mar 14 15:52:01 2019 us=645695 local = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645699 local_port = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645703 remote = '52.204.183.105'
Thu Mar 14 15:52:01 2019 us=645707 remote_port = '1194'
Thu Mar 14 15:52:01 2019 us=645737 remote_float = DISABLED
Thu Mar 14 15:52:01 2019 us=645741 bind_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=645745 bind_local = DISABLED
Thu Mar 14 15:52:01 2019 us=645750 bind_ipv6_only = DISABLED
Thu Mar 14 15:52:01 2019 us=645754 connect_retry_seconds = 5
Thu Mar 14 15:52:01 2019 us=645757 connect_timeout = 120
Thu Mar 14 15:52:01 2019 us=645774 socks_proxy_server = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645778 socks_proxy_port = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645801 tun_mtu = 1500
Thu Mar 14 15:52:01 2019 us=645806 tun_mtu_defined = ENABLED
Thu Mar 14 15:52:01 2019 us=645810 link_mtu = 1500
Thu Mar 14 15:52:01 2019 us=645815 link_mtu_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=645819 tun_mtu_extra = 0
Thu Mar 14 15:52:01 2019 us=645823 tun_mtu_extra_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=645827 mtu_discover_type = -1
Thu Mar 14 15:52:01 2019 us=645831 fragment = 0
Thu Mar 14 15:52:01 2019 us=645835 mssfix = 1450
Thu Mar 14 15:52:01 2019 us=645839 explicit_exit_notification = 0
Thu Mar 14 15:52:01 2019 us=645844 Connection profiles END
Thu Mar 14 15:52:01 2019 us=645848 remote_random = DISABLED
Thu Mar 14 15:52:01 2019 us=645852 ipchange = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645856 dev = 'tun'
Thu Mar 14 15:52:01 2019 us=645860 dev_type = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645864 dev_node = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645868 lladdr = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645872 topology = 1
Thu Mar 14 15:52:01 2019 us=645876 ifconfig_local = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645880 ifconfig_remote_netmask = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645884 ifconfig_noexec = DISABLED
Thu Mar 14 15:52:01 2019 us=645888 ifconfig_nowarn = DISABLED
Thu Mar 14 15:52:01 2019 us=645893 ifconfig_ipv6_local = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645897 ifconfig_ipv6_netbits = 0
Thu Mar 14 15:52:01 2019 us=645901 ifconfig_ipv6_remote = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645905 shaper = 0
Thu Mar 14 15:52:01 2019 us=645910 mtu_test = 0
Thu Mar 14 15:52:01 2019 us=645914 mlock = DISABLED
Thu Mar 14 15:52:01 2019 us=645918 keepalive_ping = 0
Thu Mar 14 15:52:01 2019 us=645922 keepalive_timeout = 0
Thu Mar 14 15:52:01 2019 us=645926 inactivity_timeout = 0
Thu Mar 14 15:52:01 2019 us=645930 ping_send_timeout = 0
Thu Mar 14 15:52:01 2019 us=645934 ping_rec_timeout = 0
Thu Mar 14 15:52:01 2019 us=645938 ping_rec_timeout_action = 0
Thu Mar 14 15:52:01 2019 us=645942 ping_timer_remote = DISABLED
Thu Mar 14 15:52:01 2019 us=645946 remap_sigusr1 = 0
Thu Mar 14 15:52:01 2019 us=645950 persist_tun = ENABLED
Thu Mar 14 15:52:01 2019 us=645954 persist_local_ip = DISABLED
Thu Mar 14 15:52:01 2019 us=645958 persist_remote_ip = DISABLED
Thu Mar 14 15:52:01 2019 us=645962 persist_key = ENABLED
Thu Mar 14 15:52:01 2019 us=645967 passtos = DISABLED
Thu Mar 14 15:52:01 2019 us=645971 resolve_retry_seconds = 1000000000
Thu Mar 14 15:52:01 2019 us=645975 resolve_in_advance = DISABLED
Thu Mar 14 15:52:01 2019 us=645979 username = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645983 groupname = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645987 chroot_dir = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645991 cd_dir = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645995 writepid = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=645999 up_script = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646003 down_script = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646007 down_pre = DISABLED
Thu Mar 14 15:52:01 2019 us=646011 up_restart = DISABLED
Thu Mar 14 15:52:01 2019 us=646015 up_delay = DISABLED
Thu Mar 14 15:52:01 2019 us=646019 daemon = DISABLED
Thu Mar 14 15:52:01 2019 us=646023 inetd = 0
Thu Mar 14 15:52:01 2019 us=646027 log = DISABLED
Thu Mar 14 15:52:01 2019 us=646031 suppress_timestamps = DISABLED
Thu Mar 14 15:52:01 2019 us=646035 machine_readable_output = DISABLED
Thu Mar 14 15:52:01 2019 us=646039 nice = 0
Thu Mar 14 15:52:01 2019 us=646043 verbosity = 4
Thu Mar 14 15:52:01 2019 us=646047 mute = 0
Thu Mar 14 15:52:01 2019 us=646051 gremlin = 0
Thu Mar 14 15:52:01 2019 us=646055 status_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646059 status_file_version = 1
Thu Mar 14 15:52:01 2019 us=646063 status_file_update_freq = 60
Thu Mar 14 15:52:01 2019 us=646067 occ = ENABLED
Thu Mar 14 15:52:01 2019 us=646071 rcvbuf = 0
Thu Mar 14 15:52:01 2019 us=646075 sndbuf = 0
Thu Mar 14 15:52:01 2019 us=646079 mark = 0
Thu Mar 14 15:52:01 2019 us=646083 sockflags = 0
Thu Mar 14 15:52:01 2019 us=646087 fast_io = DISABLED
Thu Mar 14 15:52:01 2019 us=646091 comp.alg = 0
Thu Mar 14 15:52:01 2019 us=646095 comp.flags = 0
Thu Mar 14 15:52:01 2019 us=646099 route_script = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646103 route_default_gateway = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646107 route_default_metric = 0
Thu Mar 14 15:52:01 2019 us=646112 route_noexec = DISABLED
Thu Mar 14 15:52:01 2019 us=646116 route_delay = 0
Thu Mar 14 15:52:01 2019 us=646120 route_delay_window = 30
Thu Mar 14 15:52:01 2019 us=646124 route_delay_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=646128 route_nopull = DISABLED
Thu Mar 14 15:52:01 2019 us=646131 route_gateway_via_dhcp = DISABLED
Thu Mar 14 15:52:01 2019 us=646135 allow_pull_fqdn = DISABLED
Thu Mar 14 15:52:01 2019 us=646139 management_addr = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646144 management_port = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646148 management_user_pass = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646152 management_log_history_cache = 250
Thu Mar 14 15:52:01 2019 us=646156 management_echo_buffer_size = 100
Thu Mar 14 15:52:01 2019 us=646160 management_write_peer_info_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646164 management_client_user = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646168 management_client_group = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646173 management_flags = 0
Thu Mar 14 15:52:01 2019 us=646177 shared_secret_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646181 key_direction = 0
Thu Mar 14 15:52:01 2019 us=646185 ciphername = 'AES-128-GCM'
Thu Mar 14 15:52:01 2019 us=646189 ncp_enabled = ENABLED
Thu Mar 14 15:52:01 2019 us=646193 ncp_ciphers = 'AES-256-GCM:AES-128-GCM'
Thu Mar 14 15:52:01 2019 us=646198 authname = 'SHA256'
Thu Mar 14 15:52:01 2019 us=646202 prng_hash = 'SHA1'
Thu Mar 14 15:52:01 2019 us=646206 prng_nonce_secret_len = 16
Thu Mar 14 15:52:01 2019 us=646210 keysize = 0
Thu Mar 14 15:52:01 2019 us=646214 engine = DISABLED
Thu Mar 14 15:52:01 2019 us=646218 replay = ENABLED
Thu Mar 14 15:52:01 2019 us=646222 mute_replay_warnings = DISABLED
Thu Mar 14 15:52:01 2019 us=646226 replay_window = 64
Thu Mar 14 15:52:01 2019 us=646230 replay_time = 15
Thu Mar 14 15:52:01 2019 us=646235 packet_id_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646239 use_iv = ENABLED
Thu Mar 14 15:52:01 2019 us=646243 test_crypto = DISABLED
Thu Mar 14 15:52:01 2019 us=646247 tls_server = DISABLED
Thu Mar 14 15:52:01 2019 us=646251 tls_client = ENABLED
Thu Mar 14 15:52:01 2019 us=646255 key_method = 2
Thu Mar 14 15:52:01 2019 us=646259 ca_file = '[[INLINE]]'
Thu Mar 14 15:52:01 2019 us=646263 ca_path = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646267 dh_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646272 cert_file = '[[INLINE]]'
Thu Mar 14 15:52:01 2019 us=646276 extra_certs_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646280 priv_key_file = '[[INLINE]]'
Thu Mar 14 15:52:01 2019 us=646284 pkcs12_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646288 cipher_list = 'TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256'
Thu Mar 14 15:52:01 2019 us=646292 tls_verify = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646297 tls_export_cert = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646301 verify_x509_type = 2
Thu Mar 14 15:52:01 2019 us=646305 verify_x509_name = 'server_MFHCkWn6oZwnN5iF'
Thu Mar 14 15:52:01 2019 us=646309 crl_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646313 ns_cert_type = 0
Thu Mar 14 15:52:01 2019 us=646317 remote_cert_ku[i] = 65535
Thu Mar 14 15:52:01 2019 us=646321 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646326 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646330 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646334 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646338 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646342 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646346 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646350 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646354 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646358 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646362 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646366 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646370 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646374 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646378 remote_cert_ku[i] = 0
Thu Mar 14 15:52:01 2019 us=646382 remote_cert_eku = 'TLS Web Server Authentication'
Thu Mar 14 15:52:01 2019 us=646387 ssl_flags = 192
Thu Mar 14 15:52:01 2019 us=646391 tls_timeout = 2
Thu Mar 14 15:52:01 2019 us=646395 renegotiate_bytes = -1
Thu Mar 14 15:52:01 2019 us=646399 renegotiate_packets = 0
Thu Mar 14 15:52:01 2019 us=646403 renegotiate_seconds = 3600
Thu Mar 14 15:52:01 2019 us=646407 handshake_window = 60
Thu Mar 14 15:52:01 2019 us=646411 transition_window = 3600
Thu Mar 14 15:52:01 2019 us=646415 single_session = DISABLED
Thu Mar 14 15:52:01 2019 us=646420 push_peer_info = DISABLED
Thu Mar 14 15:52:01 2019 us=646424 tls_exit = DISABLED
Thu Mar 14 15:52:01 2019 us=646428 tls_auth_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646432 tls_crypt_file = '[[INLINE]]'
Thu Mar 14 15:52:01 2019 us=646436 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646440 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646444 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646448 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646453 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646457 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646461 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646465 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646469 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646473 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646477 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646481 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646485 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646490 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646494 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646498 pkcs11_protected_authentication = DISABLED
Thu Mar 14 15:52:01 2019 us=646502 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646507 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646511 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646515 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646519 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646523 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646527 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646531 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646535 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646539 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646543 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646547 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646551 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646555 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646559 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646563 pkcs11_private_mode = 00000000
Thu Mar 14 15:52:01 2019 us=646567 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646571 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646575 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646579 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646583 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646587 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646592 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646596 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646600 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646604 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646608 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646612 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646616 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646620 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646624 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646628 pkcs11_cert_private = DISABLED
Thu Mar 14 15:52:01 2019 us=646632 pkcs11_pin_cache_period = -1
Thu Mar 14 15:52:01 2019 us=646636 pkcs11_id = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646640 pkcs11_id_management = DISABLED
Thu Mar 14 15:52:01 2019 us=646647 server_network = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646653 server_netmask = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646657 server_network_ipv6 = ::
Thu Mar 14 15:52:01 2019 us=646661 server_netbits_ipv6 = 0
Thu Mar 14 15:52:01 2019 us=646666 server_bridge_ip = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646670 server_bridge_netmask = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646675 server_bridge_pool_start = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646679 server_bridge_pool_end = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646683 ifconfig_pool_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=646688 ifconfig_pool_start = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646692 ifconfig_pool_end = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646697 ifconfig_pool_netmask = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646701 ifconfig_pool_persist_filename = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646705 ifconfig_pool_persist_refresh_freq = 600
Thu Mar 14 15:52:01 2019 us=646709 ifconfig_ipv6_pool_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=646714 ifconfig_ipv6_pool_base = ::
Thu Mar 14 15:52:01 2019 us=646718 ifconfig_ipv6_pool_netbits = 0
Thu Mar 14 15:52:01 2019 us=646723 n_bcast_buf = 256
Thu Mar 14 15:52:01 2019 us=646727 tcp_queue_limit = 64
Thu Mar 14 15:52:01 2019 us=646732 real_hash_size = 256
Thu Mar 14 15:52:01 2019 us=646738 virtual_hash_size = 256
Thu Mar 14 15:52:01 2019 us=646743 client_connect_script = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646750 learn_address_script = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646757 client_disconnect_script = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646763 client_config_dir = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646770 ccd_exclusive = DISABLED
Thu Mar 14 15:52:01 2019 us=646776 tmp_dir = '/tmp'
Thu Mar 14 15:52:01 2019 us=646782 push_ifconfig_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=646789 push_ifconfig_local = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646796 push_ifconfig_remote_netmask = 0.0.0.0
Thu Mar 14 15:52:01 2019 us=646802 push_ifconfig_ipv6_defined = DISABLED
Thu Mar 14 15:52:01 2019 us=646809 push_ifconfig_ipv6_local = ::/0
Thu Mar 14 15:52:01 2019 us=646815 push_ifconfig_ipv6_remote = ::
Thu Mar 14 15:52:01 2019 us=646822 enable_c2c = DISABLED
Thu Mar 14 15:52:01 2019 us=646828 duplicate_cn = DISABLED
Thu Mar 14 15:52:01 2019 us=646834 cf_max = 0
Thu Mar 14 15:52:01 2019 us=646840 cf_per = 0
Thu Mar 14 15:52:01 2019 us=646846 max_clients = 1024
Thu Mar 14 15:52:01 2019 us=646852 max_routes_per_client = 256
Thu Mar 14 15:52:01 2019 us=646859 auth_user_pass_verify_script = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646866 auth_user_pass_verify_script_via_file = DISABLED
Thu Mar 14 15:52:01 2019 us=646873 auth_token_generate = DISABLED
Thu Mar 14 15:52:01 2019 us=646879 auth_token_lifetime = 0
Thu Mar 14 15:52:01 2019 us=646885 port_share_host = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646890 port_share_port = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646894 client = ENABLED
Thu Mar 14 15:52:01 2019 us=646898 pull = ENABLED
Thu Mar 14 15:52:01 2019 us=646902 auth_user_pass_file = '[UNDEF]'
Thu Mar 14 15:52:01 2019 us=646908 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep 5 2018
Thu Mar 14 15:52:01 2019 us=646916 library versions: OpenSSL 1.1.0g 2 Nov 2017, LZO 2.08
Thu Mar 14 15:52:01 2019 us=647323 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Thu Mar 14 15:52:01 2019 us=647338 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Mar 14 15:52:01 2019 us=647344 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Thu Mar 14 15:52:01 2019 us=647351 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Mar 14 15:52:01 2019 us=647400 Control Channel MTU parms [ L:1621 D:1156 EF:94 EB:0 ET:0 EL:3 ]
Thu Mar 14 15:52:01 2019 us=647415 Data Channel MTU parms [ L:1621 D:1450 EF:121 EB:406 ET:0 EL:3 ]
Thu Mar 14 15:52:01 2019 us=647428 Local Options String (VER=V4): 'V4,dev-type tun,link-mtu 1549,tun-mtu 1500,proto UDPv4,cipher AES-128-GCM,auth [null-digest],keysize 128,key-method 2,tls-client'
Thu Mar 14 15:52:01 2019 us=647432 Expected Remote Options String (VER=V4): 'V4,dev-type tun,link-mtu 1549,tun-mtu 1500,proto UDPv4,cipher AES-128-GCM,auth [null-digest],keysize 128,key-method 2,tls-server'
Thu Mar 14 15:52:01 2019 us=647440 TCP/UDP: Preserving recently used remote address: [AF_INET]52.204.183.105:1194
Thu Mar 14 15:52:01 2019 us=647453 Socket Buffers: R=[212992->212992] S=[212992->212992]
Thu Mar 14 15:52:01 2019 us=647458 UDP link local: (not bound)
Thu Mar 14 15:52:01 2019 us=647463 UDP link remote: [AF_INET]52.204.183.105:1194
Thu Mar 14 15:52:01 2019 us=767926 TLS: Initial packet from [AF_INET]52.204.183.105:1194, sid=7d35d5a3 0dd6547d
Thu Mar 14 15:52:01 2019 us=941133 VERIFY OK: depth=1, CN=cn_Sr53cvp1BEzBy5Xw
Thu Mar 14 15:52:01 2019 us=941839 VERIFY KU OK
Thu Mar 14 15:52:01 2019 us=941883 Validating certificate extended key usage
Thu Mar 14 15:52:01 2019 us=941915 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Thu Mar 14 15:52:01 2019 us=941942 VERIFY EKU OK
Thu Mar 14 15:52:01 2019 us=941966 VERIFY X509NAME OK: CN=server_MFHCkWn6oZwnN5iF
Thu Mar 14 15:52:01 2019 us=941991 VERIFY OK: depth=0, CN=server_MFHCkWn6oZwnN5iF
Thu Mar 14 15:52:02 2019 us=350393 Control Channel: TLSv1.2, cipher TLSv1.2 ECDHE-ECDSA-AES128-GCM-SHA256, 256 bit EC, curve: prime256v1
Thu Mar 14 15:52:02 2019 us=350479 [server_MFHCkWn6oZwnN5iF] Peer Connection Initiated with [AF_INET]52.204.183.105:1194
Thu Mar 14 15:52:03 2019 us=487988 SENT CONTROL [server_MFHCkWn6oZwnN5iF]: 'PUSH_REQUEST' (status=1)
Thu Mar 14 15:52:03 2019 us=686005 PUSH: Received control message: 'PUSH_REPLY,dhcp-option DNS 172.31.0.2,redirect-gateway def1 bypass-dhcp,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 120,ifconfig 10.8.0.3 255.255.255.0,peer-id 0,cipher AES-128-GCM'
Thu Mar 14 15:52:03 2019 us=686251 OPTIONS IMPORT: timers and/or timeouts modified
Thu Mar 14 15:52:03 2019 us=686285 OPTIONS IMPORT: --ifconfig/up options modified
Thu Mar 14 15:52:03 2019 us=686301 OPTIONS IMPORT: route options modified
Thu Mar 14 15:52:03 2019 us=686317 OPTIONS IMPORT: route-related options modified
Thu Mar 14 15:52:03 2019 us=686331 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Thu Mar 14 15:52:03 2019 us=686351 OPTIONS IMPORT: peer-id set
Thu Mar 14 15:52:03 2019 us=686371 OPTIONS IMPORT: adjusting link_mtu to 1624
Thu Mar 14 15:52:03 2019 us=686388 OPTIONS IMPORT: data channel crypto options modified
Thu Mar 14 15:52:03 2019 us=686424 Data Channel MTU parms [ L:1552 D:1450 EF:52 EB:406 ET:0 EL:3 ]
Thu Mar 14 15:52:03 2019 us=686622 Outgoing Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
Thu Mar 14 15:52:03 2019 us=686650 Incoming Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
Thu Mar 14 15:52:03 2019 us=686896 ROUTE_GATEWAY 10.1.1.0/255.255.252.0 IFACE=wlp3s0 HWADDR=00:28:f8:68:b4:2e
Thu Mar 14 15:52:03 2019 us=687498 TUN/TAP device tun0 opened
Thu Mar 14 15:52:03 2019 us=687626 TUN/TAP TX queue length set to 100
Thu Mar 14 15:52:03 2019 us=687681 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Thu Mar 14 15:52:03 2019 us=687738 /sbin/ip link set dev tun0 up mtu 1500
Thu Mar 14 15:52:03 2019 us=690849 /sbin/ip addr add dev tun0 10.8.0.3/24 broadcast 10.8.0.255
Thu Mar 14 15:52:03 2019 us=693274 /sbin/ip route add 52.204.183.105/32 via 10.1.1.0
Thu Mar 14 15:52:03 2019 us=694206 /sbin/ip route add 0.0.0.0/1 via 10.8.0.1
Thu Mar 14 15:52:03 2019 us=695281 /sbin/ip route add 128.0.0.0/1 via 10.8.0.1
Thu Mar 14 15:52:03 2019 us=697189 Initialization Sequence Completed
I was facing a similar issue and the below solution helped me.
Open the below file using the following command
sudo vim /etc/resolvconf/resolv.conf.d/head
And, at the end add the below two lines and save exit the file:-
nameserver 208.67.222.222
nameserver 208.67.220.220
and then run the below command:-
sudo resolvconf -u
I hope this helps!!
Related
Dataset:
[1] Wed sun Sat fri mon sun sun Wed Wed sun sun Wed Sat Sat fri thu thu Wed Wed mon sun thu thu
[24] Wed fri thu Wed Sat thu sun sun sun sun Sat sun sun Wed tue sun sun Sat fri Wed mon mon sun
Need a function which returns how many times days come exactly 1,5,10 times.
Outcome should be tabled like:
1 5 10
0 1 1
Thought about yousing tapply and use a new Vector as index like:
count<- c(1,10,15)
Try using the base R table function:
days <- read.table(text="Wed sun Sat fri mon sun sun Wed Wed sun sun Wed Sat Sat fri thu thu Wed Wed mon sun thu thu Wed fri thu Wed Sat thu sun sun sun sun Sat sun sun Wed tue sun sun Sat fri Wed mon mon sun", sep = " ")
table(t(days))
#fri mon Sat sun thu tue Wed
# 4 4 6 15 6 1 10
To re-aggregate the initial table count:
table(table(t(days)))
# 1 4 6 10 15
# 1 2 2 1 1
If this is your data:
days <- "Wed sun Sat fri mon sun sun Wed Wed sun sun Wed Sat Sat fri thu thu Wed Wed mon sun thu thu Wed fri thu Wed Sat thu sun sun sun sun Sat sun sun Wed tue sun sun Sat fri Wed mon mon sun"
you will probably want to convert to lower-case before and split into substrings:
days <- tolower(unlist(strsplit(days, " ")))
Then you can use table:
table(days)
days
fri mon sat sun thu tue wed
4 4 6 15 6 1 10
If you want to know which days occur a certain number of times:
t <- as.data.frame.table(table(days))
t$days[t$Freq == 10]
[1] wed
Here you are asking which day occurs exactly 10 times.
Or if you want know which days occur exactly 4 times:
t$days[t$Freq == 4]
[1] fri mon
If you just want to know how many days occur exactly, say, 4 times:
length(t$days[t$Freq == 4])
[1] 2
If you want to you know how many days occur n times you can define a for loop:
times <- c()
for(i in 1:15){
times[i] <- length(t$days[t$Freq == i])
}
times
[1] 1 0 0 2 0 2 0 0 0 1 0 0 0 0 1
If you want this info in a nice dataframe:
df <- data.frame(
freq = 1:15
)
for(i in 1:15){
df$times[i] <- length(t$days[t$Freq == i])
}
df
freq times
1 1 1
2 2 0
3 3 0
4 4 2
5 5 0
6 6 2
7 7 0
8 8 0
9 9 0
10 10 1
11 11 0
12 12 0
13 13 0
14 14 0
15 15 1
Does this answer your question?
I am working on a Timeseries data of 2 products - X1 & X2 starting from Jan-2016 to Dec-2019 and I am applying NNAR forecast model on it. The code is below:
nnar.Accounts_ts = ts(df, start = c(2016, 1), frequency = 12)
nnar.Accounts_ts
V1 V2
Jan 2016 2792 8882
Feb 2016 3317 10803
Mar 2016 4292 14059
Apr 2016 4500 15617
May 2016 5234 19211
Jun 2016 6657 23632
Jul 2016 6329 25435
Aug 2016 7208 30671
Sep 2016 7046 32429
Oct 2016 7242 35794
Nov 2016 7692 39138
Dec 2016 7860 43767
Jan 2017 6941 42172
Feb 2017 7076 40690
Mar 2017 8943 50362
Apr 2017 8435 50890
May 2017 9757 59852
Jun 2017 9510 62762
Jul 2017 8665 64176
Aug 2017 9538 70739
Sep 2017 8832 69643
Oct 2017 9983 77886
Nov 2017 9541 79059
Dec 2017 9397 82658
Jan 2018 10350 90879
Feb 2018 9853 84161
Mar 2018 12472 98436
Apr 2018 11942 101095
May 2018 12706 109782
Jun 2018 11733 108488
Jul 2018 11114 114713
Aug 2018 12731 122221
Sep 2018 10750 114816
Oct 2018 12319 129158
Nov 2018 12391 127707
Dec 2018 12442 132581
Jan 2019 14218 143658
Feb 2019 13628 131456
Mar 2019 15629 149794
Apr 2019 16457 157845
May 2019 16880 166019
Jun 2019 15362 160458
Jul 2019 15509 175690
Aug 2019 16195 178887
Sep 2019 14645 173253
Oct 2019 16930 189340
Nov 2019 16586 181478
Dec 2019 16520 199305
set.seed(54321)
Brand_nnar_Accounts_forecast <- lapply(nnar.Accounts_ts, function(x) forecast(nnetar(x, PI = TRUE),h = 30))
The output of the forecast model is of the format:
$X1
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2020 17055.65 16935.27 17235.31 17290.44 17310.37 17215.72 17227.75 17276.04 17134.86 17311.74 17297.26 17293.96
2021 17317.46 17312.78 17324.23 17326.22 17326.92 17323.58 17324.00 17325.72 17320.61 17326.95 17326.47 17326.35
2022 17327.17 17327.01 17327.40 17327.47 17327.50 17327.38
$X2
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2020 208483.0 187984.3 220114.3 225257.3 235741.0 225815.4 248283.1 248211.2 241011.6 261533.2 249032.7 270361.6
2021 275791.9 254342.5 286256.4 286638.9 292843.6 286383.4 298840.4 298059.8 294739.4 303357.4 298140.3 305902.2
2022 307070.0 300128.1 309649.4 309460.6 310678.2 309377.8
which I want to convert it into the following format.
Jan 2020 Feb 2020 Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020 Nov 2020
X1 17055.65 16935.27 17235.31 17290.44 17310.37 17215.72 17227.75 17276.04 17134.86 17311.74 17297.26
X2 208483.04 187984.26 220114.30 225257.26 235741.04 225815.39 248283.10 248211.23 241011.62 261533.17 249032.70
Dec 2020 Jan 2021 Feb 2021 Mar 2021 Apr 2021 May 2021 Jun 2021 Jul 2021 Aug 2021 Sep 2021 Oct 2021 Nov 2021
X1 17293.96 17317.46 17312.78 17324.23 17326.22 17326.92 17323.58 17324.0 17325.72 17320.61 17326.95 17326.47
X2 270361.60 275791.92 254342.50 286256.43 286638.89 292843.56 286383.42 298840.4 298059.78 294739.42 303357.43 298140.34
Dec 2021 Jan 2022 Feb 2022 Mar 2022 Apr 2022 May 2022 Jun 2022
X1 17326.35 17327.17 17327.01 17327.4 17327.47 17327.5 17327.38
X2 305902.18 307070.02 300128.09 309649.4 309460.55 310678.2 309377.82
NNAR model has embedded lists which is creating problem when I am using proposed solution to convert the format
One option is to transpose the elements in the list after converting to xts and then do the rbind
library(xts)
`row.names<-`(do.call(rbind, lapply(lst1, function(x) t(as.xts(x)))), names(lst1))
# Jan 2020 Feb 2020 Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020
#Product 1 41 56 2 16 78 60 89 31 68
#Product 2 52 23 57 48 80 53 63 36 10
# Oct 2020 Nov 2020 Dec 2020 Jan 2021 Feb 2021 Mar 2021 Apr 2021 May 2021 Jun 2021
#Product 1 73 2 40 45 11 43 63 58 29
#Product 2 24 24 39 4 56 85 6 20 69
# Jul 2021 Aug 2021 Sep 2021 Oct 2021 Nov 2021 Dec 2021
#Product 1 39 76 8 89 14 3
#Product 2 93 26 23 95 79 56
data
lst1 <- list(`Product 1` = ts(sample(100, 24, replace = TRUE), start = c(2020, 1),
frequency =12), `Product 2` = ts(sample(100, 24, replace = TRUE),
start = c(2020, 1), frequency =12))
I am using RStudio and I have the following 2 outputs from my R codes:
actual_2017 <- tail(mydata,12)
> actual_2017
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017 5980 5341 5890 5596 5753 5470 5589 5545 5749 5938 5844 5356
> predicted_2017 <- head(pred1,12)
> predicted_2017
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017 5762 5275 5733 5411 5406 4954 5464 5536 5805 5819 5903 5630
> str(actual_2017)
Time-Series [1:12] from 2017 to 2018: 5980 5341 5890 5596 5753 5470 5589 5545 5749 5938 ...
> str(predicted_2017)
Time-Series [1:12] from 2017 to 2018: 5763 5275 5734 5412 5407 ...
I want to merge actual_2017 and predicted_2017 into a data frame but keeping that wide table format.
Let's say this is the data frame I'm after:
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017(A) 5980 5341 5890 5596 5753 5470 5589 5545 5749 5938 5844 5356
2017(P) 5762 5275 5733 5411 5406 4954 5464 5536 5805 5819 5903 5630
How can I achieve this? Also, I will need the (A) and (P) next to 2017 so that the table becomes clear about its contents.
By using, t (transpose), rbind, names, rownames etc. you can achieve what you want:
actual_2017 <- data.frame(t(c(5980, 5341, 5890, 5596, 5753, 5470, 5589, 5545, 5749, 5938, 5844, 5356)))
names(actual_2017 ) <- c("Jan", "Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
rownames(actual_2017) <- "2017"
actual_2017
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017 5980 5341 5890 5596 5753 5470 5589 5545 5749 5938 5844 5356
predicted_2017 <- data.frame(t(c(5762, 5275, 5733, 5411, 5406, 4954, 5464, 5536, 5805, 5819, 5903, 5630)))
names(predicted_2017 ) <- c("Jan", "Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
rownames(predicted_2017) <- "2017"
predicted_2017
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017 5762 5275 5733 5411 5406 4954 5464 5536 5805 5819 5903 5630
merged <- rbind(actual_2017, predicted_2017)
rownames(merged) <- c("2017 (A)", "2017 (P)")
merged
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017 (A) 5980 5341 5890 5596 5753 5470 5589 5545 5749 5938 5844 5356
2017 (P) 5762 5275 5733 5411 5406 4954 5464 5536 5805 5819 5903 5630
#sample data (I cooked my own sample data, hope you don't mind it!)
actual_2017 <- ts(tail(AirPassengers,12), start = 2017, frequency = 12)
predicted_2017 <- ts(head(AirPassengers, 12), start = 2017, frequency = 12)
#merge both timeseries data
df <- rbind(actual_2017, predicted_2017)
colnames(df) <- month.abb
rownames(df) <- gsub("(^\\w).*(\\d{4}$)","\\2 (\\1)",rownames(df))
df
Output is:
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017 (a) 417 391 419 461 472 535 622 606 508 461 390 432
2017 (p) 112 118 132 129 121 135 148 148 136 119 104 118
I'm running a command to get the below output:
bash-3.2$ /usr/g1_listuser
Licensed(UDT+CP)/Effective Udt Sql iPhtm Pooled Total
( 25 + 2 ) / 27 5 0 0 0 5
UDTNO USRNBR UID USRNAME USRTYPE TTY TIME DATE
1 14310 10889 webspher phantom none 08:46:13 Feb 16 2017
2 8327 10889 webspher phantom none 23:45:21 Feb 15 2017
6 26704 30797 t576278 udt pts/1 04:21:29 Feb 16 2017
7 8735 10889 webspher phantom none 23:45:25 Feb 15 2017
8 29590 10889 webspher phantom none 03:34:29 Feb 16 2017
9 29340 10889 webspher phantom none 09:47:34 Feb 16 2017
10 28627 10889 webspher phantom none 09:47:19 Feb 16 2017
11 9850 10889 webspher phantom none 23:45:41 Feb 15 2017
12 28805 10889 webspher phantom none 09:47:24 Feb 16 2017
13 8957 10889 webspher phantom none 23:45:29 Feb 15 2017
14 3487 10889 webspher phantom none 09:47:20 Feb 14 2017
15 24327 32027 p101468 udt pts/3 15:00:12 Feb 15 2017
16 29631 10889 webspher phantom none 09:47:38 Feb 16 2017
18 9644 10889 webspher phantom none 23:45:36 Feb 15 2017
20 29073 10889 webspher phantom none 03:34:25 Feb 16 2017
21 29838 10889 webspher phantom none 03:34:33 Feb 16 2017
22 26728 10889 webspher udt none 08:00:18 Feb 13 2017
23 21835 10889 webspher phantom none 02:00:42 Feb 16 2017
25 12188 10889 webspher phantom none 08:45:33 Feb 16 2017
26 1138 10889 webspher phantom none 03:34:47 Feb 16 2017
27 21458 10889 webspher phantom none 02:00:37 Feb 16 2017
28 20834 10889 webspher phantom none 02:00:29 Feb 16 2017
29 20961 10889 webspher phantom none 02:00:32 Feb 16 2017
30 1561 10889 webspher phantom none 03:34:51 Feb 16 2017
31 7668 10889 webspher phantom none 04:02:21 Feb 16 2017
32 20998 10889 webspher phantom none 02:00:33 Feb 16 2017
33 21461 10889 webspher phantom none 02:00:37 Feb 16 2017
41 10980 10889 webspher udt none 09:00:39 Feb 13 2017
42 3276 10889 webspher phantom none 04:00:43 Feb 16 2017
43 12985 10889 webspher udt none 04:07:30 Feb 15 2017
The result I'm trying to get is a count per USRNAME and min date/time associated, I built the below command:
/usr/g1_listuser | grep -v 'Licensed' | grep -v '(' | grep -v 'UDTNO' | awk 'BEGIN {FS=OFS=SUBSEP=" "}{arr[$4]+=1;date=$7$8$9$10;min_date="999999999";if(min_date>date){min_date=date};}END {for (i in arr) if (i != null) print i,min_date,arr[i];}'
That output the below:
webspher 31
p101468 1
t576278 1
Which doesn't display the date and time properly. Any help is welcome.
Machine: sun4u sparc 5.10 Generic_150400-32
Aug 1 2013 /home/s/tone/TONE/gong1
Aug 1 2013 /home/s/tone/TONE/gong1.x
Aug 1 2013 /home/s/tone/TONE/gong2
Aug 1 2013 /home/s/tone/TONE/gong1.kbd
Aug 1 2013 /home/s/tone/TONE/gong2.x
Aug 1 2013 /home/s/tone/TONE/gong2.kbd
Aug 1 2013 /home/s/tone/TONE/gong3.kbd
Oct 10 2013 /home/s/man/whatisSPEC
Oct 10 2013 /home/s/man/man3/ctx.3
Oct 10 2013 /home/s/man/man3/sos.3
Oct 10 2013 /home/s/man/man3/dt.3
Oct 10 2013 /home/s/man/man3/timexpr.3
Oct 10 2013 /home/s/man/man3/mpusw.3
Oct 10 2013 /home/s/man/man3/mpu.err.3
Oct 10 2013 /home/s/man/man3/dbr.3
Oct 10 2013 /home/s/man/man3/psi.err.3
Oct 10 2013 /home/s/man/man3/stapo.3
Hi guys,
I would like to know if there are any ways to insert the directory name to the top and reprint the list to make it look like this. Thanks so much.
TONE
Aug 1 2013 /home/s/tone/TONE/gong1
Aug 1 2013 /home/s/tone/TONE/gong1.x
Aug 1 2013 /home/s/tone/TONE/gong2
Aug 1 2013 /home/s/tone/TONE/gong1.kbd
Aug 1 2013 /home/s/tone/TONE/gong2.x
Aug 1 2013 /home/s/tone/TONE/gong2.kbd
Aug 1 2013 /home/s/tone/TONE/gong3.kbd
man
Oct 10 2013 /home/s/man/whatisSPEC
man3
Oct 10 2013 /home/s/man/man3/ctx.3
Oct 10 2013 /home/s/man/man3/sos.3
Oct 10 2013 /home/s/man/man3/dt.3
Oct 10 2013 /home/s/man/man3/timexpr.3
Oct 10 2013 /home/s/man/man3/mpusw.3
Oct 10 2013 /home/s/man/man3/mpu.err.3
Oct 10 2013 /home/s/man/man3/dbr.3
Oct 10 2013 /home/s/man/man3/psi.err.3
Oct 10 2013 /home/s/man/man3/stapo.3
It's not clear where you get your list from, so I make the same assumption as Mari
$ cat sample.txt
> Aug 1 2013 /home/s/tone/TONE/gong1
> Aug 1 2013 /home/s/tone/TONE/gong1.x
> Aug 1 2013 /home/s/tone/TONE/gong2
> Aug 1 2013 /home/s/tone/TONE/gong1.kbd
> Aug 1 2013 /home/s/tone/TONE/gong2.x
> Aug 1 2013 /home/s/tone/TONE/gong2.kbd
> Aug 1 2013 /home/s/tone/TONE/gong3.kbd
> Oct 10 2013 /home/s/man/whatisSPEC
> Oct 10 2013 /home/s/man/man3/ctx.3
> Oct 10 2013 /home/s/man/man3/sos.3
> Oct 10 2013 /home/s/man/man3/dt.3
> Oct 10 2013 /home/s/man/man3/timexpr.3
> Oct 10 2013 /home/s/man/man3/mpusw.3
> Oct 10 2013 /home/s/man/man3/mpu.err.3
> Oct 10 2013 /home/s/man/man3/dbr.3
> Oct 10 2013 /home/s/man/man3/psi.err.3
> Oct 10 2013 /home/s/man/man3/stapo.3
awk can handle this:
$ awk -f script.awk sample.txt
> TONE
> Aug 1 2013 /home/s/tone/TONE/gong1
> Aug 1 2013 /home/s/tone/TONE/gong1.x
> Aug 1 2013 /home/s/tone/TONE/gong2
> Aug 1 2013 /home/s/tone/TONE/gong1.kbd
> Aug 1 2013 /home/s/tone/TONE/gong2.x
> Aug 1 2013 /home/s/tone/TONE/gong2.kbd
> Aug 1 2013 /home/s/tone/TONE/gong3.kbd
> man
> Oct 10 2013 /home/s/man/whatisSPEC
> man3
> Oct 10 2013 /home/s/man/man3/ctx.3
> Oct 10 2013 /home/s/man/man3/sos.3
> Oct 10 2013 /home/s/man/man3/dt.3
> Oct 10 2013 /home/s/man/man3/timexpr.3
> Oct 10 2013 /home/s/man/man3/mpusw.3
> Oct 10 2013 /home/s/man/man3/mpu.err.3
> Oct 10 2013 /home/s/man/man3/dbr.3
> Oct 10 2013 /home/s/man/man3/psi.err.3
> Oct 10 2013 /home/s/man/man3/stapo.3
and the script.awk used in this example looks like:
BEGIN {
FS="/"
}
lastDir!=$(NF-1){
lastDir=$(NF-1)
print lastDir
}
{
print $0
}
At the beginning we set the field separator FS to /, this is the same as calling awk with awk -F "/" but for reasons of clarity I put everything in a script, instead of just an awk oneliner.
The NF variable gives you the number of fields per line, $(NF-1) is therefore the last field (separated by /) in every line and this is exactly the name of the directory. Now we compare, if the lastDir variable is not the same as the $(NF-1) (which is the current directory), then we overwrite the lastDir variable and print it. In any case, we print the whole line with $0. Note that the lastDir variable doesn't need to be initiated, it is simply set to an empty string.
I assume your input data is in a file. So I have created a file with your input data. So it comes like this in my server.
cat sample.txt
Aug 1 2013 /home/s/tone/TONE/gong1
Aug 1 2013 /home/s/tone/TONE/gong1.x
Aug 1 2013 /home/s/tone/TONE/gong2
Aug 1 2013 /home/s/tone/TONE/gong1.kbd
Aug 1 2013 /home/s/tone/TONE/gong2.x
Aug 1 2013 /home/s/tone/TONE/gong2.kbd
Aug 1 2013 /home/s/tone/TONE/gong3.kbd
Oct 10 2013 /home/s/man/whatisSPEC
Oct 10 2013 /home/s/man/man3/ctx.3
Oct 10 2013 /home/s/man/man3/sos.3
Oct 10 2013 /home/s/man/man3/dt.3
Oct 10 2013 /home/s/man/man3/timexpr.3
Oct 10 2013 /home/s/man/man3/mpusw.3
Oct 10 2013 /home/s/man/man3/mpu.err.3
Oct 10 2013 /home/s/man/man3/dbr.3
Oct 10 2013 /home/s/man/man3/psi.err.3
Oct 10 2013 /home/s/man/man3/stapo.3
So you can get the directory names from this command,
awk -F "/" '{print $(NF-1)}' sample.txt | uniq
output
TONE
man
man3
Here am helping you to get the directory name only. Am not sure how to print them at top of each group lines.