Users & groups
users
show users currently logged
similar to: who
groups [OPTION]... [USERNAME]..
e.g.
peter : peter adm cdrom sudo plugdev lpadmin
id
e.g.
uid=1000(peter) gid=1000(peter) groups=1000(peter),4(adm),24(cdrom),
27(sudo),30(dip),46(plugdev)
(755)?
ls -l
e.g.
total 112
-rw-r--r-- 1 peter peter 33858 Oct 1 03:41 a.png
drwxr-xr-x 3 peter peter 4096 Nov 18 21:31 Desktop
drwxr-xr-x 2 peter peter 4096 Jul 25 07:59 Documents
drwxr-xr-x 4 peter peter 4096 Nov 20 14:49 Downloads
source: 鳥哥
source: 鳥哥
interpret file permission as binary
r: 4
w: 2
x: 1
rwx: 7
r-x: 5
==> -rwxr-xr-x: 755
$ chmod
e.g.
chmod -x file
chmod -R 777 file
chmod 644 file
chmod +w file
$ chown [-R] <user>:<group> file
e.g.
chown peter file
chown peter:admin file
use sudo
sudo + command
soft link v.s. hard link
source:
https://askubuntu.com/questions/108771/what-is-the-difference-between-a-hard-link-and-a-symbolic-link
$ ln [-s] origin-file link-file
e.g.
ln myfile hard-link
ln -s myfile soft-link
$ ps [option]
e.g.
ps -a
ps -au
ps -aux
[just kidding]
kill command
$ kill -<signal> process-id
kill -TERM webserver
kill -9 myprogram
htop
tab?
tmux
just shell script
a shell command interpreter
only string t
$ env
$ echo $myvar
$ myvar=var1