Linux教程

临时存放(Linux)

本文主要是介绍临时存放(Linux),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

qiancheng@ubuntu:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           393M  6.2M  386M   2% /run
/dev/sda1        19G  4.3G   14G  24% /
tmpfs           2.0G  320K  2.0G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           393M  8.0K  393M   1% /run/user/108
tmpfs           393M   48K  393M   1% /run/user/1000
qiancheng@ubuntu:~$ 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=1978080k,nr_inodes=494520,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=401568k,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/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
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/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=20268)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
vmware-vmblock on /run/vmblock-fuse type fuse.vmware-vmblock (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)
tmpfs on /run/user/108 type tmpfs (rw,nosuid,nodev,relatime,size=401568k,mode=700,uid=108,gid=114)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=401568k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
qiancheng@ubuntu:~$ fdisk -l
fdisk: cannot open /dev/sda: Permission denied
fdisk: cannot open /dev/sdb: Permission denied
qiancheng@ubuntu:~$ sudo su
[sudo] password for qiancheng: 
root@ubuntu:/home/qiancheng# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x30e7cfc5

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048 39942143 39940096   19G 83 Linux
/dev/sda2       39944190 41940991  1996802  975M  5 Extended
/dev/sda5       39944192 41940991  1996800  975M 82 Linux swap / Solaris


Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@ubuntu:/home/qiancheng# cd /mnt/
root@ubuntu:/mnt# ls
root@ubuntu:/mnt# mkdir mnt_1
root@ubuntu:/mnt# mount /dev/sdb /mnt/mnt_1/
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
root@ubuntu:/mnt# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           393M  6.2M  386M   2% /run
/dev/sda1        19G  4.3G   14G  24% /
tmpfs           2.0G  212K  2.0G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           393M  4.0K  393M   1% /run/user/108
tmpfs           393M   48K  393M   1% /run/user/1000
root@ubuntu:/mnt# ll
total 12
drwxr-xr-x  3 root root 4096 Oct 25 23:37 ./
drwxr-xr-x 24 root root 4096 Oct 25 18:46 ../
drwxr-xr-x  2 root root 4096 Oct 25 23:37 mnt_1/
root@ubuntu:/mnt# cd /
root@ubuntu:/# mount /dev/sdb /mnt/mnt_1/
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
root@ubuntu:/# mount /dev/sdb /mnt/mnt_1/^C
root@ubuntu:/# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x30e7cfc5

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048 39942143 39940096   19G 83 Linux
/dev/sda2       39944190 41940991  1996802  975M  5 Extended
/dev/sda5       39944192 41940991  1996800  975M 82 Linux swap / Solaris


Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@ubuntu:/# mount /dev/sd /mnt/mnt_1/
sda   sda1  sda2  sda5  sdb   
root@ubuntu:/# mount /dev/sd /mnt/mnt_1/
sda   sda1  sda2  sda5  sdb   
root@ubuntu:/# mount /dev/sdb /mnt/mnt_1/
sdb
root@ubuntu:/# mount /dev/sdb /mnt/mnt_1/
sdb
root@ubuntu:/# mount /dev/sdb /mnt/mnt_1/
sdb
root@ubuntu:/# mount /dev/sdb  /mnt/mnt_1/
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
root@ubuntu:/# ls
bin    dev   initrd.img      lib64       mnt   root  snap  tmp  vmlinuz
boot   etc   initrd.img.old  lost+found  opt   run   srv   usr
cdrom  home  lib             media       proc  sbin  sys   var
root@ubuntu:/# mount /dev/sdb  /mnt/mnt_1/^C
root@ubuntu:/# ^C
root@ubuntu:/# ^C
root@ubuntu:/# fdisk  -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x30e7cfc5

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048 39942143 39940096   19G 83 Linux
/dev/sda2       39944190 41940991  1996802  975M  5 Extended
/dev/sda5       39944192 41940991  1996800  975M 82 Linux swap / Solaris


Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@ubuntu:/# mount /dev/sdb  /mnt/mnt_1/ auto

Usage:
 mount [-lhV]
 mount -a [options]
 mount [options] [--source] <source> | [--target] <directory>
 mount [options] <source> <directory>
 mount <operation> <mountpoint> [<target>]

Mount a filesystem.

