Linux 基本認識與常用指令整理
============================
https://dylan237.github.io/linux-basic.html
https://blog.gtwang.org/linux/sudo-su-command-tutorial-examples/
0) https://help.ubuntu.com/kubuntu/desktopguide/C/apt-get.html
https://www.geeksforgeeks.org/set-file-permissions-linux/
ls
ls -l
l
1) ubuntu version
Open up your terminal using the keyboard shortcut Ctrl + Alt + T.
lsb_release -a
2) who – a command that displays the list of all currently logged in users on the system.
w – a command that displays a more detailed output of the currently logged in users.
whoami – a command that displays the current user’s username.
3) How do I find user details in Ubuntu?
nano /etc/passwd
cat /etc/passwd
cat /etc/passwd | grep "^root" #"^yk"
4) The "pwd" command prints the full name (the full path) of current/working directory.
pwd
5) Directories and File Systems
In Linux and Unix everything is a file. Directories are files, files are files, and devices are files. Devices are usually referred to as nodes; however, they are still files.
Linux and Unix file systems are organized in a hierarchical, tree-like structure. The highest level of the file system is the / or root directory. All other files and directories exist under the root directory. For example, /home/jebediah/cheeses.odt shows the correct full path to the cheeses.odt file that exists in the jebediah directory, which is under the home directory, which in turn is under the root (/) directory.
Underneath the root (/) directory is a set of important directories common to most Linux distributions. The following is a listing of common directories that are directly under the root (/) directory:
/bin - important binary applications
/boot - boot configuration files, kernels, and other files needed at boot time
/dev - the device files
/etc - configuration files, startup scripts, etc.
/home - home directories for different users
/initrd - used when creating a customized initrd boot process
/lib - system libraries
/lost+found - provides a lost+found system for files that exist under the root (/) directory
/media - automatically mounted (loaded) partitions on your hard drive and removable media such as CDs, digital cameras, etc.
/mnt - manually mounted filesystems on your hard drive
/opt - provides a location for optional (3rd party) applications to be installed
/proc - special dynamic directory that maintains information about the state of the system, including currently running processes
/root - root user's home directory, pronounced "slash-root"
/sbin - important system binaries
/srv - can contain files that are served to other systems
/sys - system files
/tmp - temporary files
/usr - applications and files that are mostly available for all users to access
/var - variable files such as logs and databases