/l3/users/3-2-2020/NT-Ladm/debian1.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 |
|
#find / -type -l
![]() find: Arguments to -type should contain only one letter |
#find / -type l
![]() /sys/devices/system/cpu/cpu0/subsystem /sys/devices/system/cpu/cpu0/node0 /sys/devices/system/memory/memory0/node0 /sys/devices/system/memory/memory1/node0 /sys/devices/system/memory/memory2/node0 /sys/devices/system/memory/memory3/node0 /sys/devices/system/node/node0/memory0 /sys/devices/system/node/node0/memory1 /sys/devices/system/node/node0/memory2 /sys/devices/system/node/node0/memory3 ... /proc/12216/fd/0 /proc/12216/fd/1 /proc/12216/fd/2 /proc/12216/fd/3 /proc/12216/fd/4 find: `/proc/12216/fd/5': No such file or directory find: `/proc/12216/fdinfo/5': No such file or directory /proc/12216/cwd /proc/12216/root /proc/12216/exe |
#clear
|
#find / -user user
![]() /tmp/directory1 /tmp/directory2 /tmp/directory3 /tmp/file1 /tmp/killall /tmp/MySuperFile /tmp/aba /tmp/dirlist /tmp/file3 /tmp/etccopy ... /proc/9756/oom_adj /proc/9756/oom_score_adj /proc/9756/loginuid /proc/9756/sessionid /proc/9756/coredump_filter /proc/9756/io find: `/proc/12232/task/12232/fd/5': No such file or directory find: `/proc/12232/task/12232/fdinfo/5': No such file or directory find: `/proc/12232/fd/5': No such file or directory find: `/proc/12232/fdinfo/5': No such file or directory |
#find / -perm +6000
![]() /usr/lib/openssh/ssh-keysign /usr/lib/pt_chown /usr/lib/eject/dmcrypt-get-device /usr/bin/chage /usr/bin/crontab /usr/bin/passwd /usr/bin/dotlockfile /usr/bin/mail-lock /usr/bin/mail-unlock /usr/bin/expiry ... /var/cache/man/sl/cat1 /var/cache/man/sl/cat8 /var/mail /var/local /var/log/exim4 /sbin/unix_chkpwd find: `/proc/12240/task/12240/fd/5': No such file or directory find: `/proc/12240/task/12240/fdinfo/5': No such file or directory find: `/proc/12240/fd/5': No such file or directory find: `/proc/12240/fdinfo/5': No such file or directory |
#ls -dl
drwx------ 7 root root 4096 Feb 4 15:33 . |
#ls
-bad-name- A' Stah A:\Stah\11 A:\Stah\22 Andrey Stah Andrey Stah2 d1 d2 install one space ~ivan ~petr ~user |
#mkdir /sort
|
#ls
-bad-name- A' Stah A:\Stah\11 A:\Stah\22 Andrey Stah Andrey Stah2 d1 d2 install one space ~ivan ~petr ~user |
#find ~ -regex '.*(\.tar\.gz|\.tgz|\.rpm)'
|
#lastlog
Username Port From Latest root pts/1 192.168.15.142 Tue Feb 4 09:53:37 +0200 2020 daemon **Never logged in** bin **Never logged in** sys **Never logged in** sync **Never logged in** games **Never logged in** man **Never logged in** lp **Never logged in** mail **Never logged in** ... list **Never logged in** irc **Never logged in** gnats **Never logged in** nobody **Never logged in** libuuid **Never logged in** Debian-exim **Never logged in** user pts/0 192.168.15.142 Tue Feb 4 11:42:41 +0200 2020 sshd **Never logged in** ivan pts/3 192.168.15.142 Tue Feb 4 09:54:26 +0200 2020 petr pts/3 192.168.15.142 Mon Feb 3 10:29:20 +0200 2020 |
#touch file1.gz file2.tar file3.jpg
|
#man find
|
#who --help
Usage: who [OPTION]... [ FILE | ARG1 ARG2 ] Print information about users who are currently logged in. -a, --all same as -b -d --login -p -r -t -T -u -b, --boot time of last system boot -d, --dead print dead processes -H, --heading print line of column headings --ips print ips instead of hostnames. with --lookup, canonicalizes based on stored IP, if available, rather than stored hostname -l, --login print system login processes ... --writable same as -T --help display this help and exit --version output version information and exit If FILE is not specified, use /var/run/utmp. /var/log/wtmp as FILE is common. If ARG1 ARG2 given, -m presumed: `am i' or `mom likes' are usual. Report who bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> Report who translation bugs to <http://translationproject.org/team/> For complete documentation, run: info coreutils 'who invocation' |
#man who
|
#man bash
|
#Pattern not found (press RETURN)
PASSWD(1) User Commands PASSWD(1) NAME passwd - change user password SYNOPSIS passwd [options] [LOGIN] DESCRIPTION The passwd command changes passwords for user accounts. A normal user may only change the password for his/her own account, while the superuser may change the password for any account. passwd also changes the account or associated password validity period. Password Changes ... one or more characters from each of the following sets: o lower case alphabetics o digits 0 thru 9 o punctuation marks Care must be taken not to include the system default erase or kill characters. passwd will reject any password which is not suitably complex. Hints for user passwords The security of a password depends upon the strength of the encryption algorithm and the size of the key space. The legacy UNIX System encryption method is based on the NBS DES algorithm. More recent methods are now recommended (see ENCRYPT_METHOD). The size of the key space depends upon the randomness of the password which is selected. |
#man 5 passwd
|
#man -a passwd
|
#man -k raid
![]() |
#man -k user
|
#man -k user | awk '$2~/([158])/'
adduser.conf (5) - configuration file for adduser(8) and addgroup(8) . deluser.conf (5) - configuration file for deluser(8) and delgroup(8) . addgroup (8) - add a user or group to the system adduser (8) - add a user or group to the system arpd (8) - userspace arp daemon. bsd-write (1) - send a message to another user chage (1) - change user password expiry information chfn (1) - change real user name and information crontab (1) - maintain crontab files for individual users (Vixie Cron) delgroup (8) - remove a user or group from the system ... ucf (1) - Update Configuration File: preserve user changes in configuration files unix_chkpwd (8) - Helper binary that verifies the password of the current user unix_update (8) - Helper binary that updates the password of a given user useradd (8) - create a new user or update default new user information userdel (8) - delete a user account and related files usermod (8) - modify a user account users (1) - print the user names of users currently logged in to the current host wall (1) - write a message to users whoami (1) - print effective userid write (1) - send a message to another user |
#cat /etc//passwd
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh ... list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false user:x:1000:1000:user,,,:/home/user:/bin/bash sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin ivan:x:1001:1001::/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash |
#id ivan
uid=1001(ivan) gid=1001(ivan) groups=1001(ivan) |
#ls -l
total 28 -rw-r--r-- 1 root root 0 Feb 4 11:41 -bad-name- -rw-r--r-- 1 root root 0 Feb 4 11:37 A' Stah -rw-r--r-- 1 root root 0 Feb 4 11:38 A:\Stah\11 -rw-r--r-- 1 root root 0 Feb 4 11:38 A:\Stah\22 -rw-r--r-- 1 root root 0 Feb 4 11:34 Andrey Stah -rw-r--r-- 1 root root 0 Feb 4 11:35 Andrey Stah2 drwxr-xr-x 2 root root 4096 Feb 3 12:52 d1 drwxr-xr-x 3 root root 4096 Feb 3 15:17 d2 -rw-r--r-- 1 root root 0 Feb 4 16:38 file1.gz -rw-r--r-- 1 root root 0 Feb 4 16:38 file2.tar -rw-r--r-- 1 root root 0 Feb 4 16:38 file3.jpg -rw-r--r-- 1 root root 5388 Feb 4 13:33 install -rw-r--r-- 1 root root 0 Feb 4 11:35 one space -rw-r--r-- 1 root root 96 Feb 4 10:05 ~ivan -rw-r--r-- 1 root root 96 Feb 4 10:05 ~petr -rw-r--r-- 1 root root 96 Feb 4 10:05 ~user |
#chfn ivan
![]() Changing the user information for ivan Enter the new value, or press ENTER for the default Full Name []: Ivan Room Number []: Ivanov Work Phone []: ^C |
#chfn ivan
Changing the user information for ivan Enter the new value, or press ENTER for the default Full Name []: Ivanov Ivan Room Number []: 9C Work Phone []: 111 Home Phone []: 222-22-22 Other []: |
#cat /etc//passwd
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh ... list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false user:x:1000:1000:user,,,:/home/user:/bin/bash sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin ivan:x:1001:1001:Ivanov Ivan,9C,111,222-22-22:/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash |
#finger
![]() l3script: finger: command not found |
#apt-get install finger
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: finger 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 20.5 kB of archives. After this operation, 31.7 kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! finger Install these packages without verification [y/N]? y Get:1 http://ftp.ua.debian.org/debian/ wheezy/main finger amd64 0.17-15 [20.5 kB] Fetched 20.5 kB in 0s (83.4 kB/s) Selecting previously unselected package finger. (Reading database ... 28835 files and directories currently installed.) Unpacking finger (from .../finger_0.17-15_amd64.deb) ... Processing triggers for man-db ... Setting up finger (0.17-15) ... |
#finger
Login Name Tty Idle Login Time Office Office Phone ivan Ivanov Ivan pts/3 23:42 Feb 4 09:54 (192.168.15.142) root root pts/1 Feb 4 09:53 (192.168.15.142) user user pts/0 24 Feb 4 11:42 (192.168.15.142) |
#finger ivan
Login: ivan Name: Ivanov Ivan Directory: /home/ivan Shell: /bin/bash Office: 9C, 111 Home Phone: 222-22-22 On since Tue Feb 4 09:54 (EET) on pts/3 from 192.168.15.142 23 hours 43 minutes idle No mail. No Plan. |
#usermod
![]() Usage: usermod [options] LOGIN Options: -c, --comment COMMENT new value of the GECOS field -d, --home HOME_DIR new home directory for the user account -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE -f, --inactive INACTIVE set password inactive after expiration to INACTIVE -g, --gid GROUP force use GROUP as new primary group -G, --groups GROUPS new list of supplementary GROUPS -a, --append append the user to the supplemental GROUPS ... -L, --lock lock the user account -m, --move-home move contents of the home directory to the new location (use only with -d) -o, --non-unique allow using duplicate (non-unique) UID -p, --password PASSWORD use encrypted password for the new password -R, --root CHROOT_DIR directory to chroot into -s, --shell SHELL new login shell for the user account -u, --uid UID new UID for the user account -U, --unlock unlock the user account -Z, --selinux-user SEUSER new SELinux user mapping for the user account |
#usermod -s
![]() usermod: option requires an argument -- 's' Usage: usermod [options] LOGIN Options: -c, --comment COMMENT new value of the GECOS field -d, --home HOME_DIR new home directory for the user account -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE -f, --inactive INACTIVE set password inactive after expiration to INACTIVE -g, --gid GROUP force use GROUP as new primary group -G, --groups GROUPS new list of supplementary GROUPS ... -L, --lock lock the user account -m, --move-home move contents of the home directory to the new location (use only with -d) -o, --non-unique allow using duplicate (non-unique) UID -p, --password PASSWORD use encrypted password for the new password -R, --root CHROOT_DIR directory to chroot into -s, --shell SHELL new login shell for the user account -u, --uid UID new UID for the user account -U, --unlock unlock the user account -Z, --selinux-user SEUSER new SELinux user mapping for the user account |
#usermod -s /bin/sh ivan
|
#finger ivan
Login: ivan Name: Ivanov Ivan Directory: /home/ivan Shell: /bin/sh Office: 9C, 111 Home Phone: 222-22-22 On since Tue Feb 4 09:54 (EET) on pts/3 from 192.168.15.142 23 hours 46 minutes idle No mail. No Plan. |
#echo $?
0 |
#usermod -s /bin/bash ivan
|
#finger ivan
Login: ivan Name: Ivanov Ivan Directory: /home/ivan Shell: /bin/bash Office: 9C, 111 Home Phone: 222-22-22 On since Tue Feb 4 09:54 (EET) on pts/3 from 192.168.15.142 23 hours 50 minutes idle No mail. No Plan. |
#cat /etc/shadow
root:$6$ppY7xZxX$CnutMU4XxetHko6DW5K/ckfiA6CFeC0cbV/d6rrWE6F5iszqxAaQTwekH3.vBTQPNCakvqusvPcBecndLcbX8.:16248:0:99999:7::: daemon:*:16248:0:99999:7::: bin:*:16248:0:99999:7::: sys:*:16248:0:99999:7::: sync:*:16248:0:99999:7::: games:*:16248:0:99999:7::: man:*:16248:0:99999:7::: lp:*:16248:0:99999:7::: mail:*:16248:0:99999:7::: news:*:16248:0:99999:7::: ... list:*:16248:0:99999:7::: irc:*:16248:0:99999:7::: gnats:*:16248:0:99999:7::: nobody:*:16248:0:99999:7::: libuuid:!:16248:0:99999:7::: Debian-exim:!:16248:0:99999:7::: user:$6$CkJHVC8E$ykTJUix/7qmcPBJgqnJtCHlWhYfEaImqXcQyeRrwYm6Xi4KaZSfb4FB20ocZ/VlrQzTR2wiEobMxT/OM/FXgd0:16248:0:99999:7::: sshd:*:16248:0:99999:7::: ivan:$6$7qFVyIS/$d6QA1gx0rQ4Xq0WsfDRIllO/Mc0Ytyqc6bqxOtsrKhqGxjdIrD446Jt6BI/yABuRM6P0Bjpq.M7GVVvpemqGe0:18295:0:99999:7::: petr:$6$BCwgxnR9$DkDRXQnUbqCrCexjlQ4MGCC1JTZSBHyKzTN7HW29wmTpuvVkMhuS2ktpuEY8xV.oj3fDKYmyFI4Vlu72.VEJ20:18295:0:99999:7::: |
#change - user
![]() l3script: change: command not found |
#change -user -l
![]() l3script: change: command not found |
#change -l user
![]() l3script: change: command not found |
#chane -l user
![]() l3script: chane: command not found |
#chage -l user
Last password change : Jun 27, 2014 Password expires : never Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7 |
#chage -l ivan
Last password change : Feb 03, 2020 Password expires : never Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7 |
#finger ivan
Login: ivan Name: Ivanov Ivan Directory: /home/ivan Shell: /bin/bash Office: 9C, 111 Home Phone: 222-22-22 On since Tue Feb 4 09:54 (EET) on pts/3 from 192.168.15.142 1 day idle No mail. No Plan. |
#usermod -L ivan
|
#finger ivan
Login: ivan Name: Ivanov Ivan Directory: /home/ivan Shell: /bin/bash Office: 9C, 111 Home Phone: 222-22-22 On since Tue Feb 4 09:54 (EET) on pts/3 from 192.168.15.142 1 day idle No mail. No Plan. |
#chage -l ivan
Last password change : Feb 03, 2020 Password expires : never Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7 |
#passwd -S -a
root P 06/27/2014 0 99999 7 -1 daemon L 06/27/2014 0 99999 7 -1 bin L 06/27/2014 0 99999 7 -1 sys L 06/27/2014 0 99999 7 -1 sync L 06/27/2014 0 99999 7 -1 games L 06/27/2014 0 99999 7 -1 man L 06/27/2014 0 99999 7 -1 lp L 06/27/2014 0 99999 7 -1 mail L 06/27/2014 0 99999 7 -1 news L 06/27/2014 0 99999 7 -1 ... list L 06/27/2014 0 99999 7 -1 irc L 06/27/2014 0 99999 7 -1 gnats L 06/27/2014 0 99999 7 -1 nobody L 06/27/2014 0 99999 7 -1 libuuid L 06/27/2014 0 99999 7 -1 Debian-exim L 06/27/2014 0 99999 7 -1 user P 06/27/2014 0 99999 7 -1 sshd L 06/27/2014 0 99999 7 -1 ivan L 02/03/2020 0 99999 7 -1 petr P 02/03/2020 0 99999 7 -1 |
#usermod -U ivan
|
#vi /etc/default/useradd
--- /tmp/l3-saved-7810.25361.7039 2020-02-05 11:26:21.396272489 +0200 +++ /etc/default/useradd 2020-02-05 11:30:30.756266422 +0200 @@ -5,7 +5,7 @@ # Similar to DHSELL in adduser. However, we use "sh" here because # useradd is a low level utility and should be as general # as possible -SHELL=/bin/sh +SHELL=/bin/bash # # The default group for users # 100=users on Debian systems |
#vi /etc/login.defs
|
#groupadd devops
|
#gpasswd -M ivan,petr devops
|
#ip ivan
![]() Object "ivan" is unknown, try "ip help". |
#id ivan
uid=1001(ivan) gid=1001(ivan) groups=1001(ivan),1003(devops) |
#adduser anna
Adding user `anna' ... Adding new group `anna' (1004) ... Adding new user `anna' (1003) with group `anna' ... Creating home directory `/home/anna' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: Sorry, passwords do not match passwd: Authentication token manipulation error passwd: password unchanged ... Retype new UNIX password: passwd: password updated successfully Changing the user information for anna Enter the new value, or press ENTER for the default Full Name []: 1 Room Number []: 1 Work Phone []: 11 Home Phone []: 1 Other []: 1 Is the information correct? [Y/n] Y |
#vi /etc/default/useradd
|
#~
root P 06/27/2014 0 99999 7 -1 daemon L 06/27/2014 0 99999 7 -1 bin L 06/27/2014 0 99999 7 -1 sys L 06/27/2014 0 99999 7 -1 sync L 06/27/2014 0 99999 7 -1 games L 06/27/2014 0 99999 7 -1 man L 06/27/2014 0 99999 7 -1 lp L 06/27/2014 0 99999 7 -1 mail L 06/27/2014 0 99999 7 -1 news L 06/27/2014 0 99999 7 -1 ... irc L 06/27/2014 0 99999 7 -1 gnats L 06/27/2014 0 99999 7 -1 nobody L 06/27/2014 0 99999 7 -1 libuuid L 06/27/2014 0 99999 7 -1 Debian-exim L 06/27/2014 0 99999 7 -1 user P 06/27/2014 0 99999 7 -1 sshd L 06/27/2014 0 99999 7 -1 ivan P 02/03/2020 0 99999 7 -1 petr P 02/03/2020 0 99999 7 -1 anna P 02/05/2020 0 99999 7 -1 |
#cat /etc/shadow
root:$6$ppY7xZxX$CnutMU4XxetHko6DW5K/ckfiA6CFeC0cbV/d6rrWE6F5iszqxAaQTwekH3.vBTQPNCakvqusvPcBecndLcbX8.:16248:0:99999:7::: daemon:*:16248:0:99999:7::: bin:*:16248:0:99999:7::: sys:*:16248:0:99999:7::: sync:*:16248:0:99999:7::: games:*:16248:0:99999:7::: man:*:16248:0:99999:7::: lp:*:16248:0:99999:7::: mail:*:16248:0:99999:7::: news:*:16248:0:99999:7::: ... irc:*:16248:0:99999:7::: gnats:*:16248:0:99999:7::: nobody:*:16248:0:99999:7::: libuuid:!:16248:0:99999:7::: Debian-exim:!:16248:0:99999:7::: user:$6$CkJHVC8E$ykTJUix/7qmcPBJgqnJtCHlWhYfEaImqXcQyeRrwYm6Xi4KaZSfb4FB20ocZ/VlrQzTR2wiEobMxT/OM/FXgd0:16248:0:99999:7::: sshd:*:16248:0:99999:7::: ivan:$6$7qFVyIS/$d6QA1gx0rQ4Xq0WsfDRIllO/Mc0Ytyqc6bqxOtsrKhqGxjdIrD446Jt6BI/yABuRM6P0Bjpq.M7GVVvpemqGe0:18295:0:99999:7::: petr:$6$BCwgxnR9$DkDRXQnUbqCrCexjlQ4MGCC1JTZSBHyKzTN7HW29wmTpuvVkMhuS2ktpuEY8xV.oj3fDKYmyFI4Vlu72.VEJ20:18295:0:99999:7::: anna:$6$oyb7YQqa$sQ2bvfl7ufVDVLszTQR6K4rHuZjNSLgP6/rFy0v1NtYNNdJj98epoHYpzNiHmOnIp3oRnj3TDK1E2p7oDqta51:18297:0:99999:7::: |
#cat /userdel -r anna
![]() cat: invalid option -- 'r' Try `cat --help' for more information. |
#userdel -r anna
userdel: anna mail spool (/var/mail/anna) not found |
#ls /home/
ivan petr user |
#umask
0022 |
#umask 0027
|
#umask
0027 |
#mkdir d2
![]() mkdir: cannot create directory `d2': File exists |
#mkdir d3
|
#ls -l d3
total 0 |
#ls -l
total 32 -rw-r--r-- 1 root root 0 Feb 4 11:41 -bad-name- -rw-r--r-- 1 root root 0 Feb 4 11:37 A' Stah -rw-r--r-- 1 root root 0 Feb 4 11:38 A:\Stah\11 -rw-r--r-- 1 root root 0 Feb 4 11:38 A:\Stah\22 -rw-r--r-- 1 root root 0 Feb 4 11:34 Andrey Stah -rw-r--r-- 1 root root 0 Feb 4 11:35 Andrey Stah2 drwxr-xr-x 2 root root 4096 Feb 3 12:52 d1 drwxr-xr-x 3 root root 4096 Feb 3 15:17 d2 drwxr-x--- 2 root root 4096 Feb 5 12:29 d3 -rw-r--r-- 1 root root 0 Feb 4 16:38 file1.gz -rw-r--r-- 1 root root 0 Feb 4 16:38 file2.tar -rw-r--r-- 1 root root 0 Feb 4 16:38 file3.jpg -rw-r--r-- 1 root root 5388 Feb 4 13:33 install -rw-r--r-- 1 root root 0 Feb 4 11:35 one space -rw-r--r-- 1 root root 96 Feb 4 10:05 ~ivan -rw-r--r-- 1 root root 96 Feb 4 10:05 ~petr -rw-r--r-- 1 root root 96 Feb 4 10:05 ~user |
#mkdir d3
![]() mkdir: cannot create directory `d3': File exists |
#mkdir /opt/public
|
#ls -l /opt/public/
total 0 |
#ls -l /opt/public
total 0 |
#cd /opt/
|
#ls -l
total 4 drwxr-x--- 2 root root 4096 Feb 5 12:31 public |
#chmod 777 public
|
#ls -l
total 4 drwxrwxrwx 2 root root 4096 Feb 5 12:31 public |
#cd public/
|
#touch ROOT_file
|
#chmod 600 ROOT_file
|
#ls -l
total 0 -rw------- 1 root root 0 Feb 5 12:35 ROOT_file |
#cd ..
|
#chmod +t public/
|
#ls -l
total 4 drwxrwxrwt 2 root root 4096 Feb 5 12:37 public |
#touch ROOT_file
|
#ls -l
total 4 -rw-r----- 1 root root 0 Feb 5 12:39 ROOT_file drwxrwxrwt 2 root root 4096 Feb 5 12:37 public |
#mv ROOT_file public/
|
#chmod o-x public
|
#ls -l
total 4 drwxrwxrwT 2 root root 4096 Feb 5 12:39 public |
#chmod o+x public
|
#ls -l
total 4 drwxrwxrwt 2 root root 4096 Feb 5 12:39 public |
#cd
|
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false user:x:1000:1000:user,,,:/home/user:/bin/bash sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin ivan:x:1001:1001:Ivanov Ivan,9C,111,222-22-22:/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash
root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4: tty:x:5: disk:x:6: lp:x:7: mail:x:8: news:x:9: uucp:x:10: man:x:12: proxy:x:13: kmem:x:15: dialout:x:20: fax:x:21: voice:x:22: cdrom:x:24:user floppy:x:25:user tape:x:26: sudo:x:27: audio:x:29:user dip:x:30:user www-data:x:33: backup:x:34: operator:x:37: list:x:38: irc:x:39: src:x:40: gnats:x:41: shadow:x:42: utmp:x:43: video:x:44:user sasl:x:45: plugdev:x:46:user staff:x:50: games:x:60: users:x:100: nogroup:x:65534: libuuid:x:101: crontab:x:102: Debian-exim:x:103: ssh:x:104: user:x:1000: ivan:x:1001: petr:x:1002: devops:x:1003:
root:$6$ppY7xZxX$CnutMU4XxetHko6DW5K/ckfiA6CFeC0cbV/d6rrWE6F5iszqxAaQTwekH3.vBTQPNCakvqusvPcBecndLcbX8.:16248:0:99999:7::: daemon:*:16248:0:99999:7::: bin:*:16248:0:99999:7::: sys:*:16248:0:99999:7::: sync:*:16248:0:99999:7::: games:*:16248:0:99999:7::: man:*:16248:0:99999:7::: lp:*:16248:0:99999:7::: mail:*:16248:0:99999:7::: news:*:16248:0:99999:7::: uucp:*:16248:0:99999:7::: proxy:*:16248:0:99999:7::: www-data:*:16248:0:99999:7::: backup:*:16248:0:99999:7::: list:*:16248:0:99999:7::: irc:*:16248:0:99999:7::: gnats:*:16248:0:99999:7::: nobody:*:16248:0:99999:7::: libuuid:!:16248:0:99999:7::: Debian-exim:!:16248:0:99999:7::: user:$6$CkJHVC8E$ykTJUix/7qmcPBJgqnJtCHlWhYfEaImqXcQyeRrwYm6Xi4KaZSfb4FB20ocZ/VlrQzTR2wiEobMxT/OM/FXgd0:16248:0:99999:7::: sshd:*:16248:0:99999:7::: ivan:$6$7qFVyIS/$d6QA1gx0rQ4Xq0WsfDRIllO/Mc0Ytyqc6bqxOtsrKhqGxjdIrD446Jt6BI/yABuRM6P0Bjpq.M7GVVvpemqGe0:18295:0:99999:7::: petr:$6$BCwgxnR9$DkDRXQnUbqCrCexjlQ4MGCC1JTZSBHyKzTN7HW29wmTpuvVkMhuS2ktpuEY8xV.oj3fDKYmyFI4Vlu72.VEJ20:18295:0:99999:7::: anna:$6$oyb7YQqa$sQ2bvfl7ufVDVLszTQR6K4rHuZjNSLgP6/rFy0v1NtYNNdJj98epoHYpzNiHmOnIp3oRnj3TDK1E2p7oDqta51:18297:0:99999:7:::
Время первой команды журнала | 14:40:10 2020- 2- 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 11:41:38 2020- 2- 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 10.89 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 4.95 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.06 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.55 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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