Options:
 -a, --all               mount all filesystems mentioned in fstab
 -c, --no-canonicalize   don't canonicalize paths
 -f, --fake              dry run; skip the mount(2) syscall
 -F, --fork              fork off for each device (use with -a)
 -T, --fstab <path>      alternative file to /etc/fstab
 -i, --internal-only     don't call the mount.<type> helpers
 -l, --show-labels       show also filesystem labels
 -n, --no-mtab           don't write to /etc/mtab
 -o, --options <list>    comma-separated list of mount options
 -O, --test-opts <list>  limit the set of filesystems (use with -a)
 -r, --read-only         mount the filesystem read-only (same as -o ro)
 -t, --types <list>      limit the set of filesystem types
     --source <src>      explicitly specifies source (path, label, uuid)
     --target <target>   explicitly specifies mountpoint
 -v, --verbose           say what is being done
 -w, --rw, --read-write  mount the filesystem read-write (default)

 -h, --help     display this help and exit
 -V, --version  output version information and exit

Source:
 -L, --label <label>     synonym for LABEL=<label>
 -U, --uuid <uuid>       synonym for UUID=<uuid>
 LABEL=<label>           specifies device by filesystem label
 UUID=<uuid>             specifies device by filesystem UUID
 PARTLABEL=<label>       specifies device by partition label
 PARTUUID=<uuid>         specifies device by partition UUID
 <device>                specifies device by path
 <directory>             mountpoint for bind mounts (see --bind/rbind)
 <file>                  regular file for loopdev setup

Operations:
 -B, --bind              mount a subtree somewhere else (same as -o bind)
 -M, --move              move a subtree to some other place
 -R, --rbind             mount a subtree and all submounts somewhere else
 --make-shared           mark a subtree as shared
 --make-slave            mark a subtree as slave
 --make-private          mark a subtree as private
 --make-unbindable       mark a subtree as unbindable
 --make-rshared          recursively mark a whole subtree as shared
 --make-rslave           recursively mark a whole subtree as slave
 --make-rprivate         recursively mark a whole subtree as private
 --make-runbindable      recursively mark a whole subtree as unbindable

For more details see mount(8).
root@ubuntu:/# mount /dev/sdb  /mnt/mnt_1/ -a
root@ubuntu:/# cd /mnt/mnt_1/
root@ubuntu:/mnt/mnt_1# ls
root@ubuntu:/mnt/mnt_1# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           393M  6.2M  387M   2% /run
/dev/sda1        19G  4.3G   14G  24% /
tmpfs           2.0G  212K  2.0G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           393M   48K  393M   1% /run/user/1000
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# root@ubuntu:/# mount /dev/sdb  /mnt/mnt_1/^C
bash: root@ubuntu:/#: No such file or directory
root@ubuntu:/mnt/mnt_1# root@ubuntu:/# ^C
bash: root@ubuntu:/#: No such file or directory
root@ubuntu:/mnt/mnt_1# root@ubuntu:/# ^C
bash: root@ubuntu:/#: No such file or directory
root@ubuntu:/mnt/mnt_1# root@ubuntu:/# fdisk  -l
bash: root@ubuntu:/#: No such file or directory
root@ubuntu:/mnt/mnt_1# Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
No command 'Disk' found, did you mean:
 Command 'risk' from package 'xfrisk' (universe)
