/l3/users/slm/2018-12-minsk-aws/student04.BigClassRoom/user :1 :2 |
|
$lsusb
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub |
$lscpu
Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel ... CPU max MHz: 2933.0000 CPU min MHz: 1199.0000 BogoMIPS: 5852.56 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 4096K NUMA node0 CPU(s): 0-3 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm kaiser tpr_shadow vnmi flexpriority ept vpid dtherm arat |
$lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02) 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) 00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06) 00:16.3 Serial controller: Intel Corporation 5 Series/3400 Series Chipset KT Controller (rev 06) 00:19.0 Ethernet controller: Intel Corporation 82578DM Gigabit Network Connection (rev 05) 00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05) 00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05) 00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 05) 00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 05) 00:1c.6 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 7 (rev 05) 00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a5) 00:1f.0 ISA bridge: Intel Corporation 3450 Chipset LPC Interface Controller (rev 05) 00:1f.2 RAID bus controller: Intel Corporation SATA Controller [RAID mode] (rev 05) 3f:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05) 3f:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 05) 3f:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 05) 3f:02.1 Host bridge: Intel Corporation 1st Generation Core i3/5/7 Processor QPI Physical 0 (rev 05) 3f:02.2 Host bridge: Intel Corporation 1st Generation Core i3/5/7 Processor Reserved (rev 05) 3f:02.3 Host bridge: Intel Corporation 1st Generation Core i3/5/7 Processor Reserved (rev 05) |
$cls
bash: cls: command not found |
$cd ~
|
$ls
Desktop Documents Downloads Music Pictures Public Templates Videos |
$ls -l /proc/cpuinfo
-r--r--r-- 1 root root 0 Dec 17 12:27 /proc/cpuinfo |
$ssh 172.20.13.183
[user@instructor:~]$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 30:85:a9:9e:10:aa brd ff:ff:ff:ff:ff:ff inet 172.20.13.183/25 brd 172.20.13.255 scope global dynamic enp3s0 valid_lft 690907sec preferred_lft 690907sec inet6 fe80::3285:a9ff:fe9e:10aa/64 scope link valid_lft forever preferred_lft forever [user@instructor:~]$ |
$free
total used free shared buff/cache available Mem: 7973660 759212 6476160 100576 738288 6878176 Swap: 8181756 0 8181756 |
$free -m
total used free shared buff/cache available Mem: 7786 741 6324 98 720 6716 Swap: 7989 0 7989 |
$free -g
total used free shared buff/cache available Mem: 7 0 6 0 0 6 Swap: 7 0 7 |
$lspci -R
lspci: invalid option -- 'R' Usage: lspci [<switches>] Basic display modes: -mm Produce machine-readable output (single -m for an obsolete format) -t Show bus tree Display options: -v Be verbose (-vv for very verbose) -k Show kernel drivers handling each device -x Show hex-dump of the standard part of the config space -xxx Show hex-dump of the whole config space (dangerous; root only) ... Other options: -i <file> Use specified ID database instead of /usr/share/misc/pci.ids.gz -p <file> Look up kernel modules in a given file instead of default modules.pcimap -M Enable `bus mapping' mode (dangerous; root only) PCI access options: -A <method> Use the specified PCI access method (see `-A help' for a list) -O <par>=<val> Set PCI access parameter (see `-O help' for a list) -G Enable PCI access debugging -H <mode> Use direct hardware access (<mode> = 1 or 2) -F <file> Read PCI configuration dump from a given file |
$su
# # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset root ALL=(ALL:ALL) ALLass user ALL=(ALL:ALL) ALLth="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$ # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALLn # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d # User privilege specification root@m4:/home/user# exit exit |
$sudo ls
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for user: Desktop Documents Downloads Music Pictures Public Templates Videos |
$sudo apt install dmidecode
Reading package lists... Done Building dependency tree Reading state information... Done dmidecode is already the newest version (3.0-4). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
$dmidecode
bash: dmidecode: command not found |
$sudo dmidecode
# dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.6 present. 87 structures occupying 2520 bytes. Table at 0x000EA160. Handle 0x0001, DMI type 0, 24 bytes BIOS Information Vendor: Hewlett-Packard Version: 786H4 v01.06 Release Date: 07/09/2010 ... Handle 0x0061, DMI type 207, 9 bytes OEM-specific Type Header and Data: CF 09 61 00 00 00 00 24 00 Handle 0x0062, DMI type 208, 5 bytes OEM-specific Type Header and Data: D0 05 62 00 01 Handle 0x0063, DMI type 127, 4 bytes End Of Table |
$. /etc/bash_completion
|
$sudo dmidecode
# dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.6 present. 87 structures occupying 2520 bytes. Table at 0x000EA160. Handle 0x0001, DMI type 0, 24 bytes BIOS Information Vendor: Hewlett-Packard Version: 786H4 v01.06 Release Date: 07/09/2010 ... Handle 0x0061, DMI type 207, 9 bytes OEM-specific Type Header and Data: CF 09 61 00 00 00 00 24 00 Handle 0x0062, DMI type 208, 5 bytes OEM-specific Type Header and Data: D0 05 62 00 01 Handle 0x0063, DMI type 127, 4 bytes End Of Table |
$sudo nano ~/.bash
|
$~/.bashrc: executed by bash(1) for non-login shells.s' to be colorized:
. /etc/bash_completion |
$hdparm
bash: hdparm: command not found |
$sudo hdparm
hdparm - get/set hard disk parameters - version v9.51, by Mark Lord. clue=6 Usage: hdparm [options] [device ...] Options: -a Get/set fs readahead -A Get/set the drive look-ahead flag (0/1) -b Get/set bus state (0 == off, 1 == on, 2 == tristate) -B Set Advanced Power Management setting (1-255) -c Get/set IDE 32-bit IO setting -C Check drive power mode status ... --sanitize-block-erase Start block erase operation --sanitize-crypto-scramble Change the internal encryption keys that used for used data --sanitize-freeze-lock Lock drive's sanitize features until next power cycle --sanitize-overwrite PATTERN Overwrite the internal media with constant PATTERN --sanitize-status Show sanitize status information --security-help Display help for ATA security commands --trim-sector-ranges Tell SSD firmware to discard unneeded data sectors: lba:count .. --trim-sector-ranges-stdin Same as above, but reads lba:count pairs from stdin --verbose Display extra diagnostics from some commands --write-sector Repair/overwrite a (possibly bad) sector directly on the media (VERY DANGEROUS) |
$/cat/proc/partitions
bash: /cat/proc/partitions: No such file or directory |
$cat /proc/partitions
major minor #blocks name 8 0 488386584 sda 8 1 480201728 sda1 8 2 1 sda2 8 5 8181760 sda5 11 0 1048575 sr0 |
$df -h
Filesystem Size Used Avail Use% Mounted on udev 3.8G 0 3.8G 0% /dev tmpfs 779M 9.3M 770M 2% /run /dev/sda1 450G 4.2G 423G 1% / tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup tmpfs 779M 20K 779M 1% /run/user/117 tmpfs 779M 40K 779M 1% /run/user/1001 |
$mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) udev on /dev type devtmpfs (rw,nosuid,relatime,size=3975560k,nr_inodes=993890,mode=755) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=797368k,mode=755) /dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755) ... cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=10648) mqueue on /dev/mqueue type mqueue (rw,relatime) debugfs on /sys/kernel/debug type debugfs (rw,relatime) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime) tmpfs on /run/user/117 type tmpfs (rw,nosuid,nodev,relatime,size=797364k,mode=700,uid=117,gid=122) tmpfs on /run/user/1001 type tmpfs (rw,nosuid,nodev,relatime,size=797364k,mode=700,uid=1001,gid=1001) fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) gvfsd-fuse on /run/user/1001/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1001,group_id=1001) |
$sudo hdparm -tT /dev/sda
/dev/sda: Timing cached reads: 8984 MB in 2.00 seconds = 4498.89 MB/sec Timing buffered disk reads: 358 MB in 3.01 seconds = 118.95 MB/sec |
$sudo bonnie++
You must use the "-u" switch when running as root. usage: bonnie++ [-d scratch-dir] [-c concurrency] [-s size(MiB)[:chunk-size(b)]] [-n number-to-stat[:max-size[:min-size][:num-directories[:chunk-size]]]] [-m machine-name] [-r ram-size-in-MiB] [-x number-of-tests] [-u uid-to-use:gid-to-use] [-g gid-to-use] [-q] [-f] [-b] [-p processes | -y] [-z seed | -Z random-file] [-D] Version: 1.97 |
$sudo bonnie++ /dev/sda
usage: bonnie++ [-d scratch-dir] [-c concurrency] [-s size(MiB)[:chunk-size(b)]] [-n number-to-stat[:max-size[:min-size][:num-directories[:chunk-size]]]] [-m machine-name] [-r ram-size-in-MiB] [-x number-of-tests] [-u uid-to-use:gid-to-use] [-g gid-to-use] [-q] [-f] [-b] [-p processes | -y] [-z seed | -Z random-file] [-D] Version: 1.97 |
$sudo bonnie++ -d /tmp -s 16000M -n 0 -m TEST -f -b -u user
Using uid:1001, gid:1001. Writing intelligently...done Rewriting...done Reading intelligently...done start 'em...done...done...done...done...done... Version 1.97 ------Sequential Output------ --Sequential Input- --Random- Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP TEST 16000M 125474 11 48179 8 129881 13 118.2 3 Latency 451ms 336ms 67399us 1270ms 1.97,1.97,TEST,1,1545042031,16000M,,,,125474,11,48179,8,,,129881,13,118.2,3,,,,,,,,,,,,,,,,,,,451ms,336ms,,67399us,1270ms,,,,,, |
$curl cheat.sh/ls
# Displays everything in the target directory ls path/to/the/target/directory # Displays everything including hidden files ls -a # Displays all files, along with the size (with unit suffixes) and timestamp ls -lh # Display files, sorted by size ls -S # Display directories only ls -d */ # Display directories only, include hidden ls -d .*/ */ |
$curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML> |
$curl http://www.google.com
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="be"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title><script nonce="/UcLImsQ3quhW7tzxkm03Q==">(function(){window.google={kEI:'8YUXXMKdOObRrgSmoKj4Cw',kEXPI:'0,1353747,57,1957,1017,624, </style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.h{color:#36c}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px}.gsfi,.lst{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();} } })();</script><div id="mngb"> <div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="http://www.google.by/imghp?hl=be&tab=wi">Відарысы</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 href="https://drive.google.com/?tab=wo">Drive</a> <a class=gb1 href="https://www.google.com/calendar?tab=wc">Ка |
$curl wttr.in
Weather report: Minsk, Belarus Overcast .--. -12--5 °C .-( ). ← 22 km/h (___.__)__) 7 km 0.3 mm ┌─────────────┐ ┌──────────────────────────────┬───────────────────────┤ Mon 17 Dec ├───────────────────────┬──────────────────────────────┐ │ Morning │ Noon └──────┬──────┘ Evening │ Night │ ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤ ... ┌──────────────────────────────┬───────────────────────┤ Wed 19 Dec ├───────────────────────┬──────────────────────────────┐ │ Morning │ Noon └──────┬──────┘ Evening │ Night │ ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤ │ _`/"".-. Light snow │ _`/"".-. Light snow │ Mist │ Freezing fog │ │ ,\_( ). -9--7 °C │ ,\_( ). -8--6 °C │ _ - _ - _ - -11--9 °C │ _ - _ - _ - -14--12 °C │ │ /(___(__) ↖ 5-8 km/h │ /(___(__) ↖ 5-7 km/h │ _ - _ - _ ← 4-8 km/h │ _ - _ - _ ← 6-12 km/h │ │ * * * 20 km │ * * * 20 km │ _ - _ - _ - 20 km │ _ - _ - _ - 20 km │ │ * * * 0.0 mm | 0% │ * * * 0.0 mm | 0% │ 0.0 mm | 0% │ 0.0 mm | 0% │ └──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘ Follow @igor_chubin for wttr.in updates |
$curl wttr.in?2n
Weather report: Minsk, Belarus Overcast .--. -12--5 °C .-( ). ← 22 km/h (___.__)__) 7 km 0.3 mm ┌─────────────┐ ┌───────────────────────┤ Mon 17 Dec ├───────────────────────┐ │ Noon └──────┬──────┘ Night │ ├──────────────────────────────┼──────────────────────────────┤ ... ┌───────────────────────┤ Tue 18 Dec ├───────────────────────┐ │ Noon └──────┬──────┘ Night │ ├──────────────────────────────┼──────────────────────────────┤ │ .-. Moderate snow │ Freezing fog │ │ ( ). -9--6 °C │ _ - _ - _ - -10 °C │ │ (___(__) ↖ 8-10 km/h │ _ - _ - _ ↑ 5-8 km/h │ │ * * * * 12 km │ _ - _ - _ - 15 km │ │ * * * * 0.1 mm | 0% │ 0.0 mm | 0% │ └──────────────────────────────┴──────────────────────────────┘ Follow @igor_chubin for wttr.in updates |
$curl qrenco/Preved
curl: (6) Could not resolve host: qrenco |
$curl qrenco.de/Preved
█████████████████████████████ █████████████████████████████ ████ ▄▄▄▄▄ █▀ █ ▄█ ▄▄▄▄▄ ████ ████ █ █ █▄ █▀▄█ █ █ ████ ████ █▄▄▄█ █ ██▀ █ █▄▄▄█ ████ ████▄▄▄▄▄▄▄█ ▀ ▀ █▄▄▄▄▄▄▄████ ████▄ █ ▀▀▄▄█▄ ███ ▄▀▄▄▀████ ██████▀█▄▀▄▀▄ █▀▄▄█▀▀▀█▀ ████ █████████▄▄▄▀▄▄▀▄█▄▀▀██▀▄████ ████ ▄▄▄▄▄ █▄▀▀▀▀ █▀▄█▄▄▀████ ████ █ █ █▀ ▀ ██▄ ▀ █▀ ████ ████ █▄▄▄█ █▀▄▀█▄▀▀▄ ███▄████ ████▄▄▄▄▄▄▄█▄▄▄▄▄██▄▄▄█▄█████ █████████████████████████████ █████████████████████████████ |
$head -2 /etc/passwd | curl -F-=<- qrenco.de
bash: -: No such file or directory |
$head -2 /etc/passwd | curl -F-=<- qrenco.de
bash: -: No such file or directory |
$sudo head -2 /etc/passwd | curl -F-=<- qrenco.de
bash: -: No such file or directory |
$sudo head -2 /etc/passwd | curl-F-=<- qrenco.de
bash: -: No such file or directory |
$sudo head -2 /etc/passwd
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin |
$sudo head -2 /etc/passwd | curl -F-=\<- qrenco.de
█████████████████████████████████████████████ █████████████████████████████████████████████ ████ ▄▄▄▄▄ █ ▄▄ █▄▄ █ ▄█▀▀ █▀▄ ███ ▄▄▄▄▄ ████ ████ █ █ ██▄█▀▀▄█▀▀ █ ▄▀█ ▀▄█ █ █ ████ ████ █▄▄▄█ █ ▀▀▄ ▀▀▄ █▄█▀▀██▀▄▄▄▄█ █▄▄▄█ ████ ████▄▄▄▄▄▄▄█ ▀▄█▄▀▄█▄█ ▀ █▄█ █ █▄█▄▄▄▄▄▄▄████ ████▄ ▄▀█ ▄█▄ █▄ ▄█▄ ▀█▀▄▀▄▀ ██▀ ▄ ▄█▀ ████ ████ █▀ ▄ ▄█ ▄ ▀ ▄ ▀ ██ ▄█▀▄▀▄▀ █▀▀▄█▄▄█ ████ ████ █▄█ ▀▄ ▄▀▄██ ██▀▄ ▀█▀ ▀█ ▀█ ▀██▀ ▀████ █████▄ ▀ █▄█ █▀▄█▀█▄██▀ █▄▀▄█▄▀▄█▀▀▀▀▄█▄▄████ ... ██████▀▄▀ ▄▀ ▀▄█▀█ ▄█▀ ▀█▄ ▄██ ▀▄▀ ▄▄█▀ ████ ████▄██▀▄ ▄▄▀█ ▄ ▄██▄▀█▀▄▀▄▀█▀ ▀▄▄ ▀████▀████ ████▄▄█▄ █▄▀ ▄▀ ▄ ▄▄█ ▄█▀▄██▄ ▀▀▀▀▄▄█ ████ ████▄▄█▄▄▄▄▄▀▀▀██ █▄▀█▀██▀ █▀▀█ ▄▄▄ █▀ ████ ████ ▄▄▄▄▄ █▀ ▄▄█▀█ █▀ █ ▄▄▄▀ █▄█ █▀▄████ ████ █ █ ██ ▄ ▄█▀ ██▀ ██▀█▀ ▄ ▄▄ ██ ▄████ ████ █▄▄▄█ █ ▀▀▀ ▄ ▄██▀▄██▄▄██▄▄▀▄█▀ ██▄████ ████▄▄▄▄▄▄▄█▄▄███▄▄█▄███▄██▄██▄█▄▄███▄██▄████ █████████████████████████████████████████████ █████████████████████████████████████████████ |
$nano
|
$[
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 4, column 2 |
$[
[ { "name": "user1", "computer": "comp1" }, { "name": "user2", "computer": "comp1" } ] |
$cat 1.json | jq .[1].computer
"comp1" |
$cat 1.json | jq .[2].name
null |
$cat 1.json | jq .[1].name
"user2" |
$cat 1.json | jq .[1]
{ "name": "user2", "computer": "comp1" } |
$cat 1.json | jq .[0].name
"user1" |
$cat 1.json | jq .[0].computer
"comp1" |
$curl -s https://uinames.com/api/?region=belarus\&amount=5 | jq
{ "error": "Region or language not found" } |
$curl -s https://uinames.com/api/?region=poland\&amount=5 | jq
[ { "name": "Zbigniew", "surname": "Kozioł", "gender": "male", "region": "Poland" }, { "name": "Adrian", "surname": "Michalak", ... "gender": "female", "region": "Poland" }, { "name": "Leszek", "surname": "Mróz", "gender": "male", "region": "Poland" } ] |
$q
bash: q: command not found |
$git
usage: git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>] These are common Git commands used in various situations: start a working area (see also: git help tutorial) clone Clone a repository into a new directory init Create an empty Git repository or reinitialize an existing one work on the current change (see also: git help everyday) ... merge Join two or more development histories together rebase Reapply commits on top of another base tip tag Create, list, delete or verify a tag object signed with GPG collaborate (see also: git help workflows) fetch Download objects and refs from another repository pull Fetch from and integrate with another repository or a local branch push Update remote refs along with associated objects 'git help -a' and 'git help -g' list available subcommands and some concept guides. See 'git help <command>' or 'git help <concept>' to read about a specific subcommand or concept. |
$nano github.txt
|
$vladislavsemko
|
$git clone
You must specify a repository to clone. usage: git clone [<options>] [--] <repo> [<dir>] -v, --verbose be more verbose -q, --quiet be more quiet --progress force progress reporting -n, --no-checkout don't create a checkout --bare create a bare repository --mirror create a mirror repository (implies bare) -l, --local to clone from a local repository --no-hardlinks don't use local hardlinks, always copy ... --shallow-exclude <revision> deepen history of shallow clone by excluding rev --single-branch clone only one branch, HEAD or --branch --shallow-submodules any cloned submodules will be shallow --separate-git-dir <gitdir> separate git dir from working tree -c, --config <key=value> set config inside the new repository -4, --ipv4 use IPv4 addresses only -6, --ipv6 use IPv6 addresses only |
$git clone https://github.com/VladislavSemko/AWS
Cloning into 'AWS'... remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. |
$ls
1.json Desktop Downloads Music Public Videos AWS Documents github.txt Pictures Templates |
$cd AWS/
|
$ls
README.md |
$nano README.md
|
$git commit "added line"
error: pathspec 'added line' did not match any file(s) known to git. |
$git commit
*** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: empty ident name (for <(null)>) not allowed |
$git config
usage: git config [<options>] Config file location --global use global config file --system use system config file --local use repository config file -f, --file <file> use given config file --blob <blob-id> read config from given blob object Action --get get value: name [value-regex] --get-all get all values: key [value-regex] ... Type --bool value is "true" or "false" --int value is decimal number --bool-or-int value is --bool or --int --path value is a path (file or directory name) Other -z, --null terminate values with NUL byte --name-only show variable names only --includes respect include directives on lookup --show-origin show origin of config (file, standard input, blob, command line) |
$git config --global user.name "Your Name"
|
$git config --global user.name "Vladislav Semko"
|
$git commit
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Committer: Vladislav Semko <user@m4.class.sl> # # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # modified: README.md # Aborting commit due to empty commit message. |
$git commit "added line"
error: pathspec 'added line' did not match any file(s) known to git. |
$git commit readmi.md
error: pathspec 'readmi.md' did not match any file(s) known to git. |
$ls
README.md |
$git commit READMI.md
error: pathspec 'READMI.md' did not match any file(s) known to git. |
$git commit README.md
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # Explicit paths specified without -i or -o; assuming --only paths... # # Committer: Vladislav Semko <user@m4.class.sl> # # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # modified: README.md # Aborting commit due to empty commit message. |
$git commit README.md "added line"
error: pathspec 'added line' did not match any file(s) known to git. |
$git commit -a
Committer: Vladislav Semko <user@m4.class.sl> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email you@example.com After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 2 insertions(+), 1 deletion(-) |
$git config --global user.email "hexaedr@gmail.com"
|
$git push
Username for 'https://github.com': hexaedr@gmail.com Password for 'https://hexaedr@gmail.com@github.com': Counting objects: 3, done. Writing objects: 100% (3/3), 296 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/VladislavSemko/AWS 4838e38..0c48953 master -> master |
$git commit -a
On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean |
$nano
|
$test file
Username for 'https://github.com': hexaedr@gmail.com Password for 'https://hexaedr@gmail.com@github.com': Everything up-to-date |
$git status
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) testAWS.txt nothing added to commit but untracked files present (use "git add" to track) |
$git add testAWS.txt
|
$git push
Username for 'https://github.com': hexaedr@gmail.com Password for 'https://hexaedr@gmail.com@github.com': Everything up-to-date |
$git commit -a
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # new file: testAWS.txt # Aborting commit due to empty commit message. |
$git commit -a
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # new file: testAWS.txt # Aborting commit due to empty commit message. |
$git commit -a
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # new file: testAWS.txt # Aborting commit due to empty commit message. |
$git commit -a new file: testAWS.txt
fatal: Paths with -a does not make sense. |
$git commit -a "new file: testAWS.txt"
fatal: Paths with -a does not make sense. |
$git commit "new file: testAWS.txt"
error: pathspec 'new file: testAWS.txt' did not match any file(s) known to git. |
$git commit testAWS.txt
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # Explicit paths specified without -i or -o; assuming --only paths... # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # new file: testAWS.txt # Aborting commit due to empty commit message. |
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: testAWS.txt |
$git commit -m 'added testAWS.txt' testAWS.txt
[master 8c067c9] added testAWS.txt 1 file changed, 1 insertion(+) create mode 100644 testAWS.txt |
$git log
commit 8c067c9c66ddf309b4d3def426fc8c4c0f7ecabf Author: Vladislav Semko <hexaedr@gmail.com> Date: Mon Dec 17 16:13:03 2018 +0300 added testAWS.txt commit 0c489532f00bcd73091141856c106fc80aced05b Author: Vladislav Semko <user@m4.class.sl> Date: Mon Dec 17 16:03:22 2018 +0300 Changes to be committed: modified: README.md commit 4838e38b63cadd3a76fa1e0d6b8bcc46b7cfb75a Author: VladislavSemko <45939592+VladislavSemko@users.noreply.github.com> Date: Mon Dec 17 15:51:14 2018 +0300 Initial commit |
$git pull
remote: Enumerating objects: 6, done. remote: Counting objects: 100% (6/6), done. remote: Compressing objects: 100% (4/4), done. remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (5/5), done. From https://github.com/VladislavSemko/AWS 8c067c9..df403ce master -> origin/master Updating 8c067c9..df403ce Fast-forward testAWS.md | 1 + testAWS.txt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 testAWS.md delete mode 100644 testAWS.txt |
$nano testAWS.md
|
$**This** is a **test** *file*
diff --git a/testAWS.md b/testAWS.md index 08a60a3..00ec2de 100644 --- a/testAWS.md +++ b/testAWS.md @@ -1 +1 @@ -*test* **file** +**This** is a **test** *file* |
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: testAWS.md no changes added to commit (use "git add" and/or "git commit -a") |
major minor #blocks name 8 0 488386584 sda 8 1 480201728 sda1 8 2 1 sda2 8 5 8181760 sda5 11 0 1048575 sr0
Время первой команды журнала | 10:16:36 2018-12-17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:45:43 2018-12-17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 27.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 4.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008