Disk: command not found
root@ubuntu:/mnt/mnt_1# Units: sectors of 1 * 512 = 512 bytes
Units:: command not found
root@ubuntu:/mnt/mnt_1# Sector size (logical/physical): 512 bytes / 512 bytes
bash: syntax error near unexpected token `('
root@ubuntu:/mnt/mnt_1# I/O size (minimum/optimal): 512 bytes / 512 bytes
bash: syntax error near unexpected token `('
root@ubuntu:/mnt/mnt_1# Disklabel type: dos
Disklabel: command not found
root@ubuntu:/mnt/mnt_1# Disk identifier: 0x30e7cfc5
No command 'Disk' found, did you mean:
 Command 'risk' from package 'xfrisk' (universe)
Disk: command not found
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# Device     Boot    Start      End  Sectors  Size Id Type
Device: command not found
root@ubuntu:/mnt/mnt_1# /dev/sda1  *        2048 39942143 39940096   19G 83 Linux
bash: /dev/sda1: Permission denied
root@ubuntu:/mnt/mnt_1# /dev/sda2       39944190 41940991  1996802  975M  5 Extended
bash: /dev/sda2: Permission denied
root@ubuntu:/mnt/mnt_1# /dev/sda5       39944192 41940991  1996800  975M 82 Linux swap / Solaris
bash: /dev/sda5: Permission denied
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 sectors
No command 'Disk' found, did you mean:
 Command 'risk' from package 'xfrisk' (universe)
Disk: command not found
root@ubuntu:/mnt/mnt_1# Units: sectors of 1 * 512 = 512 bytes
Units:: command not found
root@ubuntu:/mnt/mnt_1# Sector size (logical/physical): 512 bytes / 512 bytes
bash: syntax error near unexpected token `('
root@ubuntu:/mnt/mnt_1# I/O size (minimum/optimal): 512 bytes / 512 bytes
bash: syntax error near unexpected token `('
root@ubuntu:/mnt/mnt_1# root@ubuntu:/# mount /dev/sdb  /mnt/mnt_1/ auto
bash: root@ubuntu:/#: No such file or directory
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# Usage:
Usage:: command not found
root@ubuntu:/mnt/mnt_1#  mount [-lhV]
mount: can't find [-lhV] in /etc/fstab
root@ubuntu:/mnt/mnt_1#  mount -a [options]
root@ubuntu:/mnt/mnt_1#  mount [options] [--source] <source> | [--target] <directory>
bash: syntax error near unexpected token `|'
root@ubuntu:/mnt/mnt_1#  mount [options] <source> <directory>
bash: syntax error near unexpected token `<'
root@ubuntu:/mnt/mnt_1#  mount <operation> <mountpoint> [<target>]
bash: syntax error near unexpected token `<'
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# Mount a filesystem.
No command 'Mount' found, did you mean:
 Command 'mount' from package 'mount' (main)
Mount: command not found
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# Options:
Options:: command not found
root@ubuntu:/mnt/mnt_1#  -a, --all               mount all filesystems mentioned in fstab
-a,: command not found
root@ubuntu:/mnt/mnt_1#  -c, --no-canonicalize   don't canonicalize paths
>  -f, --fake              dry run; skip the mount(2) syscall
>  -F, --fork              fork off for each device (use with -a)
>  -T, --fstab <path>      alternative file to /etc/fstab
>  -i, --internal-only     don't call the mount.<type> helpers
bash: type: No such file or directory
root@ubuntu:/mnt/mnt_1#  -l, --show-labels       show also filesystem labels
-l,: command not found
root@ubuntu:/mnt/mnt_1#  -n, --no-mtab           don't write to /etc/mtab
>  -o, --options <list>    comma-separated list of mount options
>  -O, --test-opts <list>  limit the set of filesystems (use with -a)
>  -r, --read-only         mount the filesystem read-only (same as -o ro)
>  -t, --types <list>      limit the set of filesystem types
>      --source <src>      explicitly specifies source (path, label, uuid)
>      --target <target>   explicitly specifies mountpoint
>  -v, --verbose           say what is being done
>  -w, --rw, --read-write  mount the filesystem read-write (default)
> 
>  -h, --help     display this help and exit
>  -V, --version  output version information and exit
> 
> Source:
>  -L, --label <label>     synonym for LABEL=<label>
>  -U, --uuid <uuid>       synonym for UUID=<uuid>
>  LABEL=<label>           specifies device by filesystem label
>  UUID=<uuid>             specifies device by filesystem UUID
>  PARTLABEL=<label>       specifies device by partition label
>  PARTUUID=<uuid>         specifies device by partition UUID
>  <device>                specifies device by path
>  <directory>             mountpoint for bind mounts (see --bind/rbind)
>  <file>                  regular file for loopdev setup
> 
> Operations:
>  -B, --bind              mount a subtree somewhere else (same as -o bind)
>  -M, --move              move a subtree to some other place
>  -R, --rbind             mount a subtree and all submounts somewhere else
>  --make-shared           mark a subtree as shared
>  --make-slave            mark a subtree as slave
>  --make-private          mark a subtree as private
>  --make-unbindable       mark a subtree as unbindable
>  --make-rshared          recursively mark a whole subtree as shared
>  --make-rslave           recursively mark a whole subtree as slave
>  --make-rprivate         recursively mark a whole subtree as private
>  --make-runbindable      recursively mark a whole subtree as unbindable
> 
> 
> 
> ^C
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# touch 111
root@ubuntu:/mnt/mnt_1# vim 111 111 
The program 'vim' can be found in the following packages:
 * vim
 * vim-gnome
 * vim-tiny
 * vim-athena
 * vim-athena-py2
 * vim-gnome-py2
 * vim-gtk
 * vim-gtk-py2
 * vim-gtk3
 * vim-gtk3-py2
 * vim-nox
 * vim-nox-py2
Try: apt install <selected package>
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# vim 111 
The program 'vim' can be found in the following packages:
 * vim
 * vim-gnome
 * vim-tiny
 * vim-athena
 * vim-athena-py2
 * vim-gnome-py2
 * vim-gtk
 * vim-gtk-py2
 * vim-gtk3
 * vim-gtk3-py2
 * vim-nox
 * vim-nox-py2
Try: apt install <selected package>
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# 
root@ubuntu:/mnt/mnt_1# ls
111
root@ubuntu:/mnt/mnt_1# vi 111 
root@ubuntu:/mnt/mnt_1# cat /usr/^C
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# ^C
root@ubuntu:/mnt/mnt_1# 

 

这篇关于临时存放(Linux)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!